minicode is a minimal local coding agent written in Zig. It runs in a full-screen terminal UI, chats with a local Ollama model, streams responses, and lets the model request a small set of file and shell tools through JSON tool calls.
brew install nicolaric/tap/minicodeSee Prerequisites and Build and run sections below.
- Zig 0.15.x
- Ollama
curlavailable onPATH- macOS or Linux terminal
Windows is not currently documented as a supported platform.
Install Ollama from https://ollama.com/download, then start the service:
ollama serveIn another terminal, pull the default coding model:
ollama pull qwen3.6:27b-coding-nvfp4By default, minicode connects to:
OLLAMA_BASE_URL=http://127.0.0.1:11434
If no model is configured explicitly, minicode asks Ollama for locally available models and uses the first one returned. The built-in fallback model is qwen3.6:27b-coding-nvfp4.
Override them when needed:
OLLAMA_BASE_URL=http://127.0.0.1:11434 OLLAMA_MODEL=qwen3.6:27b-coding-nvfp4 zig build runYou can also set defaults in ~/.config/minicode/config.json:
{
"model": "qwen3.6:27b-coding-nvfp4",
"base_url": "http://127.0.0.1:11434",
"thinking_level": "off",
"num_ctx": 8192
}Supported config keys:
base_urlorollama_base_url: Ollama endpoint.model,default_model, orollama_model: model name to use.thinking_level: one ofoff,minimal,low,medium,high, orxhigh. Any unknown value falls back tooff.num_ctx: optional Ollama context window size.
Environment variables take precedence over the config file:
OLLAMA_BASE_URL: Ollama endpoint.OLLAMA_MODEL: model name to use.NIC_THINKING_LEVEL: thinking level (off,minimal,low,medium,high, orxhigh).OLLAMA_NUM_CTX: optional Ollama context window size.
Syntax highlighting is enabled by default for rendered code blocks and diffs.
Build the executable:
zig buildRun from source:
zig build runAfter building, the installed executable is available at:
./zig-out/bin/minicodeminicode opens a full-screen alternate terminal UI. The input line is at the bottom of the screen.
Enter: send the current message/exitor/quit: exit/model: open a local Ollama model picker/thinking: open the thinking-level picker/new: clear the current conversation and start over/: open the command palette when the input is emptyCtrl+C: exit while idle; cancel the current stream/tool turn while busyEsc: cancel while busyUp/Down: scroll the transcriptPageUp/PageDown: scroll by a pageCtrl+U/Ctrl+D: scroll by a half pageCtrl+E: expand or collapse long shell output blocksLeft/Right: move the input cursorOption+Left/Option+Right: move the input cursor by word in many terminalsBackspace: delete the character before the cursorDelete: delete the character under the cursor
While the agent is busy streaming, new messages are not submitted. Draft input is kept and can be sent after the busy turn finishes or is cancelled.
The model can request tools by replying with JSON such as:
{"tool":"read_file","args":{"path":"src/main.zig"}}Supported tools:
read_file(path, offset?, limit?): read numbered file lines.offsetdefaults to line 1;limitdefaults to 300 and is capped at 300.write_file(path, content): create or overwrite a file. Overwriting an existing file requires confirmation and reports a diff.list_files(path?): list directory contents.pathdefaults to the current directory.run_shell(command): run a shell command after confirmation.glob(pattern, path?): list files matching a glob pattern, optionally frompath.grep(pattern, path?, include?, case_sensitive?, context?): search file contents. Matching is case-insensitive by default and supports basic regex features such as., character classes, anchors, and*,+,?; results are capped at 20 matches.edit(path, oldString, newString): replace a unique text match in a file and report a diff.
- File paths must be relative and stay inside the current working directory.
- Absolute paths and parent-directory traversal (
..) are rejected. - Shell commands require confirmation before running.
- Overwriting existing files requires confirmation.
- Invalid tool JSON, unknown tools, invalid arguments, and invalid paths return tool errors instead of being executed.
- Tool calls and results are logged locally to
~/Library/Logs/minicode/tool-calls.logon macOS, or to$XDG_STATE_HOME/minicode/logs/tool-calls.log/~/.local/state/minicode/logs/tool-calls.logon Linux. Avoid asking the agent to read, print, or operate on secrets unless you are comfortable with those values appearing in local logs.
- Ollama is not running: start it with
ollama serve, then runzig build runagain. - Model missing or unavailable: pull the default model with
ollama pull qwen3.6:27b-coding-nvfp4, or setOLLAMA_MODELto a model that exists locally. - Custom Ollama endpoint fails: check
OLLAMA_BASE_URLand confirm the endpoint exposes Ollama's/api/chatAPI. curlis missing: installcurland ensure it is available onPATH; streaming uses thecurlcommand.- Terminal display or input issues: use a macOS or Linux terminal with alternate-screen and ANSI escape support, then restart the app to restore terminal state if needed.