# Railway CLI

> Command-line client for Railway projects: deploy with `railway up`, manage IaC config, configure AI agent tools via MCP, and launch cloud agent VMs.

Stars: 628 · Language: Rust · License: MIT · Categories: Dev Tools

- Repository: https://github.com/railwayapp/cli
- Website: https://railway.com
- Page: https://www.trmn.sh/tools/railway-cli

## Install

- Install script: `bash <(curl -fsSL railway.com/install.sh) -y`
- Install script with agent setup: `bash <(curl -fsSL railway.com/install.sh) --agents -y`

## Overview

The Railway CLI is a command-line client for interacting with Railway projects. It authenticates with `railway login` (or `railway login --browserless` for SSH sessions) and runs commands such as `railway up`. For CI/CD, it reads `RAILWAY_TOKEN` for project-level actions and `RAILWAY_API_TOKEN` for account or workspace-level actions instead of interactive login.

It includes infrastructure-as-code ownership commands: `railway config partials list` shows named partials and their owned resource addresses, `release` clears ownership, and `transfer FROM TO` moves it to another partial. These accept repeated `--resource ADDRESS` options and `--dry-run`, and only change ownership metadata. Update handling is built in: `railway upgrade` installs the CLI and syncs managed skills, `railway autoupdate status` and `disable` (or `RAILWAY_NO_AUTO_UPDATE=1`) control background updates, and `railway skills update` reviews or forces skill updates.

Agent support is a notable part of the tool. `railway setup agent -y` installs Railway skills and configures the remote Railway MCP server (`mcp.railway.com` via `railway mcp proxy`) for detected tools including Claude Code, Cursor, Codex, OpenCode, GitHub Copilot, Factory Droid, and Pi. Focused commands like `railway mcp install --agent cursor` and `railway skills --agent claude-code` handle single pieces, and `--local` selects a local GraphQL-backed MCP server.

The `railway code` command launches cloud agent VMs with `--codex`, `--opencode`, `--claude`, `--grok`, or `--railway`. `railway code --railway` opens a local TUI connected over WebSocket to the VM's agent daemon, and `railway ca create` supports `--code-endpoint`, `--code-port`, and `--from-checkpoint`. It targets developers deploying on Railway, and it runs on macOS, Linux, and Windows via WSL.

### Installation

```bash
# via Install script
bash <(curl -fsSL railway.com/install.sh) -y
```

```bash
# via Install script with agent setup
bash <(curl -fsSL railway.com/install.sh) --agents -y
```

## Alternatives

- [dra](https://www.trmn.sh/tools/dra.md): CLI tool to download and install release assets from GitHub repositories (Rust, 364 stars)
- [logss](https://www.trmn.sh/tools/logss.md): CLI tool that splits and visualizes log streams into multiple containers based on regex patterns with real-time filtering (Rust, 296 stars)
- [tlrc](https://www.trmn.sh/tools/tlrc.md): Official tldr-pages client written in Rust that shows community-maintained command cheat sheets in the terminal, with a local cache and a TOML config. (Rust, 1.1k stars)
- [termframe](https://www.trmn.sh/tools/termframe.md): Non-interactive terminal emulator that executes commands and exports their output as SVG screenshots. (Rust, 144 stars)
- [lazycelery](https://www.trmn.sh/tools/lazycelery.md): Terminal UI for monitoring and managing Celery workers, queues, and tasks with real-time updates and keyboard navigation. (Rust, 56 stars)

---

Canonical: https://www.trmn.sh/tools/railway-cli
