|Docs

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-service

Environment

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 dev

JSON output

The --json option outputs results in JSON format, useful for scripting and automation.

railway status --json
railway variable list --json
railway logs --json

Skip 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 --yes

Help

The --help option, shorthand -h, displays help information for any command.

railway --help
railway up --help
railway logs -h

Version

The --version option displays the current Railway CLI version.

railway --version