Add dynamic agent selection to configure#14
Conversation
Configure now supports interactive agent selection plus explicit --all and --agents paths so users can install only the integrations they want while preserving scripted setup.
Greptile SummaryThis PR adds interactive agent selection to Confidence Score: 4/5Safe to merge with minor caveats; no data loss or security risk, but three P2 issues in configure logic worth addressing. All findings are P2 (non-blocking). The --no-mcp behavior change is a subtle breaking change for an edge-case workflow, the non-interactive vs interactive default inconsistency may produce noisy CI output, and the Copilot detection false positive is cosmetic. Core attribution logic is untouched. src/configure/mod.rs — resolve_agent_selection, detect_agents, and the MCP gate logic. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[agentdiff configure] --> B{--all AND --agents?}
B -- yes --> ERR[bail! mutually exclusive]
B -- no --> C{--all?}
C -- yes --> SEL_ALL[AgentSelection::all]
C -- no --> D{--agents list?}
D -- yes --> PARSE[parse names via AgentTarget::from_name\nbail on unknown agent]
PARSE --> SEL_EXP[AgentSelection from explicit list]
D -- no --> E{stdin is_terminal?}
E -- yes --> PROMPT[prompt_agent_selection\ndetect_agents + MultiSelect picker\ndefault = default_selected AND detected]
E -- no --> SEL_REC[AgentSelection::recommended\nall except Antigravity]
SEL_ALL --> FLAGS[apply_skip_flags\nno_claude/cursor/codex/windsurf/opencode/copilot/antigravity]
SEL_EXP --> FLAGS
PROMPT --> FLAGS
SEL_REC --> FLAGS
FLAGS --> RUN[run configure steps per selection flags]
RUN --> MCP{selection.claude AND NOT no_mcp?}
MCP -- yes --> CMCP[step_configure_mcp_claude]
MCP -- no --> SKIP_MCP[skip MCP]
|
| if selection.claude { | ||
| claude::step_configure_claude(config)?; | ||
| } | ||
| if !no_mcp { | ||
| if selection.claude && !args.no_mcp { | ||
| claude::step_configure_mcp_claude()?; | ||
| } |
There was a problem hiding this comment.
--no-claude now silently skips MCP configuration
The old code gated Claude and MCP independently:
// old
if !no_claude { claude::step_configure_claude(config)?; }
if !no_mcp { claude::step_configure_mcp_claude()?; }The new code ties MCP to selection.claude:
if selection.claude && !args.no_mcp {
claude::step_configure_mcp_claude()?;
}selection.claude becomes false via the interactive picker (user de-selects Claude), --no-claude, or --agents <list-without-claude>. In all those cases MCP is now silently skipped even if --no-mcp was not supplied. Anyone who previously ran --no-claude expecting MCP to still be registered will now silently get neither. If the intent is to permanently couple them, the change should be documented explicitly.
| println!( | ||
| "{} non-interactive configure: using recommended agents (use --all for Gemini/Antigravity too)", | ||
| dim() | ||
| ); | ||
| AgentSelection::recommended() | ||
| }; | ||
|
|
||
| selection.apply_skip_flags(args); |
There was a problem hiding this comment.
Non-interactive mode configures all agents regardless of installation
When stdin is not a terminal (CI, scripts), AgentSelection::recommended() enables every agent except Antigravity unconditionally:
fn recommended() -> Self {
Self { antigravity: false, ..Self::all() }
}In contrast, the interactive picker only pre-checks agents that are both default_selected and present on disk (detected.contains(agent)). A CI runner that calls agentdiff configure without flags will attempt to configure Cursor, Codex, Windsurf, OpenCode, and Copilot even when none of those tools are installed. The individual configure steps may handle missing dirs gracefully, but the inconsistency between interactive and non-interactive defaults is surprising and may produce noisy output in automated contexts.
Avoid marking Copilot as detected unless a Copilot extension is installed, and document that Claude MCP setup follows the Claude Code selection.
Summary
agentdiff configure, with detected/not-detected labels and Gemini/Antigravity left optional by default.--alland--agentspaths while preserving existing--no-*skip flags.Closes #10
Test plan
cargo testcargo run --bin agentdiff -- configure --helpcargo run --bin agentdiff -- configure --agents nopefails before writing setup files