Skip to content

Add multi-agent hook support and revamp CLI TUI with clack/prompts#31

Open
f1shy-dev wants to merge 2 commits intomainfrom
capy/add-gemini-cursor-cline
Open

Add multi-agent hook support and revamp CLI TUI with clack/prompts#31
f1shy-dev wants to merge 2 commits intomainfrom
capy/add-gemini-cursor-cline

Conversation

@f1shy-dev
Copy link
Copy Markdown
Owner

@f1shy-dev f1shy-dev commented Mar 7, 2026

This PR expands AI coding agent hook support from 2 to 5 agents and modernizes the CLI UI framework.

New agent setup modules

  • Add packages/server/src/setup/gemini.ts—configures ~/.gemini/settings.json hooks, transforms BeforeAgent/BeforeTool/SessionStart/SessionEnd/AfterAgent events via inline Node.js script to normalized names
  • Add packages/server/src/setup/cursor.ts—configures ~/.cursor/hooks.json with sessionStart/preToolUse (matcher: "*")/stop hooks, transforms event names inline before POST
  • Add packages/server/src/setup/cline.ts—creates executable Node scripts in ~/Documents/Cline/Rules/Hooks/ for TaskStart/UserPromptSubmit/PreToolUse/TaskComplete, uses marker comment // @distracted/server hook for detection/removal, awaits Promise.allSettled for multi-event POST

Setup orchestration and CLI

  • Update packages/server/src/setup/index.ts—add gemini/cursor/cline to AgentType and SetupStatus, replace raw readline keypress multi-select with @clack/prompts.multiselect, update getSetupStatus/setupAgent/removeAgent interactiveSetup/interactiveRemove for all 5 agents
  • Rewrite packages/server/src/bin.ts—remove cac dependency, implement manual process.argv parsing for --setup/--remove/--status/--port/--help, add clack intro/outro/confirm/log flow, support comma-separated agent lists

Types and server

  • Update packages/server/src/types.ts—extend HookPayload.source union to include "claude" | "opencode" | "gemini" | "cursor" | "cline" | "pi"
  • Update packages/server/src/server.ts—validate source against expanded list, replace startServer banner with p.note/p.log.info, use picocolors for status output
  • Update packages/server/src/state.ts—replace UI.Style.* and UI.println with @clack/prompts (p.log.step for hook events, p.log.info for status updates), use picocolors for colored output

Existing setup and dependencies

  • Update packages/server/src/setup/claude.ts and opencode.ts—replace UI.println/UI.Style usage with p.log.success/p.log.info and picocolors dim
  • Update packages/server/package.json—add @clack/prompts and picocolors, remove cac

Open in Capy DIS-15 · 5.3-Codex-Fast

@f1shy-dev f1shy-dev added the capy Generated by capy.ai label Mar 7, 2026 — with Capy AI
Copy link
Copy Markdown

@capy-ai capy-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant