agent-harness

module
v0.3.36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2026 License: Apache-2.0

README

Agent Harness

A clean-room, pattern-derived agent harness for building coding agents

Safe Testing Recommended: Agent Harness is a harness for AI coding tools that can modify files and execute commands. For the safest experience, test in a remote development environment such as GitHub Codespaces, Coder, or DevPod.

Go Docs CI

Install

The one-liner installs the binary into /usr/local/bin (override with --dir for a user-owned install). Platforms, prerequisites, and manual paths: Installation. To update, rerun the installer with the same installation directory; your settings and sessions stay in place. See Updating.

# Any Linux or macOS shell
curl -fsSL https://raw.githubusercontent.com/BA-CalderonMorales/agent-harness/main/scripts/install.sh | bash

# Termux (Android)
curl -fsSL https://raw.githubusercontent.com/BA-CalderonMorales/agent-harness/main/scripts/install-termux.sh | bash

# Or build from source (this repository)
go build -o build/agent-harness ./cmd/agent-harness

Quick Start

Boot the terminal UI, walk the tabs, and talk to a model. The startup wizard handles credentials once; the modes, settings, and the full command surface: Usage.

# From this repository
make build
./build/agent-harness

# local-first: the repository defaults to a llama.cpp server and a local GGUF:
#   ./scripts/ah-local.sh            # local server + TUI
#   ./build/agent-harness --diagnose # resolve config, check the endpoint

Remote providers work the same way — switch provider and model in the Settings tab or with env vars, then /login when a key is needed:

AH_PROVIDER=openrouter \
AH_MODEL=nvidia/nemotron-3-super-120b-a12b:free \
./build/agent-harness

Commands

Everything happens inside the TUI: four tabs (Home, Chat, Sessions, Settings) with vim-style navigation and a slash-command system for operations. /help lists every command in place; Ctrl+P opens the command palette.

Key controls

Key Purpose
1 - 4 / Tab Jump to a tab / cycle tabs
j k g G Scroll the active pane
i / Esc Enter / leave compose mode
h c Jump to Home / Chat
/ / Ctrl+P Slash suggestion / command palette
Ctrl+R Cycle reasoning effort
? Help overlay
Ctrl+C Clear the draft, then quit

Slash commands

Group Commands
Core /help /clear /compact /version /workspace
Session /status /session /steer
Model /model /current-model
Settings /config /permissions /login /logout
Git /branch /pr
Output /cost /export
Tools /agents /skills /audit /plan

Headless flags

agent-harness --diagnose   # resolve config, check model file + endpoint
agent-harness --version

Layout

The repository is a few small planes, and every Go domain is bucketed the same way — once you can read one, you can read them all.

cmd/agent-harness/           # the app: boot, command wiring, TUI delegates
internal/
├── agent/                   # the live agent loop (streaming executor)
├── core/                    # cross-cutting state
│   ├── audit/               # tool-activity ledger
│   ├── config/              # layered YAML + env + user settings
│   ├── persona/             # behavior modes
│   ├── planning/            # task planning
│   └── state/               # session model and persistence
├── interface/               # the public surfaces
│   ├── approval/            # command approval system
│   ├── commands/            # slash command registry
│   └── tui/                 # the terminal UI (Bubble Tea)
├── runtime/
│   ├── llm/                 # OpenAI-compatible client, SSE, probing
│   ├── permissions/         # permission stacking
│   ├── services/            # provider services
│   └── tools/               # tool registry and buckets
├── session/                 # session ledger + the modular loop buckets
└── ui/                      # line editor, stream rendering, screens
pkg/                         # shared types, messages, git, bash, sandbox

Each domain keeps one concept per file with a facade for its public surface, and tests mirror the sources beside them. Files target 400 lines or fewer and make verify measures that shape so it stays observable. Developers: Development docs.

Docs

Browse the whole folder from the docs index. What this is for, and how the loop moves a turn: Architecture.

Document What
Usage Tabs, controls, compose mode, slash commands
Installation Platforms, prerequisites, manual paths
Local models llama.cpp, GGUF download, overrides
Environment variables Every override, one table
Conversation flow How a turn moves through the app
Loop architecture The agent loop, buckets, naming
Command approval How commands get approved
Branch protection Release flow and branch rules
Supported models Provider/model matrix
Demo The recording, the mock server, making new demos

License

MIT

Directories

Path Synopsis
cmd
agent-harness command
Package main provides the entry point for agent-harness.
Package main provides the entry point for agent-harness.
Package e2e provides behavior-based testing harness for agent repositories
Package e2e provides behavior-based testing harness for agent repositories
internal
agent/core
Package agent provides the modular agent architecture.
Package agent provides the modular agent architecture.
agent/defaults
Package defaults provides centralized default configurations for agent buckets.
Package defaults provides centralized default configurations for agent buckets.
core/audit
Package audit provides append-only logging of tool executions and approvals for security review and accountability.
Package audit provides append-only logging of tool executions and approvals for security review and accountability.
core/config
Package config provides the modular configuration architecture.
Package config provides the modular configuration architecture.
core/diag
Package diag provides fail-silent diagnostics logging for errors that would otherwise vanish: recovered panics, swallowed persistence failures, dropped TUI messages.
Package diag provides fail-silent diagnostics logging for errors that would otherwise vanish: recovered panics, swallowed persistence failures, dropped TUI messages.
core/persona
Package persona defines functional personas that adapt agent behavior, system prompts, and security defaults to the user's current role.
Package persona defines functional personas that adapt agent behavior, system prompts, and security defaults to the user's current role.
core/state
Package state provides the modular state management architecture.
Package state provides the modular state management architecture.
interface/tui
Package tui provides the modular TUI architecture.
Package tui provides the modular TUI architecture.
interface/tui/themeinit
Package themeinit pins the terminal theme before any Bubble Tea program runs.
Package themeinit pins the terminal theme before any Bubble Tea program runs.
runtime/llm
Package llm provides the modular LLM provider architecture.
Package llm provides the modular LLM provider architecture.
runtime/permissions
Package permissions provides the modular permission architecture.
Package permissions provides the modular permission architecture.
runtime/permissions/defaults
Package defaults provides centralized default configurations for permission buckets.
Package defaults provides centralized default configurations for permission buckets.
runtime/services
Package services provides the modular service architecture.
Package services provides the modular service architecture.
runtime/tools
Package tools provides the modular tool architecture.
Package tools provides the modular tool architecture.
runtime/tools/defaults
Package defaults provides centralized default configurations for tool buckets.
Package defaults provides centralized default configurations for tool buckets.
session/contextmgr
Package contextmgr provides the modular context management architecture.
Package contextmgr provides the modular context management architecture.
session/loop
Package loop provides the modular agent loop architecture.
Package loop provides the modular agent loop architecture.
session/loop/buckets
Package buckets provides domain-specific LoopBase implementations.
Package buckets provides domain-specific LoopBase implementations.
session/loop/buckets/defaults
Package defaults provides hardcoded configuration values for all buckets.
Package defaults provides hardcoded configuration values for all buckets.
session/loop/setup
Package setup provides factory functions for creating orchestrators.
Package setup provides factory functions for creating orchestrators.
ui
pkg
format
Package format provides small shared formatting helpers.
Package format provides small shared formatting helpers.
git

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL