Skip to content

feat(install): add --local flag to install from local build - #81

Merged
ArtyETH06 merged 9 commits into
ArtyETH06/https-github.com-leadbay-product-issues-3651from
feat/installer-local-build
May 30, 2026
Merged

feat(install): add --local flag to install from local build#81
ArtyETH06 merged 9 commits into
ArtyETH06/https-github.com-leadbay-product-issues-3651from
feat/installer-local-build

Conversation

@ArtyETH06

Copy link
Copy Markdown
Contributor

Summary

Adds a --local flag to both the CLI installer and the Electron GUI wizard so developers can test local changes without publishing to npm.

Usage

# Build first
pnpm --filter @leadbay/mcp build

# GUI wizard (same OAuth flow, installs node dist/bin.js instead of npx)
pnpm --filter @leadbay/mcp installer -- --local

# CLI (no GUI)
node packages/mcp/dist/bin.js install --oauth --local

# Explicit path
node packages/mcp/dist/bin.js install --oauth --local=/abs/path/to/dist/bin.js

What it does

Without --local, the wizard writes this into every client config:

{ "command": "npx", "args": ["-y", "@leadbay/mcp@latest"] }

With --local, it writes:

{ "command": "node", "args": ["/absolute/path/to/packages/mcp/dist/bin.js"] }

After each pnpm --filter @leadbay/mcp build, the next MCP session picks up changes automatically — no reinstall needed.

Changes

  • install-claude-code.tsbuildClaudeCodeAddArgs accepts optional localBinPath
  • install-json-config.tsinstallInJsonConfig accepts optional localBinPath
  • installer-gui.ts — reads --local from process.argv at startup, threads through installInto
  • bin.ts — parses --local[=PATH] in runInstall, resolves absolute path, threads through

Base branch

Targets PR #69 (feat(mcp): add hosted HTTP server and installer wizard).

🤖 Generated with Claude Code

ArtyETH06 added 2 commits May 29, 2026 20:08
…f npx

For development testing: install the current checkout into Claude Desktop /
Claude Code without publishing to npm.

  # auto-resolves to packages/mcp/dist/bin.js
  node packages/mcp/dist/bin.js install --oauth --local

  # or pin an explicit path
  node packages/mcp/dist/bin.js install --oauth --local=/abs/path/to/dist/bin.js

The flag threads through installInClaudeCode (writes `node <path>` into
claude mcp add) and installInJsonConfig (writes command:node into Claude
Desktop / Cursor claude_desktop_config.json). Codex config unchanged for now.
@ArtyETH06 ArtyETH06 self-assigned this May 30, 2026
ArtyETH06 added 7 commits May 29, 2026 20:12
1. Bare flag parsing: replace parseFlag("local") with hasFlag + explicit
   --local= check so `--local` (no value) works and `--local --target x`
   doesn't misread --target as the bin path.

2. Absolute paths: resolve explicit --local=some/rel/path against cwd
   before storing in client configs; clients launch from their own
   working directory, so relative paths break on next launch.

3. Codex support: thread localBinPath through installInCodexConfig and
   buildCodexConfigBlock so Codex gets `node <path>` instead of npx
   when --local is active.
…l resolver; resolve explicit paths to absolute
…BuiltDependencies to auto-approve postinstall

devDependencies are stripped from the published npm package — published
npx installs would miss Electron entirely, hitting the browser-fallback
path instead of the GUI wizard.

Fix: restore electron to optionalDependencies (included in the tarball)
and add pnpm.onlyBuiltDependencies so its postinstall script runs
automatically on local dev without requiring pnpm approve-builds.
pnpm ignores this field in workspace package package.json files — it only
takes effect at the workspace root. Moving it there ensures electron and
esbuild postinstall scripts run automatically on pnpm install in a fresh
checkout, without requiring pnpm approve-builds.
@ArtyETH06
ArtyETH06 merged commit fc899b0 into ArtyETH06/https-github.com-leadbay-product-issues-3651 May 30, 2026
1 check passed
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.

1 participant