← Back to tools
View AGENTS.md for Railway CLI
Railway CLI
Deploy and manage apps on Railway from the terminal
Description
Railway CLI lets you interact with the Railway platform from the command line. You can link local projects, deploy code, manage environment variables, provision databases, view logs, and manage services without leaving the terminal.
Install
homebrew
brew install railwaynpm
npm i -g @railway/cliAI Summary
CLI for the Railway deployment platform. Link local projects, deploy code, manage environment variables, provision databases, and view logs from the terminal.
Capabilities
- + Deploy applications to Railway with git push or CLI commands
- + Manage environment variables and secrets per environment
- + Provision and connect databases (Postgres, Redis, MySQL, MongoDB)
- + View real-time logs from deployed services
- + Link local projects to Railway services for development
Use When
- → Deploying applications to the Railway platform
- → Managing Railway environment variables and services from the terminal
- → Need a quick deployment platform with database provisioning
- → Running local development connected to Railway services
Avoid When
- x Not using Railway as your deployment platform
- x Need fine-grained infrastructure control (use AWS/GCP CLIs)
- x Deploying to Kubernetes or other container orchestration
Usage Patterns
Deploy current project
railway up Deploys the current directory to the linked Railway service
Run a command with Railway env vars
railway run npm start Executes the command with all Railway environment variables injected
View deployment logs
railway logs Streams real-time logs from the deployed service
Input / Output
stdin: Accepts interactive input for login and project selection
stdout: Deployment status, logs, and environment variable listings
stderr: Error messages and deployment warnings
Typical Pipelines
railway link && railway up to connect and deploy a project railway run prisma migrate deploy to run database migrations with Railway env vars railway variables | grep DATABASE to check database connection strings