← 返回命令列表

Linux command

railway 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Login to Railway

railway login

Initialize a new project

railway init

Link to an existing Railway project

railway link

Deploy the current directory

railway up

Run a command with Railway environment variables

railway run [command]

Open a shell with Railway environment variables

railway shell

View project logs

railway logs

Open the project in the Railway dashboard

railway open

说明

railway is the command-line interface for Railway, a cloud platform for deploying and hosting applications. It enables developers to deploy code, manage environment variables, and interact with Railway projects directly from the terminal. The CLI supports zero-configuration deployments by automatically detecting project types and configuring build settings. It integrates with git workflows and can deploy from local directories or connected repositories. A key feature is the ability to run local development with production environment variables using railway run, ensuring consistency between development and deployed environments.

参数

login
Authenticate with Railway
logout
Log out of Railway
init
Create a new Railway project
link
Link current directory to an existing Railway project
up
Deploy the current directory to Railway
run _command_
Run a local command with Railway environment variables injected
shell
Open a new shell with Railway environment variables
logs
View deployment logs
open
Open the project in the Railway web dashboard
status
Show the status of the linked project
variables
Manage environment variables
service
Manage services within a project
volume
Manage persistent volumes
domain
Manage custom domains
ssh
Open an SSH session to a deployed service
--help, -h
Display help information
--version, -v
Display version number

FAQ

What is the railway command used for?

railway is the command-line interface for Railway, a cloud platform for deploying and hosting applications. It enables developers to deploy code, manage environment variables, and interact with Railway projects directly from the terminal. The CLI supports zero-configuration deployments by automatically detecting project types and configuring build settings. It integrates with git workflows and can deploy from local directories or connected repositories. A key feature is the ability to run local development with production environment variables using railway run, ensuring consistency between development and deployed environments.

How do I run a basic railway example?

Run `railway login` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does login do in railway?

Authenticate with Railway