Skip to content

feat(cli): add setup select for explicit multi-host plugin install - #1311

Closed
knqiufan wants to merge 2 commits into
oceanbase:masterfrom
knqiufan:feat/cli-setup-select
Closed

feat(cli): add setup select for explicit multi-host plugin install#1311
knqiufan wants to merge 2 commits into
oceanbase:masterfrom
knqiufan:feat/cli-setup-select

Conversation

@knqiufan

@knqiufan knqiufan commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Note

The implementation described below was merged through #1314 because that PR was stacked on this branch. After
rebasing onto the latest master, this PR has no remaining file diff and does not require a separate merge.

Which issue or RFC does this PR close?

Closes #1301.

Rationale for this change

Installing PowerContext for several coding agents currently requires one fail-closed setup <host> command per
integration. Chaining those commands aborts on the first unavailable CLI, while PATH-driven auto-install would treat
CLI presence as user intent and could unexpectedly modify every detected host.

This PR adds an opt-in orchestration command that installs only the integrations selected by the user, preserves the
existing single-host commands, and isolates failures so one host does not prevent the remaining selections from being
processed.

What changes are included in this PR?

  • Add powercontext setup select for the supported host catalog: codex, claude-code, dsh, openclaw,
    opencode, pi, and hermes.
  • Reuse the existing installers without scanning PATH to build or filter the catalog.
  • Support repeatable --host options for scripts and CI. Interactive TTY sessions without --host display the
    catalog and accept numbers or names; --json and non-TTY usage require --host.
  • Preserve host-specific defaults. Claude Code and OpenClaw use http://127.0.0.1:8000, and OpenClaw uses
    --scope-mode agent. Explicit --server-url and --scope-mode values are forwarded to the applicable hosts.
  • Run existing post-install diagnostics for Codex, DSH, OpenCode, Pi, and Hermes before reporting success.
  • Report selected installer or verification failures per host and continue processing the other selections.
  • Report unselected hosts as skipped and print the Hermes memory setup guidance after a successful Hermes install.
  • Keep empty powercontext setup help-only and keep every setup <host> command fail-closed.
  • Update the English and Chinese installation, troubleshooting, and CLI reference documentation.
  • Add focused coverage for selection, failure isolation, TTY and non-TTY behavior, JSON output, option forwarding,
    host-specific defaults, post-install verification, and unchanged single-host behavior.

Are there any user-facing changes?

Yes. The following optional command is new:

powercontext setup select --host codex --host dsh
powercontext setup select --host openclaw --scope-mode agent
powercontext setup select --host codex --json

There is no breaking API or storage-format change. Existing per-host setup commands retain their current behavior,
and setup does not start the PowerContext Server or launch a host process.

How was this change tested?

  • uv lock --check
  • uv run ruff check src/powercontext/cli/hosts.py src/powercontext/cli/system.py tests/test_setup_select.py
  • uv run ruff format --check src/powercontext/cli/hosts.py src/powercontext/cli/system.py tests/test_setup_select.py
  • uv run pytest tests/test_setup_select.py tests/test_system_cli.py tests/test_dsh_cli.py tests/test_hermes_cli.py tests/test_openclaw_cli.py tests/test_pi_cli.py
  • uv run ty check
  • uv run zensical build -s in a clean worktree

AI usage statement

AI assistance was used for implementation and review against the issue contract. The command surface, failure
isolation rules, and acceptance criteria follow #1301.

Comment thread src/powercontext/cli/hosts.py
Comment thread src/powercontext/cli/hosts.py
Comment thread src/powercontext/cli/hosts.py

@Teingi Teingi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@knqiufan
knqiufan force-pushed the feat/cli-setup-select branch from a628f28 to 7568def Compare August 27, 2026 04:39
@Teingi Teingi closed this Aug 27, 2026
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 opt-in setup for all detected local agent CLIs

2 participants