Railway
Overview¶
The Railway integration inspects the latest successful deployment of any configured Railway service.
Prerequisites¶
- Railway CLI installed (
@railway/cli) - Either an authenticated Railway CLI session (
railway login) or a Railway token - Optional defaults: project, service, and environment to inspect
Setup¶
Option 1: Interactive CLI¶
The setup flow accepts an optional token and default project, service, and environment. The token is used when present; an authenticated Railway CLI can be used without one. Tool calls can override any configured default scope.
Option 2: Environment variables¶
RAILWAY_TOKEN=
RAILWAY_PROJECT=project-id-or-name
RAILWAY_SERVICE=service-id-or-name
RAILWAY_ENVIRONMENT=production
RAILWAY_PATH=railway
| Variable | Default | Description |
|---|---|---|
RAILWAY_TOKEN |
— | Railway API/token auth when not using an interactive CLI login |
RAILWAY_PROJECT |
— | Default project id or name |
RAILWAY_SERVICE |
— | Default service id or name |
RAILWAY_ENVIRONMENT |
— | Default environment (for example production) |
RAILWAY_PATH |
railway |
Path or name of the Railway CLI binary |
Credentials¶
- Install the Railway CLI and run
railway login, or create a Railway token in the Railway dashboard. - Optionally set default project / service / environment so inspect calls need fewer parameters.
- Store the token in
.envasRAILWAY_TOKENor enter it duringopensre integrations setup railway.
Verify requires a token or a complete default project + service + environment scope.
Tools¶
| Tool | What it does |
|---|---|
inspect_railway_deployment |
Shows the latest successful deployment and available source commit metadata for a Railway service |
Inspect a deployment¶
When a default scope is configured, no parameters are required. Otherwise provide the service scope:
The result includes deployment ID, status, and source commit hash/message when Railway provides them. Commands always use explicit project, service, and environment flags and never write Railway link state into the workspace.
Verify¶
Troubleshooting¶
| Symptom | Fix |
|---|---|
| deployment_unavailable | Railway returned no successful deployment in the inspected history — confirm project/service/environment and that a successful deploy exists |
| Missing configuration / CLI / auth | Install @railway/cli, run railway login or set RAILWAY_TOKEN, and set defaults or pass scope on each call |
| Verify fails without token | Provide RAILWAY_TOKEN, or set complete RAILWAY_PROJECT + RAILWAY_SERVICE + RAILWAY_ENVIRONMENT with an authenticated CLI |
Security¶
- Railway tokens are never returned in tool output; Railway commands are non-interactive and errors are redacted.
- Prefer a dedicated token scoped to the projects OpenSRE should touch.
- Store tokens in
.envor your secret manager — not in source control.
Markdown source: View on AtomGit·Content from the open-source project op/opensre