rtk-ai/rtk

feat: add Windsurf support via rtk init --agent windsurf

Open

#695 建立於 2026年3月18日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)Rust (2,914 fork)batch import
area:clieffort-mediumenhancementhelp wantedpriority:low

倉庫指標

Star
 (48,085 star)
PR 合併指標
 (平均合併 11天 1小時) (30 天內合併 45 個 PR)

描述

Summary

Add Windsurf IDE/Cascade support to RTK.

How Windsurf hooks work

Windsurf uses pre_run_command hooks in ~/.codeium/windsurf/hooks.json (user-level) or .windsurf/hooks.json (workspace). Hooks receive JSON via stdin with tool_info.command_line but cannot rewrite commands — they can only block (exit 2) or allow (exit 0).

Implementation plan

Since Windsurf hooks can't rewrite commands, RTK support uses two approaches:

  1. Rules file (.windsurfrules or global): Instructions telling Cascade to prefix commands with rtk
  2. Pre-run hook (optional): Log/track commands for rtk gain analytics even without rewriting

Files to add

  • hooks/windsurf-rtk-rules.md — Windsurf rules content (like hooks/rtk-awareness-codex.md)
  • hooks/windsurf-rtk-hook.sh — Optional pre_run_command hook for tracking
  • src/init.rs — Add Windsurf variant to AgentTarget enum
  • src/main.rs — Route --agent windsurf

rtk init -g --agent windsurf should:

  1. Create ~/.codeium/windsurf/rules/rtk.md with RTK instructions
  2. Optionally install pre_run_command hook in ~/.codeium/windsurf/hooks.json
  3. Show status in rtk init --show

References

貢獻者指南