Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Railway CLI

$ railway Official Med Risk
Railway · Cloud & Infra · MIT · macos / linux / windows

Railway CLI (railway) links local repositories to Railway projects and environments, offering --json on status, variables, logs, and domain commands, --detach deployments, and project-scoped RAILWAY_TOKEN authentication.

FCRS-1.0 Score
77 /100
Good
Medium Confidence
Zero-Friction Install
brew install railway
CLI vs MCP Decision Hybrid (CLI + MCP)

railway works well for up --detach, logs --json, and variables --json, while Railway's official MCP or GraphQL API helps manage unlinked workspaces.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 18 / 25

status, variables, logs, and domain support --json, though link and init rely heavily on interactive pickers when unlinked.

  • Supports --json on read subcommands and --detach on up
Trust & Safety 18 / 25

Project-scoped RAILWAY_TOKEN limits blast radius to one environment, though railway variables --json exposes plaintext secrets.

  • Environment-scoped RAILWAY_TOKEN support
Setup & Portability 14 / 15

Fast Rust binary distributed via Homebrew, npm, and GitHub releases.

  • Rust binary via brew install railway and @railway/cli
Utility & Efficiency 11 / 15

Very smooth once a repo is linked, though less expressive for multi-project orchestration.

  • Directory-linked workflow with railway run env injection
Maintenance & Lineage 9 / 10

Official railwayapp/cli repository actively maintained under MIT.

  • Official railwayapp/cli repository
Docs & Verifiability 7 / 10

Clear CLI reference docs, though some flag behaviors change quickly across releases.

  • Official docs at docs.railway.com

Security, Auth & Guardrails

Auth Modes
OAuth Browser Env API Key Config File
Credential Storage

Stores user auth and directory-to-project links in ~/.railway/config.json, or reads RAILWAY_TOKEN / RAILWAY_API_TOKEN.

Side Effects
Read-Only Local Write Remote Write Destructive Billing Impact
Cost & Quotas

CLI is free (MIT); Railway usage is billed per compute/memory/egress.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Railway CLI Agent Rules
- Always verify `railway status --json` before deploying or editing variables.
- Never echo raw `railway variables --json` secrets into public transcripts.
- Pass `--detach` on `railway up` so the command does not tail build logs indefinitely.

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect linked project and environment status
railway status --json

Displays the linked Railway project, environment, and services in JSON.

Read service environment variables as JSON
railway variables --json

Fetches environment variables for the linked service (avoid printing raw secrets to logs).

Controlled Writes & Previews

Deploy detached without streaming interactive logs
railway up --detach --ci

Uploads and triggers a build while exiting cleanly once queued.

Strengths for Agents

  • + Fast Rust binary with --json on status, variables, and logs.
  • + Project/environment-scoped RAILWAY_TOKEN supports clean CI/agent isolation.
  • + railway up --detach avoids blocking on long build streams.

Caveats & Pitfalls

  • ! Unlinked directories trigger interactive prompts on railway link unless project/service flags are provided.
  • ! railway variables --json outputs secret values in plaintext—agents must redact before logging.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI