{"record":{"id":"0872be38ac6f819d","repo":"rtk-ai/rtk","slug":"windsurf-support-is-global-only-use-rtk-init-g","errorCode":null,"errorMessage":"Windsurf support is global-only. Use: rtk init -g --agent windsurf","messagePattern":"Windsurf support is global-only\\. Use: rtk init -g --agent windsurf","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/hooks/init.rs","lineNumber":424,"sourceCode":"        if matches!(patch_mode, PatchMode::Auto) {\n            anyhow::bail!(\"--codex cannot be combined with --auto-patch\");\n        }\n        if matches!(patch_mode, PatchMode::Skip) {\n            anyhow::bail!(\"--codex cannot be combined with --no-patch\");\n        }\n        run_codex_mode(global, ctx)?;\n    } else {\n        // Validation: Global-only features\n        if install_opencode && !global {\n            anyhow::bail!(\"OpenCode plugin is global-only. Use: rtk init -g --opencode\");\n        }\n\n        if install_cursor && !global {\n            anyhow::bail!(\"Cursor hooks are global-only. Use: rtk init -g --agent cursor\");\n        }\n\n        if install_windsurf && !global {\n            anyhow::bail!(\"Windsurf support is global-only. Use: rtk init -g --agent windsurf\");\n        }\n\n        if install_windsurf {\n            run_windsurf_mode(ctx)?;\n        } else if install_cline {\n            run_cline_mode(ctx)?;\n        } else {\n            // Mode selection (Claude Code / OpenCode)\n            match (install_claude, install_opencode, claude_md, hook_only) {\n                (false, true, _, _) => run_opencode_only_mode(ctx)?,\n                (true, opencode, true, _) => run_claude_md_mode(global, opencode, ctx)?,\n                (true, opencode, false, true) => {\n                    run_hook_only_mode(global, patch_mode, opencode, ctx)?\n                }\n                (true, opencode, false, false) => {\n                    run_default_mode(global, patch_mode, opencode, ctx)?\n                }\n                (false, false, _, _) => {","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/rtk-ai/rtk/blob/0924356b4caba4989607227b7c8824d3d8098719/src/hooks/init.rs#L406-L442","documentation":"rtk's `init` command throws this when `--agent windsurf` (install_windsurf=true) is passed without `-g/--global`. Like Cursor, Windsurf integration is global-only: it configures the user-level Windsurf setup, and a local-project mode is not implemented. The message includes the exact command to use.","triggerScenarios":"Calling `rtk init --agent windsurf` (install_windsurf=true, global=false). The bail fires in run() at src/hooks/init.rs:423-425 in the global-only validation block before run_windsurf_mode is dispatched.","commonSituations":"Trying to scope Windsurf hooks to a single project; copy-pasting a setup script that omits `-g`; setting up multiple AI editors where claude/claude-md modes work locally but windsurf/cursor do not.","solutions":["Re-run with the global flag: `rtk init -g --agent windsurf`.","Remove `--agent windsurf` if you only want local project integration via CLAUDE.md (`rtk init --claude-md`).","Consult `rtk init --help` to confirm windsurf is global-only before scripting."],"exampleFix":"// before (shell)\nrtk init --agent windsurf\n// after (shell)\nrtk init -g --agent windsurf","handlingStrategy":"validation","validationCode":"// shell check before invoking rtk init with windsurf\nif [[ \"$*\" == *\"--agent windsurf\"* && \"$*\" != *\"-g\"* && \"$*\" != *\"--global\"* ]]; then\n  echo \"refusing: windsurf install requires -g\"; exit 1;\nfi\nrtk init -g --agent windsurf","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat windsurf like cursor: global-only, always use `-g`.","For project-scoped token filtering, prefer `rtk init --claude-md` instead.","Keep a canonical setup script reviewed for global vs local flags."],"tags":["cli","configuration","windsurf","global-only"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"0924356b4caba4989607227b7c8824d3d8098719","analyzedAt":"2026-09-19T19:25:29.612Z","contentChangedAt":"2026-09-19T19:25:29.612Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}