{"record":{"id":"5cdf7e8f7b5b3f72","repo":"rtk-ai/rtk","slug":"antigravity-is-project-scoped-use-rtk-init-age","errorCode":null,"errorMessage":"Antigravity is project-scoped. Use: rtk init --agent antigravity","messagePattern":"Antigravity is project-scoped\\. Use: rtk init --agent antigravity","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":2451,"sourceCode":"                if global {\n                    hooks::init::run_copilot_global(ctx)?;\n                } else {\n                    hooks::init::run_copilot(ctx)?;\n                }\n            } else if agent == Some(AgentTarget::Pi) {\n                hooks::init::run_pi_mode_with_patch_mode(global, patch_mode, ctx)?\n            } 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;","sourceCodeStart":2433,"sourceCodeEnd":2469,"githubUrl":"https://github.com/rtk-ai/rtk/blob/0924356b4caba4989607227b7c8824d3d8098719/src/main.rs#L2433-L2469","documentation":"rtk's `rtk init --agent antigravity` supports only project-scoped installation. When `--global` is passed, src/main.rs:2451 bails out with `anyhow::bail!` because Antigravity's hook integration has no global configuration path; the library fails fast rather than writing an unsupported global config.","triggerScenarios":"Running `rtk init --agent antigravity` together with the global flag (`--global`) in `src/main.rs`, so the `AgentTarget::Antigravity` branch sees `global == true`.","commonSituations":"Copy-pasting an init command from a globally-supported agent and swapping the agent name; automation that always passes `--global`; assuming all agent targets share the same scoping rules.","solutions":["Run `rtk init --agent antigravity` without `--global` from the project root","Repeat the project-level init in each repository that needs Antigravity hooks","Check `rtk init --help` to see which agents accept `--global`"],"exampleFix":"// before\nrtk init --agent antigravity --global\n// after\nrtk init --agent antigravity","handlingStrategy":"validation","validationCode":"// shell guard before invoking rtk\ncase \"$AGENT:$FLAGS\" in antigravity:*--global*) echo \"antigravity is project-scoped; drop --global\"; exit 1;; esac","typeGuard":null,"tryCatchPattern":"// Rust caller\nif let Err(e) = rtk_init_agent(AgentTarget::Antigravity, global) {\n    if e.to_string().contains(\"project-scoped\") { return init_without_global(); }\n    return Err(e.into());\n}","preventionTips":["Never combine --global with antigravity; treat it as project-only","Script a per-repo loop instead of one global init","Confirm the agent's scope support in `rtk init --help`"],"tags":["cli","init","antigravity","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"}