Harvey Developer Guide
This guide is for developers who want to understand Harveyβs
internals, contribute to the project, or extend its functionality.
ποΈ Architecture & Design
Core Architecture
- ARCHITECTURE.md β
Component map, core types (Agent, LLMClient, Message, Workspace), and
how they interact
Design Documents
π οΈ Development Setup
Prerequisites
- about.md β Project
metadata, requirements (Go >= 1.26.3), and author information
Building Harvey
# Build all programs
make build
# Build a single program
go build -o bin/<name> cmd/<name>/*.go
# Generate version.go from codemeta.json
cmt codemeta.json version.go
# Build website (HTML from Markdown via pandoc)
make website
# Clean build artifacts
make clean
π§ͺ Testing
π¦ Code Organization
Main Package (harvey/)
- harvey.go β Core types:
Agent, LLMClient, Message, ChatStats
- commands.go β All
slash-command handlers and dispatch logic
- config.go β Configuration
struct, loading, and validation
- terminal.go β REPL loop,
startup sequence, backend selection
- workspace.go β Sandboxed
file I/O operations
- knowledge.go β SQLite
knowledge base implementation
- audit.go β In-memory
ring-buffer audit log
- permissions.go β
Permission check helpers
- ollama.go β OllamaClient
helpers and probing utilities
- anyllm_client.go β
AnyLLMClient wrapper for mozilla-ai/any-llm-go
- routing.go β
RouteRegistry, named remote endpoints, @mention dispatch
- recorder.go β Fountain
(.spmd) session recorder
- spinner.go β Animated
spinner with Edward Lear messages
Command Entry Points
(cmd/)
- Each subdirectory contains a CLI entry point
- Built using
go build -o bin/<name> cmd/<name>/*.go
- Schema-based tools: read_file, write_file, run_command, list_files,
git_command
- All tools enforce workspace boundary and permission checks
π¨ Conventions & Style
Documentation Conventions
All exported functions, structs/types, interfaces, and constants must
be documented with a /** ... */ block comment including: -
Description of what the symbol is or does - Parameters β name, type, and
purpose for each - Return values β type and meaning - An embedded usage
example
Code Conventions
version.go is generated by
cmt β do not edit by hand
bin/, dist/, man/,
testout/ are gitignored build artifacts
- Source lives at the package level (
harvey/*.go)
- CLI entry points go under
cmd/<program>/
- See HARVEY.md for full
toolchain dependencies and release targets
π Additional Resources
For Contributors
- Security β Security
model and protections (also relevant for developers)
- Configuration β
Workspace configuration reference