Skip to content

feat(argo): argo cd commands take the Argo CD route names #5230

Open

Description

@dan-petty

Problem or Motivation

The owner asked on 2026-11-12 that a devops command on an HTTP API take its names from the API routes (ADR 0026, #5223). devops argo cd apps calls the Argo CD REST API (argo/argo_plans.py, commands/argo.py):

devops command Route
argo cd apps list GET /api/v1/applications
argo cd apps status <name> GET /api/v1/applications/{name}
argo cd apps sync <name> POST /api/v1/applications/{name}/sync

The word apps is not the route word applications, and status is the GET of one application. One sync route has four paths: argo sync, argo cd apps sync, argo fleet sync and argo cd fleet sync. argo gitops and argo cd gitops are one group at two paths (commands/argo.py). Loki holds no usage error for these commands in the 7 days to 2026-11-12, so this item comes after the items with usage errors.

Proposed Solution & Architectural Design

  • Rename to devops argo cd applications list, get <name> and sync <name> [--prune] [--force]. The route parameter name is the argument. --prune and --force are the body fields.
  • Keep one path for each command. argo cd fleet sync and argo cd gitops stay. argo sync, argo fleet sync and argo gitops go. Premise check: record what argo sync runs and list its callers.
  • bootstrap-gitops and retire-helm-records are project verbs. They move into the renamed group with no other change.
  • Change the MCP rows argo cd apps list|status and argo fleet sync, and the job role list _CLUSTER_READS (ai/mcp/roles.py).
  • Add tests/commands/test_api_command_names.py. It derives the path of each single-route command of a covered API group from its dry-run plan route with the API rule of ADR 0026, and compares it with the real path. ADR 0026 lists the covered groups. This item adds argo cd. feat(monitoring): grafana and prometheus take the route names #5231, feat(cloudflare): cloudflare commands take the API route names #5232, feat(vault): vault commands take the Vault API route names #5234 and feat(ai): ai gateway and rag commands take the API route names #5236 each add their groups. CONTRIBUTING.md names the test in the row for API commands.
  • The pinned argocd CLI 3.6.1 is not the backend. A later item can move the group to it, and then the argocd names apply (ADR 0026).

Target Subsystem

Argo CD (devops argo cd).

Existing Tool Considered

The Argo CD REST API reference gives the names. The test reads the existing dry-run plans. Nothing else is built.

Acceptance Criteria

  • devops argo cd applications get <name> --dry-run prints GET /api/v1/applications/<name> and sends 0 requests.
  • devops argo cd apps list and devops argo sync exit 2.
  • The MCP listing holds argo_cd_applications_list and argo_cd_applications_get as read-only tools, and their descriptions start with their CLI paths.
  • tests/commands/test_api_command_names.py passes for argo cd and fails on a test command argo cd apps list with the route GET /api/v1/applications.
  • devops docs check passes.

Dependencies

Merge first: #6597 (the pass-through registry and its ADR). Open the pull request after the pull request of #5229 merges, because both change the generated command reference and CONST_MCP_EXPOSURE_TABLE.

Source: #5223

Alternatives check of 2026-11-19: in-use.
The repository already uses this tool.
Tool: argoproj/argo-cd (https://github.com/argoproj/argo-cd), Apache-2.0, last activity 2026-11-19, maintained.
Reason: Searches surfaced the argocd CLI, which already lists, gets and syncs Argo CD Applications with prune and force, but it names the resource app and offers no dry-run plan, MCP rows or route-name test.

Covers:

  • List, get and sync of Argo CD Applications
  • Sync flags for prune and force
  • Speaks the same Argo CD REST API backend

Lacks:

  • Names the resource app, not the route word applications
  • No dry-run plan that prints the route with 0 requests
  • No MCP tool rows, role list or name test
  • Not the backend of this command group

Proposed design

Problem statement

The devops argo cd group names its commands apps and status, which are not the Argo CD REST API route words. One sync route also answers at four command paths. This change renames the group to applications, uses get for the single-application GET, and keeps one path for each operation. It also updates the MCP rows, the role list, the registries, the references and the API name test.

Acceptance criteria

Requirement: Applications list uses the collection route

The devops argo cd applications list command SHALL send GET /api/v1/applications and SHALL send no request in a dry run.

Scenario: List dry run prints the collection route

  • WHEN A test runs devops argo cd applications list --dry-run with the Argo CD client mocked.
  • THEN The command exits 0, prints GET /api/v1/applications, and the mock records 0 requests.

Requirement: Applications get uses the item route

The devops argo cd applications get <name> command SHALL send GET /api/v1/applications/{name} and SHALL send no request in a dry run.

Scenario: Get dry run prints the item route

  • WHEN A test runs devops argo cd applications get demo --dry-run with the Argo CD client mocked.
  • THEN The command exits 0, prints GET /api/v1/applications/demo, and the mock records 0 requests.

Requirement: Applications sync uses the sync route and the body fields

The devops argo cd applications sync <name> command SHALL post to /api/v1/applications/{name}/sync with the body fields prune and strategy.apply.force.

Scenario: Sync dry run shows the body fields

  • WHEN A test runs devops argo cd applications sync demo --prune --force --dry-run with the Argo CD client mocked.
  • THEN The command exits 0, prints POST /api/v1/applications/demo/sync with "prune": true and "strategy": {"apply": {"force": true}}, and the mock records 0 requests.

Requirement: Removed command paths exit 2

Each removed command path devops argo cd apps list, devops argo cd apps status, devops argo cd apps sync, devops argo sync, devops argo fleet sync and devops argo gitops SHALL exit 2.

Scenario: Removed paths are unknown commands

  • WHEN A test invokes each removed command path with --help.
  • THEN Each invocation exits 2 and prints no dry-run plan.

Requirement: Fleet sync and gitops keep one path

devops argo cd fleet sync and devops argo cd gitops SHALL stay as the only paths of their operations.

Scenario: Retained paths answer help

  • WHEN A test invokes devops argo cd fleet sync --help and devops argo cd gitops --help, then devops argo fleet sync --help and devops argo gitops --help.
  • THEN The first two commands exit 0 with their help text, and the last two commands exit 2.

Requirement: Project verbs move into the applications group

devops argo cd applications bootstrap-gitops and devops argo cd applications retire-helm-records SHALL replace the former project verb paths with no other change.

Scenario: Moved project verbs keep their dry-run plans

  • WHEN A test runs devops argo cd applications bootstrap-gitops --dry-run and devops argo cd applications retire-helm-records --dry-run with the Argo CD client mocked.
  • THEN Each command exits 0, prints its dry-run plan, and the mock records 0 requests.

Requirement: MCP listing holds the renamed tools with CLI-path descriptions

The MCP tool listing SHALL hold argo_cd_applications_list and argo_cd_applications_get as read-only tools, and the description of each SHALL start with its CLI path.

Scenario: MCP listing shows the renamed read-only tools

  • WHEN A test runs uv run pytest tests/ai/mcp/test_mcp_tool_registry.py.
  • THEN The run exits 0, and each of the two tool entries is read-only and has a description that starts with devops argo cd applications .

Requirement: Cluster read role uses the renamed tools

_CLUSTER_READS SHALL hold the tool names argo_cd_applications_list and argo_cd_applications_get and SHALL hold no argo_cd_apps_list or argo_cd_apps_status.

Scenario: Cluster read role holds the renamed tools

  • WHEN A test imports _CLUSTER_READS from src/devops_cli/ai/mcp/roles.py.
  • THEN The set holds both renamed tool names and holds no old Argo CD tool name.

Requirement: Roadmap tool registry holds the renamed tools

TOOLS in src/devops_cli/roadmap/tools.py SHALL hold argo_cd_applications_list and argo_cd_applications_get and SHALL hold no removed Argo CD tool name.

Scenario: Roadmap tool registry matches the renamed tools

  • WHEN A test reads TOOLS from src/devops_cli/roadmap/tools.py.
  • THEN TOOLS holds both renamed names and holds no old Argo CD name.

Requirement: No module names a removed Argo CD tool

No module under src/devops_cli/ SHALL name argo_cd_apps_list, argo_cd_apps_status or argo_fleet_sync.

Scenario: Source tree holds no removed Argo CD tool name

  • WHEN A test searches the modules under src/devops_cli/ for the removed tool names.
  • THEN The search finds no removed Argo CD tool name.

Requirement: API command name test rejects the old apps name

tests/commands/test_api_command_names.py SHALL cover the argo cd group and SHALL derive each command path from the last non-session request of its dry-run plan.

Scenario: The name test fails on the old name

  • WHEN A test runs uv run pytest tests/commands/test_api_command_names.py.
  • THEN The run exits 0 for the real argo cd commands, and its case with the path argo cd apps list and the route GET /api/v1/applications fails and reports the expected path devops argo cd applications list.

Requirement: Exposure table holds the renamed rows

CONST_MCP_EXPOSURE_TABLE SHALL hold the rows of the retained Argo CD paths and SHALL hold no removed Argo CD path.

Scenario: Exposure table matches the renamed commands

  • WHEN A test runs uv run pytest tests/ai/mcp/test_mcp_exposure_table.py.
  • THEN The run exits 0, the table holds the rows of devops argo cd applications list, devops argo cd applications get and devops argo cd fleet sync, and no row names devops argo cd apps list, devops argo cd apps status or devops argo fleet sync.

Requirement: Generated and hand-written references match the renamed commands

docs/CLI_REFERENCE.md and each hand-written document SHALL name the retained paths and SHALL hold no removed alias.

Scenario: Documentation check finds no stale command path

  • WHEN A test runs uv run devops docs check.
  • THEN The command exits 0.

Requirement: Contributing guide names the API command test

CONTRIBUTING.md SHALL name tests/commands/test_api_command_names.py in the row for API commands.

Scenario: Documentation check passes with the new row

  • WHEN A test runs uv run devops docs check.
  • THEN The command exits 0.

Existing Tool Considered

The alternatives check of 2026-11-19 in the issue body gives the verdict in-use for argoproj/argo-cd (Apache-2.0, maintained). That block lists what the tool covers and what it lacks. This change keeps the Argo CD REST API client and its dry-run plan. It adds the route names, the MCP rows, the role list and the API name test that the argocd CLI does not have.

Key questions

  • Which Argo CD REST API routes name the application collection, the single application and its sync?: The collection is GET /api/v1/applications, the single application is GET /api/v1/applications/{name}, and the sync is POST /api/v1/applications/{name}/sync. [sources: src/devops_cli/argo/argo_plans.py, src/devops_cli/commands/argo.py]
  • Which command path replaces argo cd apps list?: devops argo cd applications list. (best practice) [sources: src/devops_cli/commands/argo.py, src/devops_cli/argo/argo_plans.py]
    • Chosen: applications. It is the route resource name, and the owner request of 2026-11-12 asks for the route name.
    • Rejected: apps. It is not the route word, so it breaks the naming rule of the owner request.
  • Which command path replaces argo cd apps status <name>?: devops argo cd applications get <name>. (best practice) [sources: src/devops_cli/commands/argo.py, src/devops_cli/argo/argo_plans.py]
    • Chosen: get. The route is GET, and get names the GET of one resource.
    • Rejected: status. It is not a route word.
    • Rejected: show. It is not a route word and it adds a second name for GET.
  • Do the old Argo CD command paths stay as aliases?: No. The project is pre-1.0 and keeps no compatibility shim, so each operation keeps one path. (best practice) [sources: CONTRIBUTING.md, src/devops_cli/commands/argo.py]
    • Chosen: Remove the aliases. It keeps one path per operation and follows the pre-1.0 zero-compatibility rule.
    • Rejected: Keep the aliases. It keeps several paths for one sync route and it adds no route name.
  • What does argo sync run, and which callers name it?: Without --fleet, argo sync calls the single-application sync. With --fleet, it calls the fleet sync. src/devops_cli/commands/argo.py defines it, and the dry-run tests and the generated reference name it. [sources: src/devops_cli/commands/argo.py, tests/commands/test_argo_dry_run.py, tests/argo/test_argo_fleet.py, docs/CLI_REFERENCE.md]
  • Which MCP tool names replace the old Argo CD rows?: argo_cd_applications_list, argo_cd_applications_get and argo_cd_fleet_sync. The same names go into _CLUSTER_READS, the TOOLS registry and the exposure table. (best practice) [sources: src/devops_cli/config/constants.py:306, src/devops_cli/ai/mcp/roles.py, src/devops_cli/roadmap/tools.py:78, src/devops_cli/ai/mcp/generator.py]
    • Chosen: Name each row after its CLI path. The names then match the renamed CLI paths and the route resource name.
    • Rejected: Keep the apps names. They keep the old non-route word and they point at removed paths.
  • How does the new API command name test derive the expected command path?: The test reads the last non-session request of the dry-run plan. It maps GET on a collection to list, GET on an item to get, and POST on a sub-resource to the sub-resource word. It compares that path with the real command path. (best practice) [sources: src/devops_cli/argo/argo_plans.py, tests/commands/test_argo_dry_run.py]
    • Chosen: Derive from the dry-run plan. It uses the existing plan route and it needs no second route table.
    • Rejected: Hard-code a route map. It duplicates the route data and it can drift from the plan.
  • Which paths stay for the fleet and gitops groups?: devops argo cd fleet sync and devops argo cd gitops stay. The paths without cd go. (best practice) [sources: src/devops_cli/commands/argo.py, src/devops_cli/argo/fleet.py, src/devops_cli/argo/gitops.py]
    • Chosen: Keep the argo cd paths. It gives one path for each operation.
    • Rejected: Keep both path forms. It keeps two names for one operation.
  • Do bootstrap-gitops and retire-helm-records change?: They move into the applications group with no other change. (best practice) [sources: src/devops_cli/commands/argo.py, src/devops_cli/argo/gitops.py, src/devops_cli/argo/helm_records.py]
    • Chosen: Move them into applications. They are project verbs of the Argo CD group and they keep their behavior.
    • Rejected: Rename their verbs. They are project verbs, not Argo CD API routes.
  • Should this item move the group to the pinned argocd CLI 3.6.1?: No. The pinned argocd CLI is not the backend of this group. A later item can move the group to it. (best practice) [sources: src/devops_cli/argo/argo_plans.py, src/devops_cli/commands/argo.py, CONTRIBUTING.md]
    • Chosen: Keep the REST API backend. It keeps this item to the rename and its tests.
    • Rejected: Move to the argocd CLI now. It changes the backend and it is a larger item.
  • Which document holds the API command naming rule and the list of covered groups that the new name test reads?: The issue body holds the rule: a command of an HTTP API group takes its names from the API routes. The issue body cites ADR 0026 for the rule and for the covered groups. The ADRs in force at the refined commit name ADR 0026 GitHub settings are OpenTofu code the owner applies, so that citation does not hold. Refine must find the record that holds the rule. This item covers only the argo cd group. [sources: docs/adr/README.md]
  • Which dependency does this item keep when fix(cli): a short flag never means another tool option #5229 and this item both change generated files?: Keep feat(cli): add the tool pass-through registry and its ADR #6597 as the code dependency. Treat fix(cli): a short flag never means another tool option #5229 as a merge-order overlap: rebase the branch and regenerate docs/CLI_REFERENCE.md and CONST_MCP_EXPOSURE_TABLE after the pull request of fix(cli): a short flag never means another tool option #5229 merges. A shared generated file is not a code dependency. (best practice) [sources: docs/CLI_REFERENCE.md, src/devops_cli/config/constants.py:306]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#6597

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/feature
    scope/argo
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 90a3d2a while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

  6. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Tools considered:

    Searches run:

    • argocd CLI app list get sync command reference, results: 5
    • argocd "argocd app sync --prune --force" documentation, results: 5
    • argo-cd CLI "argocd app" subcommands list get sync, results: 5
    • argoproj argo-cd commands applications list get sync CLI docs, results: 5
    • argo cd applications REST API /api/v1/applications sync endpoint reference, results: 5
    • "argocd" "app sync" "--prune", results: 5
    • Argo CD command line tool syncing an application from the terminal prune force, results: 5
    • devops cli argo cd commands rename, results: 5
    • argo-cd cmd list applications example gitops, results: 5
    • argoproj argo-cd github repository, results: 5

    Sources:

  7. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  8. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  9. added
    status/ready
    and removed
    status/new
    on Nov 26, 2026
  10. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/argosource/agentstatus/readytype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions