{"record":{"id":"f157abb6e26dd03a","repo":"rtk-ai/rtk","slug":"kimi-ai-is-project-scoped-use-rtk-init-agent-k","errorCode":null,"errorMessage":"Kimi AI is project-scoped. Use: rtk init --agent kimi","messagePattern":"Kimi AI is project-scoped\\. Use: rtk init --agent kimi","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":2458,"sourceCode":"            } else if agent == Some(AgentTarget::Trae) {\n                hooks::init::run_trae_mode(global, ctx)?\n            } else if agent == Some(AgentTarget::Omp) {\n                hooks::init::run_omp_mode_with_patch_mode(global, patch_mode, ctx)?\n            } else if agent == Some(AgentTarget::Kilocode) {\n                if global {\n                    anyhow::bail!(\"Kilo Code is project-scoped. Use: rtk init --agent kilocode\");\n                }\n                hooks::init::run_kilocode_mode(ctx)?;\n            } else if agent == Some(AgentTarget::Antigravity) {\n                if global {\n                    anyhow::bail!(\n                        \"Antigravity is project-scoped. Use: rtk init --agent antigravity\"\n                    );\n                }\n                hooks::init::run_antigravity_mode(ctx)?;\n            } else if agent == Some(AgentTarget::Kimi) {\n                if global {\n                    anyhow::bail!(\"Kimi AI is project-scoped. Use: rtk init --agent kimi\");\n                }\n                hooks::init::run_kimi_mode(ctx)?;\n            } else if agent == Some(AgentTarget::Hermes) {\n                hooks::init::run_hermes_mode(ctx)?;\n            } else if agent == Some(AgentTarget::Droid) {\n                hooks::init::run_droid_mode(global, ctx)?;\n            } else if agent == Some(AgentTarget::Vibe) {\n                hooks::init::run_vibe_mode(global, hook_only, patch_mode, ctx)?;\n            } else {\n                let install_opencode = opencode;\n                let install_claude = !opencode;\n                let install_cursor = agent == Some(AgentTarget::Cursor);\n                let install_windsurf = agent == Some(AgentTarget::Windsurf);\n                let install_cline = agent == Some(AgentTarget::Cline);\n\n                hooks::init::run(\n                    global,\n                    install_claude,","sourceCodeStart":2440,"sourceCodeEnd":2476,"githubUrl":"https://github.com/rtk-ai/rtk/blob/0924356b4caba4989607227b7c8824d3d8098719/src/main.rs#L2440-L2476","documentation":"`rtk init --agent kimi` only supports project-level setup in rtk. The handler at src/main.rs:2458 rejects the global variant with `anyhow::bail!` because Kimi AI hook integration does not implement a global mode, so passing `--global` aborts init with this guidance message.","triggerScenarios":"Invoking `rtk init --agent kimi --global`; the `AgentTarget::Kimi` branch in main.rs detects `global == true` and bails before calling `run_kimi_mode`.","commonSituations":"A user who previously initialized a globally-scoped agent (e.g. Claude, Droid) reuses the same command shape for Kimi; CI provisioning scripts that blanket-apply `--global` to all agents.","solutions":["Remove `--global` and run `rtk init --agent kimi` in the target project root","Loop the project-scoped init over each repository that needs it","Pick an agent target that supports global installation if a machine-wide hook is required"],"exampleFix":"// before\nrtk init --agent kimi --global\n// after\nrtk init --agent kimi","handlingStrategy":"validation","validationCode":"// shell guard before invoking rtk\nif [ \"$AGENT\" = kimi ] && [[ \"$FLAGS\" == *--global* ]]; then echo \"kimi is project-scoped; drop --global\"; exit 1; fi","typeGuard":null,"tryCatchPattern":"// Rust caller\nlet result = rtk_init_agent(AgentTarget::Kimi, global);\nif result.is_err() && result.as_ref().unwrap_err().to_string().contains(\"project-scoped\") {\n    return rtk_init_agent(AgentTarget::Kimi, false);\n}\nresult?;","preventionTips":["Keep a table of agent targets vs supported scopes; kimi is project-scoped","Run init from the repo root without --global","Sanitize scripts that blanket-append --global to init commands"],"tags":["cli","init","kimi","project-scope"],"backgroundTag":"unsupported-operation","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"}