railway config commands manage project infrastructure as code
Introduced 2026-06-05 · score 0.97
HOW TO USE IT
When managing Railway infrastructure from a repository, create `.railway/railway.ts` or import the linked project, then preview and apply its changes. Migrate services managed by `railway.json` or `railway.toml` before planning configuration changes.
railway config initrailway config pullrailway config plan && railway config apply --yesWHY THIS HELPS
When managing Railway infrastructure from a repository, create or import `.railway/railway.ts`, preview its changes, and apply them.
BEFORE THIS CHANGE
The `railway config` commands were not available.
REQUIREMENTS AND LIMITATIONS
- Version: v5.2.0
- --yes: Apply without prompting for confirmation.
- Prerequisite: Install the Railway CLI; authenticate and link the current directory to the Railway project and environment. If unlinked, `pull` and `plan` prompt for a project and environment.
- Prerequisite: Install the TypeScript SDK from the repository root with `npm install railway`.
- `railway config plan` is safe and does not change Railway.
- `railway config apply` asks before applying unless `--yes` is passed.
- `railway up` deploys this directory when the service has no GitHub or image source.
- Services already managed by `railway.json` or `railway.toml` must be migrated before `.railway/railway.ts` can manage them.
- Advanced placement can still specify region names.
- Secrets imported from Railway may be omitted or represented with `preserve()` so they are not overwritten.
- Docs conflict: Current CLI documentation says `railway up` behavior is unchanged, while the supplied release note says it previews pending configuration changes and asks before applying them. https://github.com/railwayapp/cli/blob/master/assets/iac/README.md
- Docs conflict: The current TypeScript SDK documentation requires Railway CLI 5.42.1 or newer, which differs from the card's stated v5.2.0. https://github.com/railwayapp/railway-ts-sdk
FIRST-PARTY EVIDENCE
- https://github.com/railwayapp/cli/releases/tag/v5.2.0
- https://github.com/railwayapp/cli/pull/921
- https://github.com/railwayapp/cli/blob/master/assets/iac/README.md
- https://github.com/railwayapp/docs/blob/main/content/docs/infrastructure-as-code.md
Check the installed version and the source before using it. Entry JSON