railway shell
Open a new shell session with environment variables from your Railway service available.
Usage
Options
| Flag | Description |
|---|---|
-s, --service <SERVICE> | Service to pull variables from (defaults to linked service) |
--silent | Open shell without banner |
Examples
Open shell with variables
Output:
Shell for specific service
Silent mode
How it works
- Fetches environment variables from the specified Railway service
- Opens a new shell with those variables in the environment
- Sets
IN_RAILWAY_SHELL=trueto 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