Manage Railway deployments, view logs, check status, and manage environment variables. Use when working with Railway hosting, deployments, or infrastructure.
Manage Railway deployments and infrastructure using the Railway CLI.
Current status: !railway status 2>&1 || echo "NOT_LINKED"
Before running any command, check the pre-flight status above:
npm install -g @railway/clirailway login manually (requires browser)railway list to show available projectsrailway link -p <project-id>Based on $ARGUMENTS, execute the appropriate workflow:
railway status
railway domain
railway deployment list --limit 1
Report: project info, URL, and last deployment status/time.
Parse natural language options:
--filter "@level:error"--since 1h--build--lines 100Default: railway logs --lines 30
Summarize output - highlight errors, warnings, or interesting patterns.
railway up
Then wait and check:
railway deployment list --limit 1 to get statuscurl -s -o /dev/null -w "%{http_code}" <domain>railway logs --build --lines 50railway redeploy
Redeploys without rebuilding. Useful for env var changes.
railway restart
Restarts the service without rebuild or redeploy.
railway variables
IMPORTANT: When displaying variables, redact sensitive values:
For setting: railway variables set KEY=value
For deleting: railway variables delete KEY (ask for confirmation first!)
railway deployment list --limit 10
Format as a table with: ID (short), Status, Time ago, Commit message (truncated)
railway domain
Show the public URL. If none exists, offer to create one.
railway domain
Then curl the domain to check HTTP status:
curl -s -o /dev/null -w "%{http_code}" -m 10 <domain-url>
Report if healthy (2xx), unhealthy, or unreachable.
railway open
Opens the Railway dashboard in browser.
Switch to a different Railway project by name (fuzzy match).
# List all projects
railway list
Find the project ID that matches the name, then:
railway link -p <project-id>
Confirm the switch with railway status.
Connect to the project's database shell (Postgres, MongoDB, Redis, etc.)
railway connect
If multiple databases exist, Railway will prompt to select one.
List available projects and link one:
railway list
Show projects in a numbered list. Ask user which to link, then:
railway link -p <project-id>
Before destructive operations, ask for confirmation:
railway down - removes deploymentrailway variables delete - removes env varrailway unlink - unlinks projectFormat: "This will [action]. Are you sure? (y/n)"
Always provide:
Status check:
✓ MyApp is deployed and healthy
| Project | MyApp |
| Environment | production |
| Service | MyApp |
| URL | https://myapp-production.up.railway.app |
| Last deploy | 2 hours ago (SUCCESS) |
After deploy:
✓ Deployment successful
Build completed in 45s
URL: https://myapp-production.up.railway.app
Health check: 200 OK
On error:
✗ Deployment failed
Build error at line 23: Module not found 'xyz'
Suggested fix: Run `npm install xyz` and redeploy