rtk-ai/rtk · error
Vibe support is global-only. Use: rtk init -g --agent vibe
Error message
Vibe support is global-only. Use: rtk init -g --agent vibe
What it means
Like Gemini, Vibe agent integration in rtk is global-only: setup_vibe bails unless `global` is true, because Vibe is configured in the user's home directory (~/.vibe via resolve_vibe_dir), not per project. The error states the corrected command using the newer --agent syntax.
Solutions
- Rerun with the global flag: `rtk init -g --agent vibe`
- Remove any stale local hook config expecting per-project Vibe support
- If different behavior per project is needed, gate via Vibe's own config rather than rtk's
Example fix
// before rtk init --agent vibe // after rtk init -g --agent vibe
Defensive patterns
Strategy: validation
Validate before calling
// shell check before invoking if ! [[ "$*" == *" -g"* ]]; then echo "Vibe requires global: rtk init -g --agent vibe" >&2; exit 2; fi
Try / catch
rtk init --agent vibe || { echo "retrying globally"; rtk init -g --agent vibe; } Prevention
- Never script `--agent vibe` without -g
- Verify the init flag syntax after upgrading rtk (old --vibe flag may have moved under --agent)
- Per-project Vibe scoping is unsupported; plan configurations accordingly
When it happens
Trigger: Calling `rtk init --agent vibe` without -g, or `rtk init --vibe` without -g, i.e. any run where setup_vibe receives global=false. Also triggered by scripts calling the init path programmatically with global=false and patch_mode set.
Common situations: Trying to scope Vibe hooks to one repo; copying an init command from a teammate who already had it globally; upgrading rtk and re-running an old project-local init script.
Understand the failure class
Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.
Related errors
- Gemini support is global-only. Use: rtk init -g --gemini
- Antigravity is project-scoped. Use: rtk init --agent…
- --codex cannot be combined with --opencode
- Cursor hooks are global-only. Use: rtk init -g --agent…
- Cursor uninstall only works with --global flag
AI-assisted analysis of rtk-ai/rtk@0924356b4c (2026-09-19).
Data as JSON: /api/errors/0d9fc693bac47359.
Report an issue: GitHub.
Appendix: source
Thrown at src/hooks/init.rs:6204
fn resolve_vibe_dir() -> Result<PathBuf> {
resolve_home_subdir(VIBE_DIR)
}
/// Entry point for `rtk init -g --agent vibe`.
///
/// Installs a `pre_tool` hook into `~/.vibe/hooks.toml` (Vibe CLI's hook
/// registry, see https://docs.mistral.ai/vibe/code/cli/hooks) that routes
/// bash tool calls through the native `rtk hook vibe` binary. When not
/// `hook_only`, also drops an `~/.vibe/prompts/rtk.md` system prompt file
/// as a belt-and-suspenders fallback if the hook is disabled.
pub fn run_vibe_mode(
global: bool,
hook_only: bool,
patch_mode: PatchMode,
ctx: InitContext,
) -> Result<()> {
if !global {
anyhow::bail!("Vibe support is global-only. Use: rtk init -g --agent vibe");
}
let vibe_dir = resolve_vibe_dir()?;
run_vibe_mode_at(&vibe_dir, hook_only, patch_mode, ctx)
}
fn run_vibe_mode_at(
vibe_dir: &Path,
hook_only: bool,
patch_mode: PatchMode,
ctx: InitContext,
) -> Result<()> {
let InitContext { dry_run, .. } = ctx;
if !dry_run {
fs::create_dir_all(vibe_dir)
.with_context(|| format!("Failed to create Vibe config dir: {}", vibe_dir.display()))?;
}
let hooks_path = vibe_dir.join(VIBE_HOOKS_FILE);View on GitHub (pinned to 0924356b4c)