Run an Autonomous AI Agent Right in Your Terminal with Zero
I often catch myself exhausted from constantly switching between the IDE window, browser, and terminal just to make edits based on neural network suggestions. Most ready-made solutions are either tied to a specific paid subscription or require handing over your entire project to third-party servers without clear control over what exactly gets sent to the cloud. I recently discovered an interesting project called Zero by the Gitlawb team. It's a terminal-based coding agent written in Go that runs directly on your machine with the models of your choice.
No vendor lock-in. Want to connect a local Ollama or LM Studio for complete privacy — go ahead. Need to throw a complex refactoring task at Claude 3.5 Sonnet, DeepSeek, or Gemini — just add your API key and you're good to go.
What the agent can do and how it differs from alternatives
Zero is designed as a tool for developers who value control. The agent doesn't just generate text snippets in a chat — it can explore codebases, edit files, run tests, and execute terminal commands.
The main difference lies in its approach to security and access control. By default, the agent can read files in the working directory, but any attempts to write outside the project, execute dangerous shell commands, or access the network hit a permission system.
The utility works in two modes:
- Interactive TUI with theme support, on-the-fly model switching, diff viewing, and conversation branch navigation.
- Automatic mode via the
zero execcommand, which can be embedded in bash scripts or CI pipelines.
All sessions are stored locally on disk. You can stop work at any time, return to an old task via /resume, or create an isolated branch of a session with the /btw command to ask a side question without cluttering the main dialogue context.
Installation and first launch
Zero can be installed in several ways. The easiest is using npm or the official installation script.
Via npm:
npm install -g @gitlawb/zero
zero
Or via the installation script for Linux and macOS:
curl -fsSL https://raw.githubusercontent.com/Gitlawb/zero/main/scripts/install.sh | bash
To build from source, you'll need Go version 1.26.5 or newer:
git clone https://github.com/Gitlawb/zero.git
cd zero
go build -o zero ./cmd/zero
On first launch, the zero command runs an interactive setup wizard. It helps you select a model provider and verify the connection. If you're using cloud APIs, just export the required key beforehand:
export ANTHROPIC_API_KEY="sk-ant-..."
# или
export OPENAI_API_KEY="sk-..."
For local models, the utility can automatically detect running Ollama instances via the zero providers detect command.
Everyday usage scenarios
The terminal interface is responsive and convenient. The TUI provides hotkeys and slash commands. For example, permission cycling is done through Shift+Tab, and model selection is called with the /model command.
/spec — составить и обсудить план изменений до правок кода
/image — прикрепить скриншот интерфейса или схемы
/compact — сжать контекст, если диалог стал слишком длинным
/add-dir — выдать агенту временные права на запись в соседнюю папку
If a graphical interface isn't needed, the headless mode comes to the rescue. Say, autotests failed in one of your Go packages:
zero exec "fix the failing test in ./pkg"
For complex tasks, it's convenient to use isolated git worktrees so the agent doesn't touch your working branch until you've reviewed the result:
zero exec --worktree "try the migration in an isolated worktree"
Zero also supports streaming output in JSONL format via the --output-format stream-json flag, which simplifies writing wrappers and integrating with external services.
Extensibility via MCP, plugins, and specs
For fine-tuning project behavior, Zero reads instruction files AGENTS.md or ZERO.md directly from the repository. If you place such a file in the project root, the agent will take into account your team's coding standards, directory structure, and commit formatting rules.
If the built-in tools aren't enough, the project supports:
- The MCP (Model Context Protocol) for connecting external databases or third-party services.
- Plugins with hooks for session start or action execution events (
beforeTool,afterTool). - Custom markdown skills that add specific automation scenarios.
Who will benefit from Zero
The tool will appeal to developers who frequently work on remote servers via SSH, love terminal utilities, and don't want to depend on proprietary editor plugins. The strict Linux seccomp-based sandbox and local session history make Zero an excellent choice for working with closed corporate code.
You can try the project on any platform — documentation and source code are open under the MIT license on the repository page.
Projets similaires