Railway CLI
Find a file
Mahmoud Abdelwahab 8da480744a
fix(ci): use npm trusted publishing via OIDC on Node 24 (#842)
The Publish NPM job has been failing since v4.37.0. Root cause: npm 10
(bundled with Node 22) can sign provenance via OIDC but cannot
authenticate the registry upload itself via trusted publishing — that
requires npm >= 11.5.1. With no NODE_AUTH_TOKEN secret configured, the
publish fell through to an anonymous PUT, which the registry rejected
as a 404 (the standard response for scoped packages when auth is
missing).

Bump the runner to Node 24, which bundles npm 11.x. Drop --provenance
since trusted publishing attaches it automatically.

Also bump actions/setup-node to v6 — v4 runs on Node 20 internally,
which GitHub is deprecating.

This supersedes #838, which removed the npm self-upgrade step after
npm@latest started cross-major upgrading and corrupting itself
mid-install. Using Node 24's bundled npm avoids both the corruption
and the self-upgrade entirely.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 16:33:39 +09:00
.cargo Add attribute logging (#455) 2024-05-05 11:32:47 +01:00
.github fix(ci): use npm trusted publishing via OIDC on Node 24 (#842) 2026-04-13 16:33:39 +09:00
bin release tarfiles for windows (#325) 2023-03-05 17:28:27 +00:00
npm-install fix npm install on windows (#341) 2023-03-08 14:00:56 -05:00
src feat: add auto-update mechanism for CLI (#825) 2026-04-06 10:21:50 +09:00
.dockerignore feat: alpine dockerfile (#470) 2023-12-05 16:52:45 -05:00
.gitattributes Add --latest flag to logs cmd and activeDeployments to status (#719) 2026-01-07 01:32:42 -05:00
.gitignore Add dev command for local development with Docker Compose (#710) 2025-12-12 18:18:58 -05:00
build.rs feat: add auto-update mechanism for CLI (#825) 2026-04-06 10:21:50 +09:00
Cargo.lock chore: Release railwayapp version 4.37.2 2026-04-10 17:45:59 +00:00
Cargo.toml chore: Release railwayapp version 4.37.2 2026-04-10 17:45:59 +00:00
CLAUDE.md Add CLAUDE.md with development guidance (#661) 2025-09-09 20:20:10 -04:00
CONTRIBUTING.md Point to railway.com (#585) 2025-01-08 14:33:37 -05:00
Dockerfile fix exec permission not set in railway-cli docker image (#531) 2024-08-14 13:46:58 -04:00
flake.lock Migrate to CLI v3 (#304) 2023-03-03 21:44:32 -05:00
flake.nix Fix CLI compilation (#514) 2024-06-24 16:41:23 -03:00
install.sh Show telemetry notice on install instead of first run (#832) 2026-04-03 18:45:07 +09:00
LICENSE Migrate to CLI v3 (#304) 2023-03-03 21:44:32 -05:00
package.json chore: Release railwayapp version 4.37.2 2026-04-10 17:45:59 +00:00
pnpm-lock.yaml fix npm install 2023-03-04 09:25:40 -05:00
README.md update readme (#767) 2026-01-16 10:21:39 -05:00
release.toml fix release.toml (again) 2023-04-13 11:28:17 -04:00
shell.nix fix: update nix shell pins to provide Rust 1.94 for edition2024 support (#812) 2026-03-13 15:07:44 -04:00
v2.sh add v2 install script 2023-03-04 17:16:15 -05:00

Railway CLI

Crates.io CI cargo audit

Overview

This is the command line interface for Railway. Use it to connect your code to Railway's infrastructure without needing to worry about environment variables or configuration.

The Railway command line interface (CLI) connects your code to your Railway project from the command line.

The Railway CLI allows you to:

  • Create new Railway projects from the terminal
  • Link to an existing Railway project
  • Pull down environment variables for your project locally to run
  • Create services and databases right from the comfort of your fingertips

And more.

Documentation

View the CLI guide

View the CLI API reference

Quick start

Follow the CLI guide to install the CLI and run your first command.

Authentication

For non-interactive authentication details, see the CLI guide.

Installation

Package managers

Cargo

cargo install railwayapp --locked

Homebrew

brew install railway

NPM

npm install -g @railway/cli

Bash

# Install
bash <(curl -fsSL cli.new)

# Uninstall
bash <(curl -fsSL cli.new) -r

Scoop

scoop install railway

Arch Linux AUR

Install with Paru

paru -S railwayapp-cli

Install with Yay

yay -S railwayapp-cli

Docker

Install from the command line

docker pull ghcr.io/railwayapp/cli:latest

Use in GitHub Actions

For GitHub Actions setup, see the blog post at blog.railway.com/p/github-actions.

Use in GitLab CI/CD

For GitLab CI/CD setup, see the blog post at blog.railway.com/p/gitlab-ci-cd.

Contributing

See CONTRIBUTING.md for information on setting up this repository locally.

Feedback

We would love to hear your feedback or suggestions. The best way to reach us is on Central Station.

We also welcome pull requests into this repository. See CONTRIBUTING.md for information on setting up this repository locally.