Skip to content

feat: shared binary resolver + goose-init driver support#1283

Merged
jpleva91 merged 1 commit intomainfrom
feat/shared-binary-resolver-goose
Mar 28, 2026
Merged

feat: shared binary resolver + goose-init driver support#1283
jpleva91 merged 1 commit intomainfrom
feat/shared-binary-resolver-goose

Conversation

@jpleva91
Copy link
Copy Markdown
Collaborator

Summary

  • Extract resolveBinary() into shared module — all 4 init commands use identical resolution logic
  • Fix claude-init workspace resolver: $HOME fallback instead of git rev-parse (fixes broken Stop hook in subrepos)
  • New goose-init command for Block's Goose CLI (MCP extension integration)
  • auto-setup now covers Claude Code, Copilot CLI, Goose, and DeepAgents

Binary resolution order (all drivers)

  1. Dev repo: apps/cli/dist/bin.jsnode apps/cli/dist/bin.js
  2. npm install: node_modules/.bin/agentguard → relative path
  3. npm alias: node_modules/.bin/aguard → relative path
  4. Global: bare agentguard (PATH)

Files

File What
apps/cli/src/resolve-binary.ts New — shared binary resolution
apps/cli/src/commands/goose-init.ts New — Goose driver init
apps/cli/src/commands/claude-init.ts Use shared resolver + hookCmd() helper
apps/cli/src/commands/copilot-init.ts Use shared resolver
apps/cli/src/commands/deepagents-init.ts Use shared resolver
apps/cli/src/commands/auto-setup.ts Also runs goose-init
apps/cli/src/bin.ts Register goose-init + help text

Test plan

  • pnpm build — 18/18 packages
  • pnpm test — 856 CLI tests pass (including updated claude-init test)
  • Run agentguard claude-init in dev repo — verify direct binary path
  • Run agentguard auto-setup — verify all drivers attempted
  • Run agentguard goose-init — verify config written

🤖 Generated with Claude Code

@jpleva91 jpleva91 force-pushed the feat/shared-binary-resolver-goose branch from b18464d to 343660b Compare March 28, 2026 23:38
Extract resolveBinary() into apps/cli/src/resolve-binary.ts — all init
commands (claude-init, copilot-init, deepagents-init, goose-init) now
use the same resolution logic:

  1. Dev repo: apps/cli/dist/bin.js → "node apps/cli/dist/bin.js"
  2. npm install: node_modules/.bin/agentguard → relative path
  3. npm alias: node_modules/.bin/aguard → relative path
  4. Global: bare "agentguard" (PATH)

Also fixes the claude-init workspace resolver: uses $HOME fallback
instead of git rev-parse (which breaks when cwd is a subrepo).

New: goose-init command for Block's Goose CLI — registers AgentGuard
as an MCP governance extension in ~/.config/goose/config.yaml.

- apps/cli/src/resolve-binary.ts: shared binary resolution
- apps/cli/src/commands/goose-init.ts: new Goose driver init
- apps/cli/src/commands/claude-init.ts: use shared resolver + hookCmd()
- apps/cli/src/commands/copilot-init.ts: use shared resolver
- apps/cli/src/commands/deepagents-init.ts: use shared resolver
- apps/cli/src/commands/auto-setup.ts: also runs goose-init
- apps/cli/src/bin.ts: register goose-init command + help text

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jpleva91 jpleva91 force-pushed the feat/shared-binary-resolver-goose branch from 343660b to 7eed433 Compare March 28, 2026 23:41
@jpleva91 jpleva91 merged commit a871051 into main Mar 28, 2026
4 checks passed
@jpleva91 jpleva91 deleted the feat/shared-binary-resolver-goose branch March 28, 2026 23:43
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