# Railway CLI
The Railway CLI lets you interact with your Railway projects from the command line. Read the [CLI documentation](https://docs.railway.com/cli).
## Installation
Install the CLI with the Bash script on macOS, Linux, or Windows through WSL:
```bash
bash <(curl -fsSL cli.new)
```
Install the CLI and configure Railway agent support:
```bash
bash <(curl -fsSL cli.new) --agents -y
```
Uninstall the CLI:
```bash
bash <(curl -fsSL cli.new) -r
```
Other installation methods are available in the CLI documentation: [Homebrew](https://docs.railway.com/cli#homebrew-macos), [npm](https://docs.railway.com/cli#npm-macos-linux-windows), [Scoop](https://docs.railway.com/cli#scoop-windows), [pre-built binaries](https://docs.railway.com/cli#pre-built-binaries), and [source builds](https://docs.railway.com/cli#from-source).
## Authentication
Before using the CLI, authenticate with your Railway account:
```bash
railway login
```
For environments without a browser, such as SSH sessions, use browserless login:
```bash
railway login --browserless
```
### Tokens
For CI/CD pipelines, set environment variables instead of using interactive login:
- Project token: Set `RAILWAY_TOKEN` for project-level actions.
- Account or workspace token: Set `RAILWAY_API_TOKEN` for account-level or workspace-level actions.
```bash
RAILWAY_TOKEN=xxx railway up
```
See [Tokens](https://docs.railway.com/integrations/api#creating-a-token) for more information.
## Agent Setup
Configure Railway agent support for AI coding tools:
```bash
railway setup agent -y
```
This installs Railway skills and configures the Railway MCP server for detected tools such as Claude Code, Cursor, Codex, OpenCode, GitHub Copilot, and Factory Droid.
Use the focused commands when you only need one part of the setup:
```bash
railway mcp install --agent cursor
railway skills --agent claude-code
```
## Contributing
See [CONTRIBUTING.md](https://github.com/railwayapp/cli/blob/master/CONTRIBUTING.md) for information on setting up this repository locally.
## Feedback
Share feedback and suggestions on [Central Station](https://station.railway.com/feedback).