Documentation

CLI

Use the CLI to connect your code to your projects infrastructure without needing to worry about environment variables or configuration.

Installation

Install the Railway CLI as a Homebrew tap

or from NPM

Commands

The following commands are available

Init

Connect to an existing project or create a new one

Running init with no project ID will bring a menu that allows you to create a new project, or select an existing project.

Run

Run a command inside of the Railway environment.

This injects all environment variables associated with the plugins you have install in your project.

Environment

Change which environment you are using. View environment docs for more information.

Status

View the status of your Railway project and user.

Env

View all the environment variables associated with your project and environment.

Open

Open your current Railway project in the browser.

Login

Login to your Railway account.

This will open the browser to https://railway.app/cli-login.

Logout

Logout of your Railway account.

Whoami

View what user is currently authenticated with Railway