Skip to content

feat(cli): rename map setup to setup agents; write OpenCode config too - #3619

Merged
bpamiri merged 1 commit into
developfrom
feat/setup-agents
Sep 15, 2026
Merged

bpamiri merged 1 commit into
developfrom
feat/setup-agents

Conversation

@bpamiri

@bpamiri bpamiri commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Two corrections to the command added in #3618.

The name has to avoid the literal token mcp

#3618 shipped wheels map setup because LuCLI owns the mcp verb. That was right but incomplete: the runtime intercepts the bare token mcp in ANY argument position, not just argv[1]. Verified live:

command result
wheels setup mcp mcp: missing module name. Usage: wheels mcp <module>
wheels info mcp same — positional, not argv[1]-only
wheels setup ai Usage: ai [-hV] [COMMAND]ai is reserved too
wheels setup bogus my handler: Unknown setup target: bogus

So no argument may be spelled mcp, which rules out setup mcp entirely. The target is now agents — reads as "set this app up for AI agents" and avoids the token.

wheels map setup keeps working as a thin forwarder (that spelling is in snapshot 2499). Both entry points stay in mcpHiddenTools() — an assistant provisioning its own config is a side-effecting setup step, not a query — so tools/list stays at 19.

It now writes both client configs

The wrapper's own wheels mcp help has always promised setup generates .mcp.json (Claude Code) and .opencode.json (OpenCode); #3618 only did the first. Both are written now, each in its client's own shape — Claude Code takes mcpServers with separate command/args, OpenCode takes an mcp key, type: "local", and command+args as one array.

wheels setup agents
  Created .mcp.json
  Created .opencode.json

Safety properties, each tested:

  • validate-before-write — a malformed .opencode.json cannot leave a half-applied setup with .mcp.json already rewritten
  • merge, never clobber — other servers preserved in both files (postgres, sqlite, a custom theme key all survived)
  • no spurious rewrites$mcpEntryMatches() compares only the fields setup owns, so a hand-added environment on the wheels entry doesn't trigger a rewrite every run
  • fails closed — malformed JSON or a non-object is reported and left untouched

CLI suite: 1385 pass, 0 error, 0 real failures. Complexity gate: PASS. Consumer-docs check: OK.

…g too

Two corrections to the command added in #3618.

## The name has to avoid the literal token `mcp`

#3618 shipped `wheels map setup`, chosen because LuCLI owns the `mcp` verb at
the runtime level. That was right but incomplete: the runtime intercepts the
bare token `mcp` in ANY argument position, not just argv[1]. Verified live:

  wheels setup mcp   -> mcp: missing module name. Usage: wheels mcp <module>
  wheels info mcp    -> same
  wheels setup ai    -> Usage: ai [-hV] [COMMAND]   (`ai` is reserved too)
  wheels setup bogus -> my handler ("Unknown setup target: bogus")

So no argument may be spelled `mcp`, which rules out `setup mcp` entirely.
The target is now `agents`: reads as "set this app up for AI agents", and
avoids the token.

`wheels map setup` keeps working as a thin forwarder — that spelling is in
snapshot 2499 — and both entry points stay in mcpHiddenTools() (an assistant
provisioning its own config is a side-effecting setup step, not a query, so
tools/list stays at 19).

## It now writes both client configs

The wrapper's own `wheels mcp` help has always promised that setup generates
`.mcp.json` (Claude Code) AND `.opencode.json` (OpenCode), and #3618 only did
the first. Both are written now, in each client's own shape — Claude Code
takes `mcpServers` with separate `command`/`args`; OpenCode takes an `mcp`
key, `type: "local"`, and command+args as ONE array.

Every file is validated BEFORE any is written, so a malformed
`.opencode.json` cannot leave a half-applied setup with `.mcp.json` already
rewritten. `$mcpEntryMatches()` compares only the fields setup owns, so a
hand-added `environment` (or any other client key) on the wheels entry does
not make setup consider it wrong and rewrite on every run.

CLI suite: 1385 pass, 0 error, 0 real failures. Complexity gate: PASS.
Consumer-docs check: OK.

Signed-off-by: Peter Amiri <peter@alurium.com>
@github-actions github-actions Bot added the docs label Sep 15, 2026
bpamiri added a commit to wheels-dev/homebrew-wheels that referenced this pull request Sep 15, 2026
…up` (#587)

Follow-up to #585, which renamed the Other: entry to `map`. Two problems.

1. `wheels map setup` is now `wheels setup agents` (wheels-dev/wheels#3619).
   The reason is worth recording: LuCLI intercepts the literal token `mcp`
   in ANY argument position, not just argv[1], so `wheels setup mcp` cannot
   work no matter how it is spelled — and neither can `wheels info mcp`.
   The target is `agents` to avoid the token entirely.

2. The `mcp` help block claimed a `setup` action:

     Usage: wheels mcp [setup|wheels]
       setup    Generate .mcp.json (Claude Code) and .opencode.json in cwd

   That was never routable: `wheels mcp setup` is resolved as "run module
   setup" and answers "mcp: module not found: 'setup'". It is the specific
   text that sent a user to a dead command. The block now documents what
   `mcp` actually does and points at `wheels setup agents`.

Help text only; the auto-update workflows sed just the version/sha lines,
so this survives future bumps. Both formulas, `ruby -c` clean.

Signed-off-by: Peter Amiri <peter@alurium.com>
@bpamiri
bpamiri merged commit 04c100e into develop Sep 15, 2026
21 checks passed
@bpamiri
bpamiri deleted the feat/setup-agents branch September 15, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant