Skip to content

feat(copilot): CLI native integration#2101

Merged
aeppling merged 9 commits into
developfrom
fix/copilot-cli-hook-config-schema
May 29, 2026
Merged

feat(copilot): CLI native integration#2101
aeppling merged 9 commits into
developfrom
fix/copilot-cli-hook-config-schema

Conversation

@aeppling
Copy link
Copy Markdown
Contributor

@aeppling aeppling commented May 26, 2026

Related to #307

Changes

  • fix(hook): emit Copilot CLI-compatible config (dual VS Code + CLI schemas in one .github/hooks/rtk-rewrite.json) so Copilot CLI's hook actually fires.
  • fix(hook): strip leading UTF-8 BOM in run_copilot for Windows hosts.
  • feat(hook): rtk init --uninstall --copilot — dedicated entry point routed like Hermes; no new arg added to uninstall().
  • feat(hook): telemetry::detect_hook_type recognizes the project-scoped Copilot hook.
  • feat(hook): discover agent status reports copilot_hook_installed + "tracked via rtk gain" note (parity with Cursor).
  • fix(hook): semgrep marker on the new fs::remove_file (matches existing uninstall paths) + regression tests that install/uninstall touch only RTK's own files.

Tests

  • cargo fmt --all --check && cargo clippy --all-targets && cargo test --all1957 passed, 6 ignored
  • Real install → uninstall round-trip with the rebuilt binary; user content in copilot-instructions.md preserved
  • Install and uninstall leave other .github/hooks/*.json files untouched (regression tests)
  • Simulated host payloads via stdin: VS Code → transparent rewrite, Copilot CLI → deny-with-suggestion
  • BOM-prefixed payloads (one and two BOMs) parse after stripping
  • Tested in windows and WSL with copilot CLI (basic rewrite + permissions ask)

@aeppling aeppling changed the title fix(copilot): CLI native integration feat(copilot): CLI native integration May 26, 2026
rtk init --global --copilot # user-scoped (~/.copilot/hooks/, respects $COPILOT_HOME)
```

Project-scoped writes `.github/hooks/rtk-rewrite.json` (both hosts get transparent rewrite — VS Code Chat via `updatedInput`, Copilot CLI via `modifiedArgs`) plus the RTK block in `.github/copilot-instructions.md`. User-scoped writes only `~/.copilot/hooks/rtk-rewrite.json` — the Copilot CLI docs define no user-level instructions file.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

aeppling added 2 commits May 29, 2026 09:16
-g was missing user level instructions which are available for copilot
Copy link
Copy Markdown
Collaborator

@KuSh KuSh left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@aeppling aeppling merged commit a9a978c into develop May 29, 2026
17 checks passed
@aeppling aeppling mentioned this pull request May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants