Repository navigation
Description
Problem
rtk init picks the target agent in three different ways:
- no flag: Claude Code (the default);
- a dedicated flag:
--gemini,--codex,--copilot,--opencode; - the
--agentenum:claude,cursor,trae,windsurf,cline,kilocode,antigravity,kimi,pi,hermes,droid,vibe,omp.
On top of these, the mode flags --claude-md, --hook-only, --auto-patch and --no-patch mean something for some agents and nothing for others.
main.rs resolves all of this with an if / else if chain in a fixed order. The last branch is a shared path that installs Claude Code unless something turns it off. Any combination the chain does not expect is therefore settled by the order of the branches or by falling through to Claude, and the command still exits 0.
Symptoms
All of these exit 0, with a fresh HOME, LC_ALL=C, on develop plus #3000:
rtk init -g --gemini --agent cursor --dry-run # Gemini only, Cursor dropped
rtk init -g --codex --agent cursor --dry-run # Codex only, Cursor dropped
rtk init -g --copilot --agent trae --dry-run # Copilot only, Trae dropped
rtk init -g --opencode --agent pi --dry-run # Pi only, OpenCode dropped
rtk init -g --agent windsurf --claude-md --dry-run # --claude-md ignored
rtk init --agent cline --hook-only --dry-run # --hook-only ignored
rtk init -g --agent cursor --no-patch --dry-run # hooks.json patched anyway
The Claude fall-through is behind two bugs filed so far:
- rtk init -g --agent cursor fails #2097:
--agent cursorinstalled Claude Code as well, fixed for Cursor alone by fix(init): --agent cursor installs Cursor only and creates ~/.cursor #3000; rtk init --uninstall -g --agent kilocode(and windsurf/cline/antigravity/kimi) runs the Claude uninstaller instead — removing Claude's config and nothing of the named agent #3404:--uninstall --agent kilocode, and windsurf, cline, antigravity and kimi, runs the Claude uninstaller.
The mixed shapes also leak into the docs: #3429 found rtk init --cursor, a flag that does not exist, in the troubleshooting guide.
Fixing each combination as it is found means adding one more guard to the chain each time. #3000 added one; a Claude-only flag check for Cursor, Windsurf and Cline would add three more.
Proposal
One command shape: rtk init [-g] [--uninstall] --agent <name> [options].
-
Every agent is an
--agentvalue, includinggemini,codex,copilotandopencode. The old flags stay as deprecated aliases that map to--agent, so existing docs and scripts keep working. -
Each agent declares what it supports:
- scopes (global, project or both);
- whether it has a file that
--auto-patch/--no-patchgoverns; - whether it has
--claude-md/--hook-onlystyle modes.
An option the agent does not support is an error, in the form
--codexalready uses (--codex cannot be combined with --claude-md). -
Dispatch is one
matchon the agent, with no default branch, so a new agent that forgets its arm fails to compile instead of installing Claude Code. Install, uninstall and--showgo through the same table. -
Two targets in one invocation (for example
--gemini --agent cursor) are either rejected or supported explicitly with a repeatable--agent. Which of the two is a maintainer decision. It also settles the open question inrtk init --opencodeappears to skip Claude hook installation #4046 / fix(init): install Claude hook with OpenCode #4052 of whether--opencodemeans "OpenCode only" or "Claude Code plus OpenCode".
Behaviour for the single-target forms stays as it is today. The change is that every combination the current chain resolves silently either works as written or fails with a message.
Activity
rtk-wshm-sync-bot commentedon Sep 25, 2026
🔍 Automated Triage
bughighSummary
rtk init's if/else chain lets conflicting agent flags silently drop targets or ignore mode flags and still exit 0; proposes a single --agent-based dispatch table
📁 Relevant files
src/main.rsSuggested Actions
rtk init --opencodeappears to skip Claude hook installation #4046/fix(init): install Claude hook with OpenCode #4052: whether two-target invocations are rejected or repeatable --agentrtk init --uninstall -g --agent kilocode(and windsurf/cline/antigravity/kimi) runs the Claude uninstaller instead — removing Claude's config and nothing of the named agent #3404, RuboCop autocorrect aliases missed,rtk init --cursorin troubleshooting does not exist, Windows config path undocumented — plus what I could not verify and why #3429 as prior symptoms of the same fall-through designTriaged automatically by wshm · This is an automated analysis, not a human review.