greg is an autonomous print agent built from the ground up for command-line developers. Powered by the @amaranthic/hernex engine, greg bridges frontier reasoning models to your local development environment—discovering project structure, tracing execution flows, applying multi-file code modifications, executing test suites, and rolling back changes with content-addressed snapshots.
Unlike traditional interactive terminal chat applications that trap your workflow inside a conversational loop, greg follows the Unix philosophy: it ingests context from stdin, streams clean answers and code to stdout, isolates tool execution telemetry to stderr, and exits with standard POSIX exit codes.
Ready to dive straight in? Follow the Quickstart to run your first task in under two minutes, or see Common Workflows for step-by-step developer recipes.
- The Print Agent Philosophy: Clean stream separation, composability with Unix pipes, and scriptable automation.
- Core Capabilities: Codebase mapping, atomic file edits, test verification, checkpoints, and multi-turn threads.
- Quick Setup: Installing the standalone binary and setting your first frontier provider.
- Everyday Usage Patterns: Exploring, debugging, refactoring, and piping in action.
- Architecture at a Glance: How the agent engine, policy guardrails, and checkpoint stores interact.
- Next Steps: Guided links to deeper documentation.
The Print Agent Philosophy
Most developer agents wrap models in heavy, stateful interactive UIs that take over your entire terminal screen. While useful for casual inquiries, this breaks the core strength of the Unix command line: composability.greg operates as a print agent:
- Clean Standard Output (
stdout): Only the final response, generated code, or structured JSON is written tostdout. You can safely pipegreginto downstream tools (| jq,| pbcopy,> patch.diff) without scraping away ANSI progress bars or diagnostic chatter. - Diagnostic Standard Error (
stderr): Step counters, tool execution notices (Read(src/index.ts),Bash(bun test)), LSP diagnostics, and permission warnings are routed strictly tostderr. - Pipeline Ingestion (
stdin): Pipe compiler errors, diffs, log files, or database schemas directly intogregwithout manually copying and pasting lengthy inputs into string arguments. - Deterministic Exit Codes: Emits POSIX exit codes (
0for success,1for runtime error,2for fail-closed permission denial,4for timeout) so shell scripts and CI workflows can react deterministically.
Core Capabilities
greg pairs frontier intelligence with local filesystem and execution tools:
- Autonomous Codebase Exploration: Employs
Glob,Grep,Read, and nativeLsp(Language Server Protocol) to navigate large repositories, trace definitions, and discover architectural patterns without loading thousands of irrelevant files into context. - Deterministic Permission Guardrails: Runs by default in read-only mode. File edits require
--permission-mode acceptEdits, while arbitrary shell commands can be restricted to strict wildcard patterns (e.g.--allowed-tools "Bash(bun test *)"). - Content-Addressed Delta Checkpoints: Every file modification is automatically snapshotted before changes touch disk using Hernex’s
FileCheckpointStore. You can preflight unified diffs withgreg checkpoints diffand roll back mistakes instantly withgreg checkpoints restore. - Persistent Multi-Turn Threads: Conversation memory is persisted per workspace. Continue tasks seamlessly across sittings with
-c, resume by ID with-r, or time-travel branch with--resume-session-at <index>. - Frontier Model Agnostic: Routes across Anthropic Claude, Google Gemini, OpenAI GPT-5, DeepSeek, Groq, OpenRouter, and local OpenAI-compatible endpoints using simple
provider/modelidentifiers.
Quick Setup
Get up and running with a single curl command:1. Install the Native Binary
PATH.
2. Configure Your Frontier Provider
Export your API key and set your default frontier model:3. Run Your First Task
Everyday Usage Patterns
Here is howgreg fits naturally into day-to-day developer workflows:
1. Understand Unfamiliar Code
Ask targeted questions about control flow, dependencies, or architectural patterns:2. Autonomous Bug Fixing with Test Verification
Pass reproduction steps, allow file edits, and constrain shell execution to your test runner:3. Terminal Piping & Code Review
Pipe git changes or log files directly intogreg for instant analysis:
4. Risk-Free Refactoring with Instant Rollback
Experiment with large-scale code modernization knowing you can revert at any moment:Architecture at a Glance
greg is built on modular components that ensure safety, persistence, and performance:
Next Steps
Explore the full documentation suite to mastergreg:
- Quickstart: Step-by-step tutorial taking you through your first complete editing task.
- Installation Guide: Detailed setup instructions for macOS, Linux, WSL, Android Termux, manual downloads, and source builds.
- Managing Threads: Master session persistence, branching, transcript exports, and checkpoint rollback workflows.
- Managing Providers: Configure API credentials, base URLs, reasoning effort budgets, and automatic fallback chains across 13+ providers.
- Common Workflows: Practical recipes for exploration, refactoring, test generation, and CI automation.