RailwayDocs

railway shell

Open a new shell session with environment variables from your Railway service available.

Usage

Options

FlagDescription
-s, --service <SERVICE>Service to pull variables from (defaults to linked service)
--silentOpen shell without banner

Examples

Open shell with variables

Output:

Shell for specific service

Silent mode

How it works

  1. Fetches environment variables from the specified Railway service
  2. Opens a new shell with those variables in the environment
  3. Sets IN_RAILWAY_SHELL=true to indicate you're in a Railway shell

Type exit to leave the shell and return to your normal environment.

Shell detection

On Windows, the CLI detects your current shell (PowerShell, cmd, pwsh) and opens the same type. On Unix systems, it uses the $SHELL environment variable.

Difference from

  • shell: Opens an interactive shell session
  • run: Executes a single command and exits