Skip to content

feat(cli): add doctor integrations for first-class host status - #1314

Open
knqiufan wants to merge 3 commits into
oceanbase:masterfrom
knqiufan:feat/cli-doctor-integrations
Open

feat(cli): add doctor integrations for first-class host status#1314
knqiufan wants to merge 3 commits into
oceanbase:masterfrom
knqiufan:feat/cli-doctor-integrations

Conversation

@knqiufan

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Closes #1313

Depends on #1311. Related to #1301; that issue stays with setup select.

Rationale for this change

setup select can install more than one first-class host, but diagnosis is still one fail-closed doctor <host> command per integration. Concatenating those commands exits 1 on the first missing CLI, so a machine that only has Codex looks unhealthy.

This PR adds a read-only overview that reports every first-class host, treats a missing CLI as missing instead of a command failure, and still fails when a present host is broken.

What changes are included in this PR?

  • Add powercontext doctor integrations / --json over the shared feat(cli): add setup select for explicit multi-host plugin install #1311 catalog: codex, claude-code, dsh, pi, hermes.
  • Reuse the existing diagnose functions through a lazy dispatcher. Do not flatten them into _diagnostics_ok. Do not scan PATH to build the menu. Do not install, start the Server, or launch a host.
  • Classify each host from its CLI check plus its integration check (plugin, or package for Pi). Missing CLI + skipped integration → missing and does not fail the command. A present host with a failed CLI call or failed integration → exit 1.
  • Empty doctor still checks only package + Server. doctor <host> remains fail-closed when that CLI is missing. setup select is unchanged.
  • Docs: English and Chinese install, troubleshoot, and interfaces pages.
  • Tests: tests/test_doctor_integrations.py covers the five-host JSON matrix, missing-CLI success, present plugin failure, present list-call failure, all-missing success, empty doctor not scanning hosts, and doctor codex still exiting 1 when Codex is missing.

This branch is stacked on #1311 (feat/cli-setup-select). Until that PR merges, the diff against master also includes setup select. The doctor-only change is commit b87faa8.

Are there any user-facing changes?

Yes. New optional command:

powercontext doctor integrations
powercontext doctor integrations --json

No breaking API or storage-format change. Empty doctor and doctor <host> keep their current behavior.

How was this change tested?

  • python -m pytest tests/test_doctor_integrations.py
  • python -m pytest tests/test_setup_select.py tests/test_system_cli.py tests/test_dsh_cli.py tests/test_hermes_cli.py tests/test_pi_cli.py
  • ruff check on the changed Python files
  • ty check on the changed Python files

AI usage statement

Used for implementation and review against the issue contract. The command surface, exit-code rules, and acceptance criteria follow #1313.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add read-only doctor integrations overview

1 participant