rtk-ai/rtk · error

Kimi AI is project-scoped. Use: rtk init --agent kimi

Error message

Kimi AI is project-scoped. Use: rtk init --agent kimi

What it means

`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.

Solutions

  1. Remove `--global` and run `rtk init --agent kimi` in the target project root
  2. Loop the project-scoped init over each repository that needs it
  3. Pick an agent target that supports global installation if a machine-wide hook is required

Example fix

// before
rtk init --agent kimi --global
// after
rtk init --agent kimi
Defensive patterns

Strategy: validation

Validate before calling

// shell guard before invoking rtk
if [ "$AGENT" = kimi ] && [[ "$FLAGS" == *--global* ]]; then echo "kimi is project-scoped; drop --global"; exit 1; fi

Try / catch

// Rust caller
let result = rtk_init_agent(AgentTarget::Kimi, global);
if result.is_err() && result.as_ref().unwrap_err().to_string().contains("project-scoped") {
    return rtk_init_agent(AgentTarget::Kimi, false);
}
result?;

Prevention

When it happens

Trigger: Invoking `rtk init --agent kimi --global`; the `AgentTarget::Kimi` branch in main.rs detects `global == true` and bails before calling `run_kimi_mode`.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of rtk-ai/rtk@0924356b4c (2026-09-19). Data as JSON: /api/errors/f157abb6e26dd03a. Report an issue: GitHub.

Appendix: source

Thrown at src/main.rs:2458

            } else if agent == Some(AgentTarget::Trae) {
                hooks::init::run_trae_mode(global, ctx)?
            } else if agent == Some(AgentTarget::Omp) {
                hooks::init::run_omp_mode_with_patch_mode(global, patch_mode, ctx)?
            } else if agent == Some(AgentTarget::Kilocode) {
                if global {
                    anyhow::bail!("Kilo Code is project-scoped. Use: rtk init --agent kilocode");
                }
                hooks::init::run_kilocode_mode(ctx)?;
            } else if agent == Some(AgentTarget::Antigravity) {
                if global {
                    anyhow::bail!(
                        "Antigravity is project-scoped. Use: rtk init --agent antigravity"
                    );
                }
                hooks::init::run_antigravity_mode(ctx)?;
            } else if agent == Some(AgentTarget::Kimi) {
                if global {
                    anyhow::bail!("Kimi AI is project-scoped. Use: rtk init --agent kimi");
                }
                hooks::init::run_kimi_mode(ctx)?;
            } else if agent == Some(AgentTarget::Hermes) {
                hooks::init::run_hermes_mode(ctx)?;
            } else if agent == Some(AgentTarget::Droid) {
                hooks::init::run_droid_mode(global, ctx)?;
            } else if agent == Some(AgentTarget::Vibe) {
                hooks::init::run_vibe_mode(global, hook_only, patch_mode, ctx)?;
            } else {
                let install_opencode = opencode;
                let install_claude = !opencode;
                let install_cursor = agent == Some(AgentTarget::Cursor);
                let install_windsurf = agent == Some(AgentTarget::Windsurf);
                let install_cline = agent == Some(AgentTarget::Cline);

                hooks::init::run(
                    global,
                    install_claude,

View on GitHub (pinned to 0924356b4c)