{
  "slug": "railway-service-commands-accept-project-bffe6a9fca98",
  "title": "railway service commands accept --project",
  "tools": [
    "railway"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-05-11T21:50:21.000Z",
  "announced_at": "2026-05-11T21:50:21.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "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.",
    "examples": [
      "railway logs --project <PROJECT_ID> --environment <ENVIRONMENT>",
      "railway variable set <KEY>=<VALUE> --project <PROJECT_ID> --environment <ENVIRONMENT>",
      "railway domain --project <PROJECT_ID> --environment <ENVIRONMENT>"
    ],
    "gotchas": [
      "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."
    ]
  },
  "why_it_matters": "Run a service-scoped Railway CLI command against a project without linking the working directory first.",
  "before": "Use the linked project, environment, and service context; commands requiring project targeting could also be run after linking the working directory.",
  "sources": [
    "https://github.com/railwayapp/cli/releases/tag/v4.57.4",
    "https://github.com/railwayapp/cli/pull/893",
    "https://docs.railway.com/cli/logs",
    "https://docs.railway.com/cli/variable",
    "https://docs.railway.com/cli/domain",
    "https://docs.railway.com/cli/deploying",
    "https://docs.railway.com/cli/global-options"
  ],
  "rank": 0.96052,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave1b-20261016",
    "verdict_id": "wave1b-20261016:wave1b-20261016-c6cbadde87182b64-0:gate",
    "evidence_hash": "e4024caf794c0406b9d0c86e3a73e114c00c7101b319c24cf5d330e51f228078"
  },
  "review": {
    "draft_hash": "0dc52c675be6c04eecc30ce4216dd9048b1414fcf7de88bb765ccad019301e8d",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1b-20261016:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.96 >= 0.9; 2 needed) and Jev gave 0.79 (>= 0.6 needed)."
  }
}
