Usage
# Build the code map once, then propose an edit (prints a diff, writes nothing)
vg build
vg code "add a --timeout flag to the scan command"
# Guided interactive mode (needs a terminal)
vg code
# Write the change — still needs --yes or an interactive confirm
vg code "rename getUser to fetchUser across the api package" --apply --yes
What It Does
VG Code proposes a minimal code edit for an instruction you write in plain language. The edit is grounded in the deterministic code map from vg build, so the model works from the real symbols and files in your project, not a guess from a filename. It is a capability of the Vibgrate CLI, not a separate product.
vg code is dry-run by default: it prints the proposed diff and writes nothing. Writing is opt-in — --apply still requires --yes or an interactive y/N confirm, and an --apply without consent degrades to a dry-run. Every write walks the same inspect → assess → approve → execute → verify → log lifecycle as the rest of the platform; there is no quick-apply back-door.
Bring Your Own Model
No model is bundled and nothing is installed by default. vg code picks a backend only from what you have already configured — a hosted key such as OPENROUTER_API_KEY, or a model you have pulled locally with Ollama or LM Studio. Choose one explicitly with --provider (ollama, lmstudio, openrouter, litellm, openai, together, llama-cpp) and set the model with --model or VG_CODE_MODEL. Under --local, only on-device backends are eligible — it never reaches the network. The only path that installs a package, --provider llama-cpp, does so once, on first use, and only with --yes.
The Agent, and One-Shot Mode
With a real model, vg code runs a multi-step agent that approves each edit and command as it goes — run it in a terminal to approve interactively, or pass --auto to run autonomously. Use --single for a one-shot planner that proposes a single edit instead. --verify [command] runs your test command after the agent finishes and feeds failures back for a fix; --continue resumes the most recent session.
Configure Once
Set your model and preferences in .vibgrate/code.json (provider, model, testCommand, maxSteps, denyCommands, mcpServers) so you can just run vg code. Flags win over the file, and the file wins over the built-in defaults. vg code also adopts the ecosystem-standard MCP config files (.mcp.json, .cursor/mcp.json, .vscode/mcp.json) so the agent can call external tools, approval-gated like any other action.
Exit Codes
0 success (a dry-run, or an applied change that verified), 1 agent or operational error, 2 an --apply that did not apply or failed to verify — so CI and host UIs can branch on the result.