Skip to content

feat(installer): add Claude Desktop and OpenCode, auto-configure by default - #40

Merged
antonisobkowicz-asana merged 4 commits into
mainfrom
installer-claude-desktop
Sep 8, 2026
Merged

feat(installer): add Claude Desktop and OpenCode, auto-configure by default#40
antonisobkowicz-asana merged 4 commits into
mainfrom
installer-claude-desktop

Conversation

@antonisobkowicz-asana

Copy link
Copy Markdown
Collaborator

Summary

  • Claude Desktop: detected via its app bundle (not a CLI command, unlike every other client here), configured by writing ~/Library/Application Support/Claude/claude_desktop_config.json in the same mcpServers shape Claude Code/Cursor use (minus the type field, which Claude Desktop infers from the presence of command).
  • OpenCode: detected via the opencode command, configured by writing ~/.config/opencode/opencode.json under a distinct mcp key with its own entry shape (type: "local", and command as a single array combining the executable and its arguments, rather than separate command/args fields).
  • ChatGPT Desktop: investigated and intentionally not given its own flag — it shares Codex CLI's ~/.codex/config.toml on the same host, so --codex already covers it when the codex command is installed. Documented this relationship rather than adding a redundant path. (A narrower gap exists for users with ChatGPT Desktop but no codex CLI binary; left out of scope for this PR since it would need a hand-rolled TOML writer for a comparatively rare case.)
  • Extracted the JSON read-merge-write logic now shared by Cursor, Claude Desktop, and OpenCode into one write_mcp_json_config shell function parameterized by config path, top-level servers key, and entry shape — added here since a third near-identical 40-line block crossed the threshold where duplicating it again stopped being the simpler option. Cursor's own output is byte-for-byte unchanged.
  • Extended the legacy-package-reference scan (the logic that offers to delete old manually-installed .tgz files after a config gets rewritten) to also read both new config files.

Behavior change: auto-select by default

While implementing this, hit a real question: should --all (and the true no-flags default) die if one of five possible clients isn't installed? That would make the common case — most people have one or two of these, not all five — fail by default. So:

  • No flags, or --all: auto-detect and configure every client found; silently skip ones that aren't. No interactive Y/n prompting either — retired the prompt_target confirmation step entirely, since the piped curl | sh install path already always ran in exactly this way when non-interactive (no TTY), it just also happened to prompt when run interactively in a terminal. Now both cases behave the same: install what's there.
  • An explicit single-client flag (--claude, --claude-desktop, --codex, --cursor, --opencode): unchanged from today — requires exactly that client and fails loudly if it's missing.

Test plan

  • sh -n install.sh
  • npm run typecheck
  • npm run lint
  • npm test (373 tests passing — new coverage for Claude Desktop and OpenCode configuration, the auto-select-skips-undetected-clients default, explicit-flag-dies-when-missing for both new clients, and legacy-package cleanup scanning both new config files)
  • npm run build

- Detects Claude Desktop via its app bundle (not a CLI command) and
  writes ~/Library/Application Support/Claude/claude_desktop_config.json.
- Detects and configures OpenCode via ~/.config/opencode/opencode.json,
  which uses a distinct entry shape (type: "local", command as a single
  array combining executable and args).
- Extracted the read-merge-write JSON logic shared by Cursor, Claude
  Desktop, and OpenCode into one write_mcp_json_config helper
  parameterized by config path, servers key, and entry shape, rather
  than duplicating it a third time. Cursor's own output is unchanged.
- Extended legacy-package reference scanning to include both new
  config files.
- Documented that ChatGPT Desktop shares Codex CLI's config.toml on
  the same host, so --codex already covers it.

Also changes the default (no-flag) and --all behavior: auto-detect
and configure every client found, silently skipping ones that aren't,
without prompting. Explicit single-client flags (--claude, etc.) keep
today's behavior of dying if that specific client isn't installed.
Retires the interactive per-client Y/n prompt this replaces.
Covers install/uninstall/manual-configuration for both new clients,
the ChatGPT-Desktop-via-Codex relationship, and the installer's new
default behavior (auto-detect and configure everything found, no
prompting, explicit single-client flags still fail loudly if missing).
…them

write_mcp_json_config fully replaced each client's server entry on
every run, so re-running the installer would silently re-enable an
OpenCode server the user had explicitly disabled via enabled: false
(the constructed entry always set enabled: true, and always won
because it overwrote the whole object rather than merging into it).

Merge onto the existing entry instead, and stop forcing an explicit
enabled: true on the entries this installer constructs itself, so an
absent field just falls through to OpenCode's own default instead of
overriding whatever the user (or another tool) had set.

Found by code review.
@antonisobkowicz-asana
antonisobkowicz-asana merged commit 25737b8 into main Sep 8, 2026
2 checks passed
@antonisobkowicz-asana
antonisobkowicz-asana deleted the installer-claude-desktop branch September 8, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant