SkillOpen
railway-cli
Use the Railway CLI to deploy services, manage environment variables, view logs, and configure projects on Railway.app. Use this instead of the Railway MCP server.
Front matter
name: railway-cli
description: Use the Railway CLI to deploy services, manage environment variables, view logs, and configure projects on Railway.app. Use this instead of the Railway MCP server.Railway CLI
Official CLI for Railway. Deploy apps, manage services, databases, and environment variables.
- Official repo: https://github.com/railwayapp/cli
- Docs: https://docs.railway.app/reference/cli-api
Authentication
railway login # Browser-based login
railway login --browserless # Token-based login
railway whoami # Check current userCommon Commands
Projects
railway init # Create new project
railway link # Link to existing project
railway status # Show current project/environment
railway list # List all projectsDeployments
railway up # Deploy current directory
railway up --detach # Deploy without following logs
railway logs # View service logs
railway logs --follow # Stream logs in real-timeEnvironment Variables
railway variables # List variables
railway variables set KEY=value
railway variables delete KEYServices
railway service # Select active service
railway add # Add a new service (database, etc.)
railway domain # Generate a domain for the serviceShell
railway shell # Open shell with Railway env vars loaded
railway run <command> # Run command with Railway env varsAgent Best Practices
- Use
railway runto execute commands with the project's env vars injected - Check
railway statusto confirm you're linked to the correct project/environment - Use
railway logs --followfor debugging deployment issues - Use
railway variablesto inspect and manage env vars without the dashboard - Deploy with
railway up --detachfor non-blocking deploys
Example Workflows
Deploy and check logs
railway up --detach
railway logs --num 50Run database migration with Railway env vars
railway run npx prisma migrate deploySource: written by One Giant Leap.
Related entries
There are more like this in the members library
The Claude Code library holds 13,843 entries. Members can search all of them by meaning and read every one in full.