feat(init): complete Copilot lifecycle - uninstall, idempotency, show_config#728
feat(init): complete Copilot lifecycle - uninstall, idempotency, show_config#728jeziellopes wants to merge 1 commit intortk-ai:developfrom
Conversation
ed8bc50 to
83e2f8d
Compare
Implements PR rtk-ai#728 functionality with improvements: - rtk init --agent copilot installs both the hook JSON AND lean instructions - The hook (.github/hooks/rtk-rewrite.json) does the heavy lifting - Instructions file is minimal (~15 lines) to avoid context pollution - Uninstall removes instructions but preserves shared hook JSON - Idempotent: re-running is safe Unlike upstream PR rtk-ai#728 which only reports hook status, this version actually installs the hook JSON, making it a one-command setup. Signed-off-by: Daniel Gehriger <dgehriger@globusmedical.com>
df22aac to
e59e5a8
Compare
e59e5a8 to
d11c613
Compare
|
Updated PR to address review gaps and align with issue #823: Changes in this force-push:
Additional fixes (self-review, commit
Note on #824: PR #824 uses |
4ff3257 to
bd487d6
Compare
|
Hey We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes No logic changes — only file moves and import path updates. What you need to doRebase your branch on git fetch origin && git rebase origin/developGit detects renames automatically. If you get import conflicts, update the paths: use crate::git; // now: use crate::cmds::git::git;
use crate::tracking; // now: use crate::core::tracking;
use crate::config; // now: use crate::core::config;
use crate::init; // now: use crate::hooks::init;
use crate::gain; // now: use crate::analytics::gain;Need help rebasing? Tag @aeppling |
ad26930 to
fe1cbf3
Compare
|
Rebased onto Changes to accommodate the new folder structure:
1129 tests pass, 0 clippy errors. |
fe1cbf3 to
ca69951
Compare
cf8e1c5 to
2f98d0a
Compare
6d791ed to
94cca62
Compare
|
PR #837 (rolf-quadra) targets the orphaned This PR already covers that surface:
Merging this PR resolves the scenario described in #836 and makes #837 redundant. Flagging in case it helps triage both together. |
|
@aeppling — updated PR description to reflect the current landscape. Since #859 shipped, the gap is clearer now: upstream has install but no lifecycle — no idempotency, no uninstall, no Happy to discuss scope or split if preferred. Thanks! |
Adds GitHub Copilot to the AgentTarget enum, following the existing --agent cline/windsurf/cursor pattern. Closes rtk-ai#823. - AgentTarget::Copilot in src/main.rs + routing - run_copilot_mode(): creates .github/hooks/rtk-rewrite.json and .github/copilot-instructions.md; idempotent (skips if already set) - PATH check via crate::utils::tool_exists() (cross-platform, no which) - uninstall: strips only RTK section, preserves pre-existing user content - show_config(): [ok]/[--] status for both .github files + usage line - Fix rtk-rewrite.json: rtk hook -> rtk hook copilot (embedded via include_str! so the installed hook is always correct) - Register hook in RTK_META_COMMANDS so rtk hook copilot routes correctly instead of falling through to passthrough mode Signed-off-by: Jeziel Lopes <jeziel@example.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
94cca62 to
bc7049a
Compare
Context
PR #859 (merged) shipped a basic
--copilotflag from PR #824. This PR completes what was shipped — adding the full agent lifecycle that every other agent in rtk has.Upstream's current
run_copilot()installs files and exits. No idempotency. No uninstall.rtk init --showis blind to Copilot files. This PR fills all of those gaps.What this adds on top of what shipped
--copilot(upstream, merged)--agent copilot(this PR).github/files--agent copilot)--copilot: bool--agent cline/windsurf/cursorrtkbinaryutils::tool_exists()— cross-platform, no false positives on Windows--uninstall --agent copilotrtk init --showCopilot statusshow_config()has no Copilot awareness[ok]/[--]for both.github/filesAlso fixes #836 / supersedes #837
Issue #836 reports that users who ran
rtk init --copilotearly on got.github/hooks/rtk-rewrite.jsonwith"command": "rtk hook"(missing subcommand), causing aparse_failureentry on every Bash tool call.show_config()exposes the Copilot files so users can inspect/verify the state--showand--uninstall; this PR's broader lifecycle support already covers that surfaceChanges
src/main.rsAgentTarget::Copilotenum variant;"hook"added toRTK_META_COMMANDS; routing torun_copilot_mode()src/hooks/init.rsrun_copilot_mode()(idempotent install), full uninstall branch (content-safe),show_config()checks, 6 unit tests.github/hooks/rtk-rewrite.json"rtk hook"→"rtk hook copilot"(embedded viainclude_str!, single source of truth)CHANGELOG.md[Unreleased]entriesTesting