g3

g3 is an open-source, Rust-based command-line coding agent framework developed by Dhanji Prasanna. It is designed to orchestrate LLM-driven software engineering workflows directly from the terminal, leveraging structured rule evaluation and multi-agent roles. In everyday development, g3 interfaces with multiple LLM backend providers including Anthropic, OpenAI, Google Gemini, Databricks, and local or embedded models. It supports distinct operational topologies, such as coach-player configurations where dedicated planner and reviewer roles oversee execution and code generation while respecting model-specific parameters like Anthropic thinking budgets. A key differentiator in g3 is its deterministic policy enforcement via a Datalog-backed rulespec engine. Developers can define predicate constraints (such as substring, regex match, or presence checks with conditional when clauses) that agents must satisfy during execution, alongside persistent execution memory management that can be toggled via flags like --no-auto-memory. The tool is distributed under an open-source repository on GitHub and is implemented as a modular Rust workspace (comprising crates such as g3-core, g3-providers, and g3-planner).

Tags: ai agent, cli, coding agent, developer tools, experiments, OpenSource

Visit g3

Key features

  • Multi-Provider LLM Integration — Native support for Anthropic Claude (with thinking token budgeting), OpenAI, Google Gemini, Databricks, and embedded model endpoints. - Datalog Rulespec Engine — Deterministic code and behavior validation supporting conditional predicates, regex matching, and YAML-based policy authoring. - Coach-Player Multi-Agent Architecture — Configurable workflow topologies dividing tasks between planning/reviewing agents (coach) and execution agents (player). - Auto-Memory Management — Built-in session memory handling with command-line flags (e.g., --no-auto-memory) to control prompt injection and context retention. - Modular Rust Architecture — High-performance native CLI built across distinct modular crates including g3-core, g3-providers, and g3-planner.

Use cases

Use Case: Enforcing Strict Architectural Rulespecs Developers use g3's Datalog rulespec engine to enforce project-specific coding invariants and architectural boundaries. The agent checks conditional predicates and validation rules during file generation to prevent unauthorized imports or patterns.

Use Case: Coach-Player Code Implementation and Review Teams configure g3 in a coach-player setup where a reasoning model acts as the coach providing planning and review constraints, while a separate model implements code changes according to the specified plan.

Use Case: Cross-Provider Terminal Automation Engineers invoke g3 from the terminal across different backends (Anthropic, Gemini, OpenAI, or Databricks) with custom token budgets and memory settings tailored for ad-hoc refactoring and scripting.

Who it is for

g3 is designed for Rust developers and software engineers who want a customizable, terminal-first AI agent that enforces strict formal rules and multi-agent coordination. It is not intended for non-technical users or developers looking for a GUI-centric IDE extension without terminal configuration.

Install guide

Installation Install via Cargo directly from the repository: bash cargo install --git https://github.com/dhanji/g3 Alternatively, clone and build the binary from source using Cargo: bash git clone https://github.com/dhanji/g3.git cd g3 cargo build --release

First Run Configure your provider API keys and model configurations in your environment or TOML config file: bash export ANTHROPIC_API_KEY="your-anthropic-api-key" export OPENAI_API_KEY="your-openai-api-key"

Example Session Run g3 with a task prompt or launch an interactive session while optionally managing auto-memory: bash g3 --no-auto-memory "Refactor the parser module in crates/g3-core to support optional YAML fields"

Part of CLI Coding Agents

Categories: AI Coding Agents, Developer Tools, Experiments

Related CLI agents

  • Claw Code — Claw Code is an open-source terminal-based AI coding assistant developed by Ultraworkers. Built on a hybrid architecture featuring a high-performance…
  • Ouroboros — Ouroboros is an open-source autonomous CLI coding agent developed by razzant. Built primarily in Python, the agent is engineered to…
  • Unship — Unship is an open-source agent harness and plugin integration framework developed by mbenhard. It is designed to package and orchestrate…
  • OpenHands — OpenHands (formerly OpenDevin) is an open-source autonomous AI software development agent and orchestration platform. It provides an extensible runtime environment…
  • SWE-agent — SWE-agent is an open-source autonomous software engineering agent harness built and maintained by researchers from Princeton University and Stanford University.…
  • OpenCode — OpenCode is an open-source AI coding agent developed by Anomaly that operates across terminal environments, desktop applications, and IDE extensions.…
  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories