2025-03-14 21:59:59 -06:00
|
|
|
# railway
|
|
|
|
|
|
|
|
|
|
> Connect code to a Railway project.
|
2025-12-16 10:20:31 -07:00
|
|
|
> More information: <https://docs.railway.com/reference/cli-api>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Login to a Railway account:
|
|
|
|
|
|
|
|
|
|
`railway login`
|
|
|
|
|
|
|
|
|
|
- Link to an existing Project under a Railway account or team:
|
|
|
|
|
|
|
|
|
|
`railway link {{projectId}}`
|
|
|
|
|
|
|
|
|
|
- Create a new project:
|
|
|
|
|
|
|
|
|
|
`railway init`
|
|
|
|
|
|
|
|
|
|
- Run a local command using variables from the active environment:
|
|
|
|
|
|
|
|
|
|
`railway run {{cmd}}`
|
|
|
|
|
|
|
|
|
|
- Deploy the linked project directory (if running from a subdirectory, the project root is still deployed):
|
|
|
|
|
|
|
|
|
|
`railway up`
|
|
|
|
|
|
|
|
|
|
- Open an interactive shell to a database:
|
|
|
|
|
|
|
|
|
|
`railway connect`
|