zarldev/zarlmono

mono repo

12

stars

166

commits

Go

primary language

Sep 6, 2026

updated

README

zarlmono

The Go-native agent monorepo — zarlcode / zkit

ci Go 1.27 license MIT docs

zarlcode in action


What's here

AssetModuleWhat it does
zarlcodezarlcode/Terminal coding-agent TUI/CLI — plan, build, switch models, resume sessions, inspect diffs, verify.
zkitzkit/The Go agent substrate: streaming runner, tool registry, LLM providers, guardrails, compaction, MCP, sandboxing, vault.
swebench-evalswebench-eval/SWE-bench evaluation driver on the same coding-agent assembly.
examplesexamples/Deterministic harnesses that isolate individual patterns, runnable with no LLM.

Try zarlcode

# Homebrew
brew install zarldev/tap/zarlcode

# or build from source
cd zarlmono && go tool task zarlcode

# first run
zarlcode init
zarlcode keys set anthropic "$ANTHROPIC_API_KEY"
zarlcode
zarlcode                               # interactive TUI
zarlcode -continue                     # resume the last session
zarlcode --headless --prompt-file t.md # one-shot for scripts/CI
zarlcode keys list                     # show provider keys (masked)
zarlcode upgrade                       # self-update from GitHub Releases

Supported providers: Anthropic, OpenAI, DeepSeek, Gemini, Vertex AI, llama.cpp, Ollama, plus OAuth-backed Claude Code and OpenAI Codex surfaces.

[!NOTE] zarlcode configures model endpoints but doesn't start model servers. Run Ollama, llama.cpp, LM Studio, or another OpenAI-compatible server yourself for local inference.


At a glance

ModeToolsUse case
PlanRead-onlyInvestigate the codebase, propose a strategy — no edits, no shell.
BuildFull tool surfaceRead, edit, patch, bash, web, MCP, plans, sub-agents — subject to guardrails.

The TUI streams everything live: model output, tool calls, command results, diffs, plan state, and the file-change log. Sessions persist locally — zarlcode -continue picks up right where you left off.

See the interface tour


Use zkit in your own Go app

go get github.com/zarldev/zarlmono/zkit@latest

A minimal agent is just a provider, a tool registry, and the runner:

package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/zarldev/zarlmono/zkit/agent/runner"
	"github.com/zarldev/zarlmono/zkit/ai/llm/anthropic"
	"github.com/zarldev/zarlmono/zkit/ai/tools"
)

type weatherArgs struct {
	City string `json:"city" doc:"City to report the weather for"`
}

type weather struct{}

func (weather) Definition() tools.ToolSpec {
	return tools.ToolSpec{
		Name:        "weather",
		Description: "Report the weather for a city.",
		Parameters:  tools.SchemaFor[weatherArgs](),
	}
}

func (weather) Execute(_ context.Context, call tools.ToolCall) (*tools.ToolResult, error) {
	args, err := tools.DecodeArgs[weatherArgs](call.Arguments)
	if err != nil {
		return tools.Failure(call.ID, err), nil
	}
	return tools.Success(call.ID, args.City+": sunny, 21C"), nil
}

func main() {
	prov, err := anthropic.NewProvider(os.Getenv("ANTHROPIC_API_KEY"))
	if err != nil {
		log.Fatal(err)
	}

	r := runner.New(runner.ClientFromProvider(prov),
		runner.WithTools(tools.NewRegistry(weather{})),
		runner.WithMaxIterations(8),
	)

	res := r.Run(context.Background(), runner.TaskSpec{Prompt: "What is the weather in Oslo?"})
	if res.Err != nil {
		log.Fatal(res.Err)
	}
	fmt.Println(res.FinalContent)
}

Swap anthropic for openai, gemini, deepseek, ollama, or llamacpp — the runner stays the same. To run without a key or network:

go run -C examples ./shared_infra
go run -C examples ./releasegate -scripted

Add guardrails, compaction, sandboxing, retrieval, and verified completion as options when you need them.


zkit building blocks

LayerPackageDocs
Runnerzkit/agent/runnerStreaming tool-calling loop
Toolszkit/ai/toolsRegistry, schemas, effects, MCP
Guardrailszkit/agent/guardrailsSchema repair, shell policy, caps, verifier feedback
Compactionzkit/agent/compactKeeping long sessions inside context
MCPzkit/mcpModel Context Protocol client/server
Vaultzkit/vaultEncrypted credential storage
Vector storezkit/vectorstoreEmbedding + retrieval
Docstorezkit/docstoreDocument storage layer
zhttpzkit/zhttpHTTP client foundation

Architecture overview →


Repository layout

zarlcode/       --- Coding-agent TUI & CLI
zkit/           --- Reusable agent libraries
swebench-eval/  --- SWE-bench evaluation driver
examples/       --- Deterministic harnesses & patterns
site/           --- Astro/Starlight docs site
docker/         --- Container setup for eval runs
dist/           --- Release artifacts

Build & test

go tool task check          # build -> vet -> test (examples, zkit, zarlcode, swebench-eval)
go tool task lint           # golangci-lint across CI-covered modules
go tool task race           # zkit race-detector suite
go tool task zarlcode              # build+install to ~/.local/bin
zarlcode

go run ./zarlcode/cmd              # run from source
go run ./zarlcode/cmd -continue    # resume last session

Trust boundaries

zarlcode and zkit code tools can execute processes, mutate files, fetch web pages, connect to MCP servers, and call external LLM APIs. Guardrails and sandboxing reduce risk but don't turn your user account into a disposable sandbox. Review tool calls when using powerful models or unfamiliar workspaces.


Community


MIT — LICENSE

Contributors

zarldev

166 commits

zarldev/zarlmono

