modules/railway_cli/SKILL.md
Manage Railway infrastructure - deploy services, manage environment variables, and monitor deployments using the Railway CLI.
npx skillsauth add ethereumdegen/stark-bot railwayInstall 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.
Manage your Railway infrastructure using the Railway CLI. Deploy services, manage environment variables, check deployment status, and more.
First, check if RAILWAY_API_TOKEN is configured:
key_name: RAILWAY_API_TOKEN
If not configured, ask the user to create a token at https://railway.com/account/tokens and add it in Settings > API Keys as RAILWAY_API_TOKEN.
The RAILWAY_API_TOKEN env var is automatically injected into all exec commands.
Ensure the Railway CLI is installed:
command: railway --version
timeout: 30
Railway CLI is installed by the railway_cli module. If missing, reinstall via manage_modules(action="install", name="railway_cli").
Use railway list to verify auth (works with all token types — account, workspace, and project tokens). Do NOT use railway whoami as it only works with account tokens and will fail with workspace/project tokens.
command: railway list
timeout: 30
command: railway list --json
timeout: 30
After linking to a project (see operation #4), check its status:
command: railway status --json
timeout: 30
Link the current workspace to a project so subsequent commands target it. Use --project and --environment flags to avoid interactive prompts:
command: railway link --project PROJECT_ID --environment ENVIRONMENT_ID
timeout: 30
View recent deployment logs:
command: railway logs -n 50
timeout: 30
View build logs:
command: railway logs --build -n 100
timeout: 30
IMPORTANT: Confirm with the user before triggering a redeploy.
command: railway redeploy -y
timeout: 30
command: railway variable list --json
timeout: 30
IMPORTANT: Confirm with the user before modifying environment variables.
command: railway variable set KEY=VALUE
timeout: 30
For multiple variables:
command: railway variable set KEY1=VALUE1 KEY2=VALUE2
timeout: 30
command: railway domain
timeout: 30
Deploy a GitHub repository to Railway. This is a multi-step workflow.
IMPORTANT: Confirm the repo URL, project name, and branch with the user before proceeding.
Call define_tasks with all steps upfront so progress is tracked:
{"tool": "define_tasks", "tasks": [
"TASK 1 — Create project: create a new Railway project. See railway skill 'Step 2'.",
"TASK 2 — Add service from repo: add a service linked to the GitHub repo. See railway skill 'Step 3'.",
"TASK 3 — Generate domain: assign a public .railway.app domain. See railway skill 'Step 4'.",
"TASK 4 — Set env vars: configure environment variables if needed. See railway skill 'Step 5'.",
"TASK 5 — Verify deployment: check logs and confirm service is live. See railway skill 'Step 6'."
]}
command: railway init --name PROJECT_NAME
timeout: 60
This creates a project and links the current workspace to it.
Tip: If deploying into an existing project, use operation #4 (link) instead.
Option A: GitHub repo link (requires Railway GitHub App)
command: railway add --repo OWNER/REPO
timeout: 60
Replace OWNER/REPO with the GitHub repository (e.g. ethereumdegen/x402-gif-machine). Railway will automatically trigger an initial deployment.
If this fails with "repo not found", the Railway GitHub App doesn't have access. Fall back to Option B.
Option B: Clone and deploy (no GitHub App needed)
Clone the repo locally and deploy with railway up:
command: git clone https://github.com/OWNER/REPO.git /tmp/railway-deploy-REPO
timeout: 120
Then link and deploy from the cloned directory:
command: cd /tmp/railway-deploy-REPO && railway link --project PROJECT_ID --environment production && railway up --detach
timeout: 300
Note: Option B deploys a snapshot. It won't auto-deploy on new commits like Option A does. For auto-deploy, the user needs to configure the Railway GitHub App on their repo (GitHub → Settings → Applications → Railway → Configure).
command: railway domain
timeout: 30
Use operation #8 to set any env vars the service needs.
Check the deployment logs to confirm it built and deployed successfully:
command: railway logs --build -n 100
timeout: 60
Then check runtime logs:
command: railway logs -n 50
timeout: 30
Deploy the current working directory to Railway:
command: railway up --detach
timeout: 300
Use --detach to avoid blocking while the build runs. Check logs separately.
IMPORTANT: Confirm with the user before deleting.
command: railway delete -y
timeout: 30
| Error | Cause | Solution |
|-------|-------|----------|
| Unauthorized on whoami | whoami only works with Account tokens, not workspace/project tokens | Use railway list instead to verify auth, or create an Account Token (select "No workspace") |
| Unauthorized on other commands | Token is invalid/expired or wrong scope | Regenerate token at https://railway.com/account/tokens |
| Cannot login in non-interactive mode | CLI requires browser login | Use RAILWAY_API_TOKEN env var instead (already injected by exec) |
| No project linked | CLI doesn't know which project to target | Use railway link --project ID --environment ID first |
| Service creation fails | Railway GitHub app not authorized | Install at https://railway.com/account/github |
RAILWAY_API_TOKEN) — full access, works with CLI, preferredrailway list (NOT whoami — it only works with account tokens)railway listrailway link --project ID --environment IDrailway statusrailway link so commands target the right project--json flag where available for structured outputtools
Provide liquidity on Uniswap V4 (Base) — deposit to pools, withdraw, collect fees.
tools
Swap ERC20 tokens on Base using 0x DEX aggregator via quoter.defirelay.com
data-ai
Monitor ETH wallets for on-chain activity, detect whale trades, and track transaction history on Ethereum Mainnet and Base
tools
Manage Supabase projects - databases, migrations, edge functions, storage, and secrets using the Supabase CLI.