{
  "slug": "railway-service-delete-removes-a-service-from-an-environment-48532e244b42",
  "title": "railway service delete removes a service from an environment",
  "tools": [
    "railway"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-04-23T12:52:24.000Z",
  "announced_at": "2026-04-23T12:52:24.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When removing a service from an environment, run `railway service delete`; pass `--service` and `--environment` to target them explicitly, and use `--yes` to skip confirmation. In non-interactive mode, add `--2fa-code <code>` if 2FA is enabled; add `--json` for JSON output.",
    "examples": [
      "railway service delete --service <service-name-or-id> --environment <environment> --yes --json",
      "railway service delete --service <service-name-or-id> --environment <environment> --yes --2fa-code <two-factor-code>"
    ],
    "gotchas": [
      "Version: v4.42.0",
      "--service <SERVICE>: Service name or ID to delete; defaults to the linked service.",
      "--environment <ENVIRONMENT>: Environment to delete the service from; defaults to the linked environment.",
      "--yes: Skip the confirmation dialog; non-interactive deletion requires this to skip prompting.",
      "--json: Output in JSON format.",
      "--2fa-code <TWO_FACTOR_CODE>: 2FA code for verification; required if 2FA is enabled in non-interactive mode.",
      "`--service` defaults to the linked service.",
      "`--environment` defaults to the linked environment.",
      "`--2fa-code` is required for verification if 2FA is enabled in non-interactive mode."
    ]
  },
  "why_it_matters": "Remove a service from an environment using the Railway CLI.",
  "sources": [
    "https://github.com/railwayapp/cli/releases/tag/v4.42.0",
    "https://github.com/railwayapp/cli/pull/860",
    "https://github.com/railwayapp/cli/blob/v4.42.0/src/commands/service.rs"
  ],
  "rank": 0.97034,
  "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-42e5a3608cfa26fd-0:gate",
    "evidence_hash": "785879e676603bab9a32db2c362cb37d86f5a889152e2a14ce934b5026a3cc97"
  },
  "review": {
    "draft_hash": "67aaee41c62db9ac3e0730286e904fbcd5ed8dbdd64743cd71c21d46f5d4a80a",
    "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.97 >= 0.9; 2 needed) and Jev gave 0.81 (>= 0.6 needed)."
  }
}
