Get zelk
zelk has no release yet, so you take it from the repository, at a commit you
choose. This page covers both ways of using it: the Go library in your own
module, and the zelk command.
What you need
Section titled “What you need”- Go 1.26 or newer.
go versiontells you which one you have. The modules declare Go 1.26.0 as their minimum; the repository’sgo.workrecommends Go 1.26.11 or newer, which carries the standard library fixes its vulnerability check requires. - Linux, macOS or Windows, on amd64 or arm64. Commands run in
/bin/bash; on Windows, in PowerShell and in the Bash of Git for Windows, whichever are installed (below). - Git, to fetch the source. zelk also works best in a Git repository: it shows the branch, reviews diffs and makes worktrees.
- A model. An API key for OpenAI, Anthropic, Gemini or OpenCode, a ChatGPT plan, any OpenAI-compatible server (OpenRouter, vLLM, …), or a model running on your own machine under Ollama, LM Studio or llama.cpp (below).
Some tools are optional and only widen what the agent can do:
bwrap(bubblewrap) on Linux, to confine commands with-sandbox bwrap, andsandbox-exec, which macOS ships, for-sandbox seatbelt. On Windows 11,zelk sandbox setupinstalls MXC (below). Without a launcher commands run unconfined; Sandboxing and enforcement says what each one enforces.- ripgrep (
rg) on yourPATH: theGreptool uses it when it is there and searches with Go’s own engine otherwise. - Chrome, for the agent’s headless browser:
zelk browser setupinstalls one.
Use the Go library
Section titled “Use the Go library”The library is the module github.com/barevoidco/zelk/core, and its root
package is zelk. With no release tagged yet, go get takes a branch or a
commit and records it in your go.mod as a pseudo-version, which is the pin:
mkdir hello && cd hellogo mod init example.com/hellogo get github.com/barevoidco/zelk/core@main # or @<commit> to pin onego.mod lists core as // indirect until your program imports it and you
run go mod tidy, which drops the comment; that is expected.
To update, run go get github.com/barevoidco/zelk/core@main again; to go
back, go get the commit you were on. The change shows in go.mod and
go.sum like any dependency’s.
From a clone
Section titled “From a clone”Work from a clone instead when you want to read or change zelk’s source
beside your program, or to use an adapter: adapters/otel reaches core
through a replace directive until the first release, and Go ignores a
dependency’s replace, so the adapter builds only against a checkout.
Clone the repository beside your program:
git clone https://github.com/barevoidco/zelkgit -C zelk checkout <commit> # the commit you pin; skip it to follow mainThen use either of two wirings, whichever suits the project.
A replace directive records the checkout in your go.mod, so everyone
who builds the module needs the clone at the same relative path:
mkdir hello && cd hellogo mod init example.com/hellogo mod edit -replace github.com/barevoidco/zelk/core=../zelk/corego mod tidyA Go workspace keeps the checkout out of the module’s files, which suits
a program you share: the go.work file stays local and go.mod is clean.
mkdir hello && cd hellogo mod init example.com/hellogo work init . ../zelk/coreWith a workspace, build with go build and don’t run go mod tidy: tidy
ignores go.work, so it fetches core from the network and writes a
pseudo-version into go.mod, which is the pin the workspace avoids.
The Go quickstart builds a first program from there.
To update a clone, check out another commit (git -C zelk pull
follows main) and build again; with replace or a workspace, nothing in
your module changes. To pin, the commit you checked out is the pin:
write it where your team will see it, such as the module’s README or a
Makefile target that checks the clone out.
Adapters that bring heavy dependencies are modules of their own in the same
clone. The OpenTelemetry adapter, github.com/barevoidco/zelk/adapters/otel,
joins the same way: add ../zelk/adapters/otel to go work use, or a second
replace in go.mod. The adapter’s own replace of core isn’t honored from
your module, so your module still needs one for core.
Build the command
Section titled “Build the command”zelk is one static binary with no cgo. Build it from the cmd/zelk module
of the clone and put it on your PATH:
git clone https://github.com/barevoidco/zelkcd zelkgit checkout <commit> # the commit you pin; skip it to follow maincd cmd/zelkmkdir -p ~/.local/bingo build -o ~/.local/bin/zelk .The first build downloads the module’s dependencies, so it needs network access, and compiles a large dependency tree, so it takes a while on a cold cache; the binary is around 55 MB. Later builds reuse the cache.
Put ~/.local/bin on your PATH if it isn’t there, and check that your
shell finds it:
zelk -versionIt prints the harness version and, for a build from a clone, the commit and
whether the checkout had uncommitted changes, such as
zelk/0.0.0-dev (abc1234, modified): check that the commit is the one you
pinned. A binary built outside a checkout prints the version alone.
go install github.com/barevoidco/zelk/cmd/zelk@version doesn’t work yet. The
module builds against local copies of core, the OpenTelemetry adapter and one
dependency, through replace directives, and go install refuses a module
that has them. Build from a clone as above. For a script or CI job, pin the
commit as above, so a run builds the same zelk every time.
To update, check out the commit you want, git pull for main, and build
again. A newer build may refuse a session an older one wrote, since the log’s
format changes freely before the first release; zelk never deletes a log it
can’t read. On Windows, build and PATH
differ a little (below).
Then give it a model, and continue with the scripting quickstart or the terminal UI.
Windows
Section titled “Windows”Run zelk in Windows Terminal or the classic Windows console to open
the terminal UI. It opens from PowerShell or from Git Bash in Windows
Terminal. Redirecting standard input or output selects print mode, as does
running from Git Bash in mintty. Use zelk -p for explicit print mode
or zelk exec for headless sessions.
git clone https://github.com/barevoidco/zelkcd zelk\cmd\zelkgo build -o "$env:LOCALAPPDATA\Programs\zelk\zelk.exe" .# once: put that folder on your PATH[Environment]::SetEnvironmentVariable('Path', "$([Environment]::GetEnvironmentVariable('Path','User'));$env:LOCALAPPDATA\Programs\zelk", 'User')Open a new terminal after the PATH change; a terminal that is already open
keeps the old one.
- PowerShell is the primary shell. zelk gives the agent a PowerShell
tool, running PowerShell 7 (
pwsh.exe) when it’s installed and otherwise the Windows PowerShell 5.1 every Windows has, and tells the model it is the shell of this machine. zelk reads a PowerShell command, with PowerShell’s own parser, as it reads a Bash one: aliases count as the cmdlets they stand for, rules such asPowerShell(Get-ChildItem *)allow what they name, and read-only cmdlets run without asking. What it can’t read, such as code built at run time, a child shell orStart-Process, asks first, or in auto mode goes to the reviewer.-powershell C:\path\to\pwsh.exenames a different PowerShell. A PowerShell 7 installed from the Microsoft Store is found too: it is on yourPATHonly as an app execution alias, a stub in a folder you can write, so zelk reads the alias without running it and uses theMicrosoft.PowerShellpackage’spwsh.exeit names, and refuses an alias that leads anywhere else. Windows PowerShell 5.1 writes>redirections as UTF-8 with a byte order mark where PowerShell 7 writes none, and the model is told which edition it has. - Git for Windows is recommended, for Bash. Outside MXC, when zelk finds
Git Bash, the agent has a Bash tool too, which the model is told is for POSIX scripts and
tools. The two shells share the working directory: a
cdin one is where the next command of the other starts.-verifychecks and theWatchtool run in Bash when it is there, as Claude Code’s do, so write them for Bash; without Git for Windows they run in PowerShell. A skill’s!`command`lines run in Bash too, or in PowerShell without it. Hooks and the status line run in itsbash.exetoo, and zelk’s own git inspections (review, diffs, the session’s git context) run itsgit.exe. zelk finds the install fromPATHand the usual folders (%ProgramFiles%\Git,%LocalAppData%\Programs\Git). It never uses abash.exeinside the workspace or the one inC:\Windows\System32, which starts WSL.-bash C:\path\to\bash.exe(orbashin your saved settings) names a different install, and then the agent has Bash alone. - Without Git for Windows, commands run in PowerShell alone. PowerShell
hooks and custom status line commands run there too. The
/statuslinescript generator uses Bash. - To run Bash alone, run outside MXC and give
-no-powershell, or savepowershell: falsein your settings (settings reference). That needs Git for Windows. If no shell is found, zelk says where it looked for each. - To run PowerShell alone where Git for Windows is installed, deny Bash
outright:
-deny Bash, or aBashdeny rule in your settings. As in Claude Code, the agent is then not offered Bash at all, andWatchand-verifychecks run in PowerShell. Hooks keep running in Bash unless a hook says"shell": "powershell". - Native command sandbox. On Windows 11 (tested on 26H2, build 26300.9974, with
MXC 1.1.0), run
zelk sandbox setupand review the telemetry notice. Select-sandbox mxcor save"sandbox": "mxc"in your settings. Unattended auto mode uses MXC when the verified install and agreement are present and MXC works. Other sessions usenoneby default unless managed policy requires a sandbox. Runzelk sandbox setup -verifyto check the install. Under MXC, zelk uses an unpackaged PowerShell or Windows PowerShell 5.1 for commands, Verify, Watch and session hooks with no shell choice. Startup rejects Bash overrides, disabling PowerShell and trusted session hooks that request Bash. To use Bash, select-sandbox nonewhere policy permits it. Sandboxing and enforcement · MXC issue #1061 - Language servers and MCP. zelk can find language servers on PATH,
including
.cmdshims for TypeScript and Pyright. A stdio MCP server can use a name such asnpxin its configuration. - Paths are shown to the model, and written in sessions, with forward
slashes and the drive:
C:/work/proj. - Where things are. Sessions and other state are in
%LOCALAPPDATA%\zelk, and configuration (config.json,hooks.json,mcp.jsonand the rest) in%APPDATA%\zelk. Wherever these pages say~/.local/state/zelkor~/.config/zelk, those are the Windows places;-state,XDG_STATE_HOMEandXDG_CONFIG_HOMEstill override them. - What zelk keeps is private to you. Unix gets that from file modes; on
Windows the modes mean nothing, so zelk creates every directory and file
of its own (sessions and their pointers,
config.json,mcp.json, provider profiles, prompt history and the TUI’s settings) with an ACL that names only your account, from the moment it exists, wherever-stateor the configuration directory is. A folder someone else’s inherited access would have opened, such as one on a shared drive that grants Users read, doesn’t matter for what zelk makes there. It does matter for a state directory that already exists: if others can change it, or files made in it would inherit their access, zelk refuses to start and says who. An MCP configuration or provider profile file that others can read is refused too, naming the file and the group that grants access;icacls FILE /inheritance:r /grant:r "%USERNAME%:F"leaves it to you alone. - Worktrees work as on other systems (worktrees):
-worktree,EnterWorktreeandExitWorktree, subagents that isolate in one, andWorktreeCreatehooks, in Bash or PowerShell as the hook says. They need Git for Windows’git.exe. A worktree’s name is a directory name, so Windows names are refused (con,nul,com1,aux.txt), and so are two names that differ only in case, which NTFS keeps in one directory. - The Windows Credential Manager keeps your sign-ins and keys when you
ask for it:
-credential-store keychain, andzelk credentials move -to keychainfor what is in files already (credentials). Documents of any size work, and the credentials stay on this computer. - Local sockets work for ACP listen and relay and the durable background process supervisor. Use a private NTFS directory and a short socket path.
- Recorded skill caches work with
-sandbox mxcand a private NTFS directory. See scripts in skills. - Grep uses
rg.exewhen installed on your PATH and uses Go when it is unavailable. MXC also grants the executable read-only to commands.
For zelk’s own headless browser (-browser), run zelk browser setup.
To connect your existing Chromium browser on Windows (-user-browser), run
zelk browser extension and zelk browser native-messaging, load the
unpacked extension, then run zelk browser pair. If you run zelk inside
WSL2, generate the extension there and use the printed Windows path.
See the browser setup instructions.
Telemetry
Section titled “Telemetry”Microsoft’s MXC executor sends Required telemetry to Microsoft only on
Windows when zelk runs commands in the mxc sandbox. zelk itself sends
nothing. Linux (bwrap), macOS (seatbelt) and Windows with -sandbox none
send no MXC telemetry.
MXC.ExecutionStartandMXC.ExecutionEndreport the sandbox kind, backend, denial-capture mode, exit code, outcome, duration, failure reason and phase.MXC.Errorreports the sandbox kind, backend, error type, exit code and phase.MXC.ProcessExitedreports an opaque process identity, process ID and exit code.
Each event includes a random session ID, version, release channel and privacy tags. Microsoft documents that these events exclude command lines, environment values, complete file paths, account names, tokens and sandbox output.
zelk, Windows settings and administrator policy cannot turn this telemetry
off. To avoid it, run without the mxc sandbox. Setup shows this notice and
requires agreement before downloading or running the executor. The first
sandboxed session also shows a reminder once per state directory.
Microsoft’s MXC telemetry documentation · Microsoft Privacy Statement
Give it a model
Section titled “Give it a model”The terminal UI asks for a provider the first time it starts, and keeps
what you enter (the terminal UI quickstart). Print mode and
zelk exec read the provider from flags and environment variables instead
(the scripting quickstart). A Go program passes its provider
in code, as the Go quickstart shows; zelk.Run alone reads
OPENAI_API_KEY and OPENAI_BASE_URL.
| Provider | Flag | Key variable | Base URL variable |
|---|---|---|---|
| Any OpenAI-compatible server (the default) | -provider openai-compat |
OPENAI_API_KEY |
OPENAI_BASE_URL |
| OpenAI’s Responses API | -provider openai |
OPENAI_API_KEY |
OPENAI_BASE_URL |
| Anthropic | -provider anthropic |
ANTHROPIC_API_KEY |
ANTHROPIC_BASE_URL |
| Gemini | -provider gemini |
GEMINI_API_KEY |
GEMINI_BASE_URL |
| OpenCode (Zen and Go) | -provider opencode |
OPENCODE_API_KEY |
|
| A ChatGPT plan | -provider chatgpt |
none: run zelk providers login chatgpt |
|
| Ollama, LM Studio, llama.cpp | -provider ollama, lmstudio, llamacpp |
none needed | -base-url, or OLLAMA_HOST |
Without a base URL, zelk uses the vendor’s own. Name the model with
-model; a server on your machine has no default, so it always needs one.
export ANTHROPIC_API_KEY=…zelk -p -provider anthropic -model claude-sonnet-5-5 "What does this repository do?"$env:ANTHROPIC_API_KEY = '…'zelk -p -provider anthropic -model claude-sonnet-5-5 "What does this repository do?"Saved settings in ~/.config/zelk/config.json (%APPDATA%\zelk\config.json
on Windows) stand in for run options such as the sandbox and permission
rules, but not for the provider or the model: those come from flags,
variables and, in the terminal UI, its providers file. The
settings reference lists the keys.
At the first release
Section titled “At the first release”There are no versions yet, which is why this page pins a commit. At the first
release each module is tagged on its own, with its directory as the prefix
(core/vX.Y.Z, cmd/zelk/vX.Y.Z, adapters/otel/vX.Y.Z). The replace
directives go, your module can go get github.com/barevoidco/zelk/core@vX.Y.Z like
any other, and go install github.com/barevoidco/zelk/cmd/zelk@vX.Y.Z builds the
command.