id = "railway" name = "Railway CLI" homepage = "https://docs.railway.com/cli" description = "The Railway CLI lets you interact with your Railway projects from the command line." icon = "SimpleIcons:railway" executables = ["railway"] [dotfiles] # src/config.rs, `root_config_path`: the production CLI reads # `/.railway/config.json`; the staging and dev builds use # config-staging.json and config-dev.json in the same directory, which no # released binary writes. paths = ["~/.railway/config.json"] # README, "Installation": the install script "installs the CLI to # ~/.railway/bin" — the binary itself, not configuration. exclude = ["~/.railway/bin/"] # The file is not wholly a credential: it also carries the linked projects and # the editor preference. Only the session is lifted out. secret = [] # Read at the start of each command and written back at the end. side_effect = false # src/config.rs, `RailwayUser`: `railway login` stores the session here as # `token` — the legacy field `get_railway_auth_token` still falls back to — # plus the `accessToken` / `refreshToken` pair the CLI moved to. The struct # carries `#[serde(rename_all = "camelCase")]`, so those are the names on disk. [[dotfiles.secret_paths]] file = "~/.railway/config.json" match = { key_path = ["user.token", "user.accessToken", "user.refreshToken"] } # `projects` is the map `railway link` writes, keyed by and carrying # `projectPath` — the absolute directory on this machine that was linked to a # Railway project. The link means nothing on another machine's disk. # It records which of the user's own checkouts is linked to which project — # worth keeping so they can rebuild this machine's links, worth nothing on a # box whose disk holds different directories. [[dotfiles.machine_lines]] file = "~/.railway/config.json" match = { key_path = ["projects.*.projectPath"] } scope = "backup" [commands] format = 1 label = "Railway CLI" description = "Use the subcommand tabs to deploy, run a command or read logs." quality = "ai-draft" base = "fig:railway" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/railway.ts" license = "MIT" [[commands.subcommand]] path = ["up"] label = "Deploy" [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/railway.ts" license = "MIT" [[commands.subcommand.field]] id = "path" label = "Path" type = "path" position = 0 path = { kind = "directory", role = "input", must_exist = true } sources = ["fig"] [[commands.subcommand.field]] id = "detach" label = "Detach from build logs" type = "boolean" option = ["--detach", "-d"] sources = ["fig"] [[commands.subcommand.field]] id = "service" label = "Service" type = "string" option = ["--service", "-s"] sources = ["fig"] [[commands.subcommand.field]] id = "environment" label = "Environment" type = "string" option = ["--environment", "-e"] sources = ["fig"] [[commands.subcommand.task]] id = "deploy" label = "Deploy" fields = ["path", "service", "detach"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["path", "detach", "service", "environment"] [[commands.subcommand]] path = ["run"] label = "Run with project variables" description = "Everything after the options is the local command; type it at the prompt after the form fills." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/railway.ts" license = "MIT" [[commands.subcommand.field]] id = "service" label = "Service" type = "string" option = ["--service", "-s"] sources = ["fig"] [[commands.subcommand.field]] id = "environment" label = "Environment" type = "string" option = ["--environment", "-e"] sources = ["fig"] [[commands.subcommand.task]] id = "run" label = "Run" fields = ["service", "environment"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["service", "environment"] [[commands.subcommand]] path = ["logs"] label = "Show logs" [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/railway.ts" license = "MIT" [[commands.subcommand.field]] id = "lines" label = "Number of lines" type = "integer" option = ["--lines", "-n"] sources = ["fig"] [[commands.subcommand.task]] id = "tail" label = "Last lines" fields = ["lines"] required = ["lines"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["lines"]