Skip to content

feat(hooks): add Trae IDE integration#3008

Open
deqingLv wants to merge 5 commits into
rtk-ai:developfrom
deqingLv:feat/trae-hook-integration
Open

feat(hooks): add Trae IDE integration#3008
deqingLv wants to merge 5 commits into
rtk-ai:developfrom
deqingLv:feat/trae-hook-integration

Conversation

@deqingLv

Copy link
Copy Markdown

Summary

  • add --agent trae project and global install/uninstall support for Trae hooks.json
  • add a native rtk hook trae adapter that transparently rewrites RunCommand inputs through RTK while preserving Trae's permission flow
  • document Trae setup, payload format, global .trae / .trae-cn behavior, and add coverage for config preservation, idempotency, backup, uninstall, and malformed input

Behavior

  • project install: rtk init --agent trae writes .trae/hooks.json
  • global install: rtk init -g --agent trae always manages ~/.trae/hooks.json and additionally manages ~/.trae-cn/hooks.json when ~/.trae-cn already exists
  • existing config and unrelated hooks are preserved; existing files are backed up before mutation
  • uninstall removes only RTK-managed nested hooks
  • the native handler returns hookSpecificOutput.updatedInput and deliberately omits permissionDecision, leaving approval policy to Trae

Test plan

  • cargo fmt --all --check && cargo clippy --all-targets && cargo test
  • Full suite: 2451 unit tests passed, 8 ignored; all integration test binaries passed
  • Manual testing: project install and uninstall in an isolated temporary directory
  • Manual testing: Trae PreToolUse payload rewrote git status to rtk git status while preserving the description field

@CLAassistant

CLAassistant commented Jul 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@tapheret2 tapheret2 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review: feat(hooks): add Trae IDE integration

Files: README.md, README_es.md, README_fr.md, README_ja.md, README_ko.md
Size: +853 / -22

Notes

  • Static pass on the patch: no obvious blockers from the diff alone.

Thanks @deqingLv — independent review on the patch.

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.

3 participants