Skip to main content

Module setup_claude

Module setup_claude 

Source
Expand description

Local-marketplace installer for Claude Code integration.

gw setup-claude writes a self-contained Claude Code marketplace tree under the OS data-local dir (e.g. ~/.local/share/git-worktree-manager/ claude-marketplace/ on Linux/macOS, %LOCALAPPDATA%\git-worktree- manager\claude-marketplace\ on Windows). After writing, we shell out to the claude CLI to register the marketplace and install/update the plugin so Claude Code actually loads it.

Re-runs are idempotent: file content is content-addressed, and the claude CLI calls switch between fresh install and update based on a sentinel marker we drop on first run.

Modules§

claude_cli
Wrapper around the external claude CLI for plugin/marketplace ops.
command_gw
Body of the /gw slash command. Acts as a thin trigger that hands off to the bundled delegate skill, which contains the actual task-routing logic.
legacy
Removal of pre-marketplace install locations.
manifest
JSON manifests for the local Claude Code marketplace + plugin.
paths
Filesystem layout for the local-marketplace install.
writer
File-write helpers used by the marketplace install. Writes are content-addressed (skip when bytes match) so re-running gw setup-claude is a true no-op when nothing changed.

Functions§

is_installed
True if our marketplace tree exists at the canonical data-local path.
is_plugin_installed
Backward-compat alias kept for diagnostics.rs. Same meaning as is_installed().
is_skill_installed
Backward-compat alias used by gw doctor. Returns true if either the new install OR a legacy install (any of three layouts) is present.
setup_claude
Production entry point: resolves real home + data-local dirs and uses the real claude CLI.
setup_claude_with_cli
Test/composition entry point. Lets callers inject the home root, the data-local root, and a ClaudeCli impl independently.