feat(copilot): add rtk init --agent copilot support#728
Open
jeziellopes wants to merge 2 commits intortk-ai:developfrom
Open
feat(copilot): add rtk init --agent copilot support#728jeziellopes wants to merge 2 commits intortk-ai:developfrom
jeziellopes wants to merge 2 commits intortk-ai:developfrom
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Add GitHub Copilot as a target agent for rtk init: - Add `Copilot` variant to `AgentTarget` enum - Add `hooks/copilot-rtk-rules.md` with compact RTK instructions - Add `run_copilot_mode()` that writes `.github/copilot-instructions.md` (idempotent: skips if RTK already detected in the file) - Add `--uninstall --agent copilot` to remove the instructions file - Route `install_copilot` through `init::run()` and `init::uninstall()` Usage: rtk init --agent copilot # install in current project rtk init --uninstall --agent copilot # remove Closes the gap from PR rtk-ai#605 / rtk-ai#704 where rtk hook copilot was added but rtk init had no copilot counterpart. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: jeziellopes <jeziellopes@gmail.com>
ed8bc50 to
83e2f8d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the gap left by #605 / #704:
rtk hook copilotwas shipped butrtk inithad no Copilot counterpart. This PR addsrtk init --agent copilot.Changes
src/main.rsCopilotvariant toAgentTargetenum; routedinstall_copilotand uninstallsrc/init.rsrun_copilot_mode(),COPILOT_INSTRUCTIONSconst, uninstall support,install_copilotparamCHANGELOG.md[Unreleased]entryBehavior
Pattern followed
Mirrors Cline/Windsurf exactly:
fn run_copilot_mode(verbose: u8) -> Result<()>--agenttarget (short-circuits before the Claude/OpenCode match block)Testing
Manually tested in a temp dir: install, idempotent re-run, and uninstall all work correctly.
Context
rtk hook copilotRust subcommand (VS Code + Copilot CLI hook)rtk init --agent copilotlike they can for Cursor, Windsurf, and Cline