Global Options
Global options are flags that can be used with multiple Railway CLI commands.
Service
The --service option, shorthand -s, specifies which service to target. You can use either the service name or service ID.
railway logs --service backend
railway up --service api
railway variable list -s my-serviceEnvironment
The --environment option, shorthand -e, specifies which environment to target. You can use either the environment name or environment ID.
railway logs --environment staging
railway up --environment production
railway variable list -e devJSON output
The --json option outputs results in JSON format, useful for scripting and automation.
railway status --json
railway variable list --json
railway logs --jsonSkip confirmation
The --yes option, shorthand -y, skips confirmation prompts. Use this in scripts or CI/CD pipelines where interactive input isn't possible.
railway down --yes
railway redeploy -y
railway environment delete staging --yesHelp
The --help option, shorthand -h, displays help information for any command.
railway --help
railway up --help
railway logs -hVersion
The --version option displays the current Railway CLI version.
railway --version