sincecutoff.com
← all changes

railway service commands accept --project

Introduced 2026-05-11 · score 0.96

HOW TO USE IT

When a service-scoped command targets a project without a linked working directory, include `--project <PROJECT_ID>` and `--environment <ENVIRONMENT>`; without `--project`, Railway uses linked project, environment, and service fallbacks. For `domain`, use `--project` without `-p`, which selects the port.

railway logs --project <PROJECT_ID> --environment <ENVIRONMENT>
railway variable set <KEY>=<VALUE> --project <PROJECT_ID> --environment <ENVIRONMENT>
railway domain --project <PROJECT_ID> --environment <ENVIRONMENT>

WHY THIS HELPS

Run a service-scoped Railway CLI command against a project without linking the working directory first.

BEFORE THIS CHANGE

Use the linked project, environment, and service context; commands requiring project targeting could also be run after linking the working directory.

REQUIREMENTS AND LIMITATIONS

  • Version: v4.57.4
  • --project <PROJECT_ID>: Project to use; defaults to the linked project when omitted. Pair with `--environment` when specifying a project.
  • --environment <ENVIRONMENT> (required): Environment to use with `--project`; the CLI docs say this flag is required when targeting a specific project.
  • -s, --service <SERVICE>: Service to target; defaults to the linked service. Service name or ID is accepted.
  • -p, --port <PORT>: Port to connect to a domain when creating one; `domain` uses `--project` without a short flag.
  • <KEY>=<VALUE> (required): Variable assignment for `railway variable set`; repeat assignments to set multiple variables.
  • Commands that accept `--project` require `--environment` to avoid ambiguous cross-project environment resolution.
  • `domain` uses `--project` without a short flag because `-p` is already used for `--port`.
  • Single-service fallback behavior is preserved for commands that can infer the target service.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card