skills/railway-cli/SKILL.md
Manage Railway cloud deployments via the Railway CLI. Use when the user wants to deploy, manage services, set variables, view logs, link projects, add databases, configure domains, manage volumes, or perform any Railway platform operation from the terminal.
npx skillsauth add miketromba/skills railway-cliInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Operate the Railway platform from the command line. Covers the full lifecycle: authentication, project setup, deployment, services, variables, environments, logs, domains, volumes, functions, and local development.
Source of truth: Railway CLI Docs
Assume railway is installed. If a command fails with "command not found" or similar, install it before retrying:
# macOS (preferred)
brew install railway
# Any OS with Node.js >= 16
npm i -g @railway/cli
# Shell script (macOS / Linux / WSL)
bash <(curl -fsSL cli.new)
After install, verify with railway --version, then resume the original task.
The Railway CLI evolves across versions. When you encounter an unfamiliar subcommand or need to check current flags:
railway --help # Top-level commands
railway <command> --help # Subcommand flags and usage
Always prefer --help output over memorized flags when composing complex commands. This keeps behavior correct even as the CLI updates.
railway login # Browser-based login
railway login --browserless # Token-based login (CI, SSH sessions)
railway logout
railway whoami # Verify current identity
CI/CD token auth (no interactive login):
RAILWAY_TOKEN — project-scoped actionsRAILWAY_API_TOKEN — account/workspace-scoped actionsRAILWAY_TOKEN=<token> railway up
railway init # Create new project (interactive)
railway link # Link cwd to existing project
railway unlink # Unlink cwd
railway status # Current project/service/environment info
railway list # All projects in workspace
railway open # Open project in browser
railway up # Deploy cwd
railway up --detach # Deploy without tailing logs
railway deploy --template postgres # Deploy from a template
railway redeploy # Redeploy latest deployment
railway restart # Restart service (no new build)
railway down # Remove latest deployment
railway add # Add service (interactive)
railway add --database postgres # Add a database (postgres, mysql, redis, mongo)
railway add --repo user/repo # Add service from GitHub repo
railway service # Switch linked service (interactive)
railway scale # Scale service replicas
railway delete # Delete the project
railway variable list # List all variables
railway variable set KEY=value # Set a variable
railway variable set K1=v1 K2=v2 # Set multiple at once
railway variable delete KEY # Remove a variable
railway environment # Switch environment (interactive)
railway environment new <name> # Create environment
railway environment delete <name> # Delete environment
railway run <cmd> # Run command with Railway env vars injected
railway shell # Open shell with Railway env vars
railway dev # Run services locally with Docker
railway run is useful for running migrations, seeds, or scripts that need production/staging credentials without .env files.
railway logs # Stream live deployment logs
railway logs --build # View build logs
railway logs -n 100 # Last N lines
railway ssh # SSH into running service container
railway connect # Connect to database shell (psql, mysql, redis-cli, mongosh)
railway domain # Generate a Railway subdomain
railway domain example.com # Attach a custom domain
railway volume list
railway volume add
railway volume delete
railway functions list
railway functions new
railway functions push
railway completion bash # Generate shell completions (bash/zsh/fish)
railway docs # Open docs in browser
railway upgrade # Upgrade CLI to latest version
These flags work across most commands:
| Flag | Description |
|------|-------------|
| -s, --service <name-or-id> | Target a specific service |
| -e, --environment <name-or-id> | Target a specific environment |
| --json | Output as JSON (useful for scripting) |
| -y, --yes | Skip confirmation prompts |
| -h, --help | Show help |
| -V, --version | Show CLI version |
railway login
railway init # or: railway link
railway up
railway domain # get a public URL
railway logs # verify deployment
railway add --database postgres
railway connect # verify connectivity
railway variable list # check injected DATABASE_URL
railway environment new staging
railway up -e staging
railway logs -e staging
railway run -e production npx prisma migrate deploy
For the full and most current reference, see reference.md or consult:
railway --help / railway <command> --helptools
Vercel Sandbox documentation and guidance for running untrusted code in isolated environments. Use when working with Vercel Sandbox - a compute primitive for safely executing AI-generated code, user-submitted scripts, or developer experiments in Firecracker microVMs. Triggers on questions about Vercel Sandbox SDK, sandbox CLI, @vercel/sandbox, Sandbox.create, snapshots, persistent sandboxes, sandbox authentication, sandbox pricing, sandbox system specs, microVMs, code execution isolation, or ANY Vercel Sandbox-related development tasks.
development
Vercel for Platforms documentation and guidance for building multi-tenant and multi-project applications. Use when working with Vercel Platforms - building SaaS apps serving multiple tenants with custom domains, AI coding platforms, or any platform deploying multiple projects. Triggers on questions about multi-tenant architecture, multi-project platforms, wildcard domains, custom domains on Vercel, tenant middleware, Vercel SDK for platforms, platform elements, deploy actions, vibe coding platforms, or ANY Vercel Platforms-related development tasks.
development
TanStack Query (React Query) documentation and guidance. Use when working with TanStack Query - a powerful async state management library for data fetching, caching, synchronization, and server state management. Triggers on questions about React Query, TanStack Query, useQuery, useMutation, query invalidation, caching strategies, optimistic updates, infinite queries, prefetching, or ANY TanStack Query-related development tasks.
tools
Supabase backend-as-a-service platform documentation and guidance. Use when working with Supabase - an open-source Firebase alternative providing Postgres database, authentication, real-time subscriptions, edge functions, storage, and vector embeddings. Triggers on questions about Supabase setup, database, auth, RLS, edge functions, storage, realtime, pgvector, migrations, CLI, self-hosting, or ANY Supabase-related development tasks.