From f54b23eddf8fbeeca6e2dd4fb7946d05181cd761 Mon Sep 17 00:00:00 2001 From: Mykal Machon Date: Thu, 6 Aug 2026 13:23:12 -0700 Subject: [PATCH] Document monorepo configuration via CLI --- content/docs/cli/environment.md | 9 +++++++-- content/docs/deployments/monorepo.md | 19 +++++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/content/docs/cli/environment.md b/content/docs/cli/environment.md index 487cb9ebd..62a7b3c13 100644 --- a/content/docs/cli/environment.md +++ b/content/docs/cli/environment.md @@ -109,12 +109,17 @@ The `--service-config` flag uses dot-path notation to specify nested configurati # Set a variable value railway environment edit --service-config backend variables.API_KEY.value "secret" -# Set a service configuration -railway environment edit --service-config api buildCommand "npm run build" +# Set a build command +railway environment edit --service-config api build.buildCommand "npm run build" + +# Set a monorepo root directory +railway environment edit --service-config api source.rootDirectory /packages/api ``` The format is: `--service-config ` +For more information about configuring monorepo services, see [Deploying a monorepo](/deployments/monorepo). + ## Options for `config` | Flag | Description | diff --git a/content/docs/deployments/monorepo.md b/content/docs/deployments/monorepo.md index fd26befcb..c67d1445f 100644 --- a/content/docs/deployments/monorepo.md +++ b/content/docs/deployments/monorepo.md @@ -31,6 +31,12 @@ To deploy this type of monorepo on Railway, define a root directory for the serv 2. Click on the Settings tab. 3. Set the root directory option. Setting this means that Railway will only pull down files from that directory when creating new deployments. +Alternatively, set the root directory from the CLI: + +```bash +railway environment edit --service-config backend source.rootDirectory /backend +``` +