mono repo

12

stars

166

commits

Go

primary language

Sep 6, 2026

updated

README

zarlmono

The Go-native agent monorepo — zarlcode / zkit

ci Go 1.27 license MIT docs

zarlcode in action


What's here

AssetModuleWhat it does
zarlcodezarlcode/Terminal coding-agent TUI/CLI — plan, build, switch models, resume sessions, inspect diffs, verify.
zkitzkit/The Go agent substrate: streaming runner, tool registry, LLM providers, guardrails, compaction, MCP, sandboxing, vault.
swebench-evalswebench-eval/SWE-bench evaluation driver on the same coding-agent assembly.
examplesexamples/Deterministic harnesses that isolate individual patterns, runnable with no LLM.

Try zarlcode

# Homebrew
brew install zarldev/tap/zarlcode

# or build from source
cd zarlmono && go tool task zarlcode

# first run
zarlcode init
zarlcode keys set anthropic "$ANTHROPIC_API_KEY"
zarlcode
zarlcode                               # interactive TUI
zarlcode -continue                     # resume the last session
zarlcode --headless --prompt-file t.md # one-shot for scripts/CI
zarlcode keys list                     # show provider keys (masked)
zarlcode upgrade                       # self-update from GitHub Releases

Supported providers: Anthropic, OpenAI, DeepSeek, Gemini, Vertex AI, llama.cpp, Ollama, plus OAuth-backed Claude Code and OpenAI Codex surfaces.

[!NOTE] zarlcode configures model endpoints but doesn't start model servers. Run Ollama, llama.cpp, LM Studio, or another OpenAI-compatible server yourself for local inference.


At a glance

ModeToolsUse case
PlanRead-onlyInvestigate the codebase, propose a strategy — no edits, no shell.
BuildFull tool surfaceRead, edit, patch, bash, web, MCP, plans, sub-agents — subject to guardrails.

The TUI streams everything live: model output, tool calls, command results, diffs, plan state, and the file-change log. Sessions persist locally — zarlcode -continue picks up right where you left off.

See the interface tour


Use zkit in your own Go app

go get github.com/zarldev/zarlmono/zkit@latest

A minimal agent is just a provider, a tool registry, and the runner:

package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/zarldev/zarlmono/zkit/agent/runner"
	"github.com/zarldev/zarlmono/zkit/ai/llm/anthropic"
	"github.com/zarldev/zarlmono/zkit/ai/tools"
)

type weatherArgs struct {
	City string `json:"city" doc:"City to report the weather for"`
}

type weather struct{}

func (weather) Definition() tools.ToolSpec {
	return tools.ToolSpec{
		Name:        "weather",
		Description: "Report the weather for a city.",
		Parameters:  tools.SchemaFor[weatherArgs](),
	}
}

func (weather) Execute(_ context.Context, call tools.ToolCall) (*tools.ToolResult, error) {
	args, err := tools.DecodeArgs[weatherArgs](call.Arguments)
	if err != nil {
		return tools.Failure(call.ID, err), nil
	}
	return tools.Success(call.ID, args.City+": sunny, 21C"), nil
}

func main() {
	prov, err := anthropic.NewProvider(os.Getenv("ANTHROPIC_API_KEY"))
	if err != nil {
		log.Fatal(err)
	}

	r := runner.New(runner.ClientFromProvider(prov),
		runner.WithTools(tools.NewRegistry(weather{})),
		runner.WithMaxIterations(8),
	)

	res := r.Run(context.Background(), runner.TaskSpec{Prompt: "What is the weather in Oslo?"})
	if res.Err != nil {
		log.Fatal(res.Err)
	}
	fmt.Println(res.FinalContent)
}

Swap anthropic for openai, gemini, deepseek, ollama, or llamacpp — the runner stays the same. To run without a key or network:

go run -C examples ./shared_infra
go run -C examples ./releasegate -scripted

Add guardrails, compaction, sandboxing, retrieval, and verified completion as options when you need them.


zkit building blocks

LayerPackageDocs
Runnerzkit/agent/runnerStreaming tool-calling loop
Toolszkit/ai/toolsRegistry, schemas, effects, MCP
Guardrailszkit/agent/guardrailsSchema repair, shell policy, caps, verifier feedback
Compactionzkit/agent/compactKeeping long sessions inside context
MCPzkit/mcpModel Context Protocol client/server
Vaultzkit/vaultEncrypted credential storage
Vector storezkit/vectorstoreEmbedding + retrieval
Docstorezkit/docstoreDocument storage layer
zhttpzkit/zhttpHTTP client foundation

Architecture overview →


Repository layout

zarlcode/       --- Coding-agent TUI & CLI
zkit/           --- Reusable agent libraries
swebench-eval/  --- SWE-bench evaluation driver
examples/       --- Deterministic harnesses & patterns
site/           --- Astro/Starlight docs site
docker/         --- Container setup for eval runs
dist/           --- Release artifacts

Build & test

go tool task check          # build -> vet -> test (examples, zkit, zarlcode, swebench-eval)
go tool task lint           # golangci-lint across CI-covered modules
go tool task race           # zkit race-detector suite
go tool task zarlcode              # build+install to ~/.local/bin
zarlcode

go run ./zarlcode/cmd              # run from source
go run ./zarlcode/cmd -continue    # resume last session

Trust boundaries

zarlcode and zkit code tools can execute processes, mutate files, fetch web pages, connect to MCP servers, and call external LLM APIs. Guardrails and sandboxing reduce risk but don't turn your user account into a disposable sandbox. Review tool calls when using powerful models or unfamiliar workspaces.


Community


MIT — LICENSE

See what people are saying

Contributors

zarldev

166 commits

Languages

Go

99.3%