GPT Engage
GPT Engage is a command-line orchestrator for multi-AI debates. It runs structured debates between Claude, Codex, Gemini, and any CLI-based LLM. GPT Engage executes all participants in parallel, injects debate context between rounds, and produces synthesis reports.
Overview
GPT Engage solves a specific problem: getting multiple AI perspectives on a single question without manually copying responses between chat interfaces. You provide a topic, GPT Engage invokes each participant simultaneously, shares each round's responses with all participants, and optionally generates a synthesis that identifies consensus and disagreements.
Key capabilities:
- Multi-AI debates - Run Claude, Codex, and Gemini against the same prompt in parallel
- Multi-instance debates - Spawn multiple instances of the same LLM to leverage nondeterminism
- Debate templates - Use pre-configured scenarios for code review, architecture decisions, and security audits
- Synthesis generation - Automatically generate conclusions that summarize consensus and disagreements
- Plugin system - Add custom CLIs through TOML configuration files
- Evolutionary ideation - Generate divergent idea trees from a seed prompt
- Unix composability - Pipe content via stdin as topic or context
- Persistent sessions - Maintain conversation history across invocations
Installation
Prerequisites
GPT Engage requires at least one LLM CLI:
| CLI | Installation |
|---|---|
| Claude Code | https://claude.com/claude-code |
| Codex CLI | https://github.com/openai/codex-cli |
| Gemini CLI | https://ai.google.dev/docs/gemini_cli |
Install from crates.io (recommended)
Install pre-built binary
Download the latest release for your platform:
# Linux (x86_64)
|
# macOS (Apple Silicon)
|
# macOS (Intel)
|
Then add ~/.local/bin to your PATH if it isn't already:
Install from source
Clone the repository and run the installer:
The installer builds GPT Engage in release mode, copies the binary to ~/.local/bin/gptengage, and verifies your PATH configuration.
Alternatively, build manually:
Verify
Quick Start
Check Available CLIs
Run the status command to see which CLIs GPT Engage detects:
Output:
GPT Engage v1.2.1
Detected CLIs:
✓ claude (Claude Code)
✓ codex (Codex CLI)
✗ gemini (Gemini CLI)
Plugins:
✓ ollama (Local LLM via Ollama)
Active Sessions: 0
Run a Debate
Start a debate on any topic:
GPT Engage runs all detected CLIs in parallel, collects responses, and displays each round:
GPT ENGAGE DEBATE
Topic: Should we use TypeScript or JavaScript for our new project?
ROUND 1
────────────────────────────────────────
Claude:
TypeScript provides compile-time type checking that catches errors before runtime...
Codex:
JavaScript offers faster iteration and lower barrier to entry...
ROUND 2
────────────────────────────────────────
[Each participant responds with context from Round 1]
DEBATE COMPLETE
Summary: 3 round(s), 2 participant(s)
Generate Synthesis
Add --synthesize to generate a structured conclusion:
The synthesis includes:
- Summary of the debate
- Points of consensus
- Points of disagreement
- Key insights
- Recommendation (when applicable)
Use Templates
List available templates:
Run a debate with a template:
Pipe Content
Pipe file content as context:
|
Pipe content as the topic:
|
Commands
debate
Run a structured debate between multiple AI participants.
Arguments:
| Argument | Description |
|---|---|
TOPIC |
The debate topic. Provide as argument or pipe via stdin. |
Options:
| Option | Description |
|---|---|
--agent <CLI> |
Run multiple instances of a single CLI instead of cross-AI debate. |
--instances <N> |
Number of instances when using --agent. Default: 3. |
-m, --model <MODEL> |
Model to use when --agent is specified. |
-p, --participants <LIST> |
Specify participants with optional personas and models. Format: cli:persona or cli:persona:model. |
--agent-file <FILE> |
Load participant definitions from a JSON file. |
--template <NAME> |
Use a predefined debate template. |
-r, --rounds <N> |
Number of debate rounds. Default: 3 (or template default if using --template). |
--synthesize |
Generate a synthesis after the debate completes. |
--synthesizer <CLI> |
CLI to use for synthesis generation. Default: claude. |
--output <FORMAT> |
Output format: text, json, or markdown. Default: text. |
--stdin-as <MODE> |
How to interpret stdin: auto, context, or ignore. Default: auto. |
--timeout <SECONDS> |
Timeout per CLI per round. Default: 120. |
--write |
Allow write access within the current directory. Default: read-only. |
Examples:
Cross-AI debate with default participants:
Multi-instance debate with the same CLI:
Debate with personas:
Debate with template and synthesis:
JSON output for programmatic consumption:
invoke
Invoke a single CLI with optional session support.
Arguments:
| Argument | Description |
|---|---|
CLI |
The CLI to invoke: claude, codex, gemini, or a plugin name. |
PROMPT |
The prompt to send. Provide as argument or pipe via stdin. |
Options:
| Option | Description |
|---|---|
-m, --model <MODEL> |
Model to use for the CLI (e.g., claude-sonnet-4-20250514, gpt-4o, gemini-2.5-pro). |
-s, --session <NAME> |
Use or create a persistent session. |
--topic <DESC> |
Set the session topic. Auto-generated if omitted. |
-c, --context-file <PATH> |
Include file contents in the prompt. |
--stdin-as <MODE> |
How to interpret stdin: auto, context, or ignore. Default: auto. |
-t, --timeout <SECONDS> |
Command timeout. Default: 120. |
--write |
Allow write access within the current directory. |
Examples:
Simple invocation:
With session for multi-turn conversation:
With context file:
Pipe content as prompt:
|
template
Manage debate templates.
Subcommands:
| Command | Description |
|---|---|
list |
List all available templates (built-in and user-defined). |
show <NAME> |
Display template details including participants and context. |
Examples:
List templates:
Output:
Available Templates:
code-review (built-in)
Multi-perspective code review with security, performance, and maintainability focus
Participants: 3, Rounds: 2
architecture-decision (built-in)
Evaluate architectural choices from multiple stakeholder perspectives
Participants: 3, Rounds: 3
security-audit (built-in)
Security-focused analysis from CISO, engineer, and compliance perspectives
Participants: 3, Rounds: 2
Use a template: gptengage debate "topic" --template <name>
Show template details:
plugin
Manage custom CLI plugins.
Subcommands:
| Command | Description |
|---|---|
list |
List all installed plugins. |
validate <FILE> |
Validate a plugin configuration file. |
Examples:
List plugins:
Validate a plugin file:
session
Manage persistent conversation sessions.
Subcommands:
| Command | Description |
|---|---|
list |
List all active sessions. |
show <NAME> |
Display session history. |
end <NAME> |
Delete a session. |
end --all |
Delete all sessions. |
config
Manage GPT Engage configuration.
Subcommands:
| Command | Description |
|---|---|
get <KEY> |
Get the value of a configuration key. |
set <KEY> <VALUE> |
Set a configuration key to a value. |
list |
List all configuration settings. |
Examples:
List all settings:
Get a specific setting:
Set a configuration value:
generate-agents
Generate AI-powered agent definitions for structured debates.
Required Options:
| Option | Description |
|---|---|
--topic <TOPIC> |
The debate topic for context. |
--roles <ROLES> |
Comma-separated list of roles. |
-o, --output <FILE> |
Output file path for generated JSON. |
Optional Options:
| Option | Description |
|---|---|
--use-cli <CLI> |
CLI to use for generation. Default: claude. |
-t, --timeout <SECONDS> |
Timeout. Default: 120. |
--write |
Allow write access within the current directory. |
Example:
ideate
Generate divergent ideas from a seed using evolutionary ideation. GPT Engage builds an idea tree by expanding a seed idea into multiple branches, optionally going multiple levels deep.
Arguments:
| Argument | Description |
|---|---|
SEED |
The seed idea to diverge from. |
Options:
| Option | Description |
|---|---|
--sigma <SIGMA> |
Creativity level (0.0-3.0). Higher values produce more divergent ideas. Default: 1.0. |
--select |
Interactively select which L1 ideas to expand to L2. |
--depth <DEPTH> |
Depth of idea tree (1-5). Default: 2. |
--force |
Bypass sigma (>3.0) and depth (>5) safety limits. |
--cli <CLI> |
Which CLI to use. Default: claude. |
-o, --output <OUTPUT> |
Output format: text or json. Default: text. |
-t, --timeout <TIMEOUT> |
Timeout per CLI invocation. Default: 120. |
--color <COLOR> |
Color mode: auto, truecolor, 256, or none. Default: auto. |
--pager |
Display output in a scrollable pager. |
Examples:
Generate ideas from a seed:
High-creativity deep exploration:
Interactive selection with pager:
JSON output for programmatic use:
status
Display GPT Engage status, detected CLIs, plugins, and active sessions.
Debate Templates
GPT Engage includes five built-in templates. Each template defines participants with specific personas, instructions, and expertise areas.
code-review
Multi-perspective code review focusing on security, performance, and maintainability.
Participants:
- Security Reviewer (Claude) - Identifies vulnerabilities, injection risks, and authentication issues
- Performance Reviewer (Claude) - Finds bottlenecks, inefficient algorithms, and resource leaks
- Maintainability Reviewer (Claude) - Evaluates readability, test coverage, and coding standards
Usage:
|
architecture-decision
Evaluate architectural choices from multiple stakeholder perspectives.
Participants:
- Solution Architect (Claude) - Focuses on scalability, reliability, and technical trade-offs
- Senior Developer (Codex) - Considers implementation complexity and developer experience
- Operations Engineer (Gemini) - Evaluates deployment, monitoring, and operational concerns
security-audit
Security-focused analysis from multiple security perspectives.
Participants:
- CISO (Claude) - Strategic security risks and business impact
- Security Engineer (Claude) - Technical vulnerabilities and attack vectors
- Compliance Officer (Claude) - Regulatory requirements and audit concerns
api-design
API design review from consumer and provider perspectives.
Participants:
- API Architect (Claude) - RESTful design, versioning, and documentation
- Frontend Developer (Codex) - Developer experience and client integration
- Backend Developer (Gemini) - Implementation concerns and performance
incident-postmortem
Structured incident analysis for post-incident reviews.
Participants:
- SRE Lead (Claude) - Root cause analysis and reliability improvements
- Development Lead (Codex) - Code-level issues and fix strategies
- Product Manager (Gemini) - Customer impact and communication
Custom Templates
Create custom templates by adding TOML files to ~/.gptengage/templates/:
# ~/.gptengage/templates/my-template.toml
[]
= "my-template"
= "Custom debate template"
= 3
[[]]
= "claude"
= "Expert A"
= "Focus on aspect X. Provide specific examples and cite sources."
= ["topic1", "topic2", "topic3"]
[[]]
= "codex"
= "Expert B"
= "Focus on aspect Y. Challenge assumptions and propose alternatives."
= ["topic4", "topic5"]
[]
= "Consider the following context:"
= "Provide actionable recommendations."
Plugin System
GPT Engage supports custom CLIs through TOML-based plugin configuration. Plugins enable integration with any command-line LLM tool.
Plugin Location
Place plugin files in ~/.gptengage/plugins/ with .toml extension.
Plugin Format
# ~/.gptengage/plugins/ollama.toml
[]
= "ollama"
= "Local LLM via Ollama"
= "ollama"
[]
= ["run", "llama3"]
= "stdin"
[]
= []
= []
[]
= "ollama"
= ["--version"]
Configuration Fields
[plugin] section:
| Field | Required | Description |
|---|---|---|
name |
Yes | Plugin identifier used in commands. |
description |
Yes | Human-readable description. |
command |
Yes | Executable command name. |
[invoke] section:
| Field | Required | Description |
|---|---|---|
base_args |
Yes | Base arguments passed to the command. |
prompt_mode |
Yes | How to pass the prompt: stdin, arg, or arg_last. |
prompt_arg |
No | Argument flag for prompt when using arg mode. |
[access] section:
| Field | Required | Description |
|---|---|---|
readonly_args |
Yes | Additional arguments for read-only mode. |
write_args |
Yes | Additional arguments for write mode. |
[detection] section:
| Field | Required | Description |
|---|---|---|
check_command |
Yes | Command to verify CLI availability. |
check_args |
Yes | Arguments for availability check. |
Example: Aider Plugin
# ~/.gptengage/plugins/aider.toml
[]
= "aider"
= "AI pair programming with Aider"
= "aider"
[]
= ["--message"]
= "arg_last"
[]
= ["--no-auto-commits"]
= ["--auto-commits"]
[]
= "aider"
= ["--version"]
Using Plugins
After creating a plugin file, verify it appears in status:
Use the plugin in debates:
Or invoke directly:
Stdin Piping
GPT Engage accepts input via Unix pipes for composability with other tools.
Piping Modes
| Mode | Behavior |
|---|---|
auto |
Use stdin as topic if no topic argument provided; otherwise use as context. |
context |
Always prepend stdin as context with [PIPED CONTEXT] markers. |
ignore |
Discard stdin input. |
Examples
Pipe as topic:
|
Pipe file as context with explicit topic:
|
Pipe git diff for code review:
|
Pipe to invoke:
|
Context Injection Format
When stdin is used as context, GPT Engage injects it with markers:
[PIPED CONTEXT]
<stdin content>
[/PIPED CONTEXT]
<topic or prompt>
Synthesis Generation
GPT Engage generates structured synthesis reports after debates complete.
Enabling Synthesis
Add --synthesize to any debate command:
Specifying Synthesizer
By default, Claude generates the synthesis. Specify a different CLI with --synthesizer:
Synthesis Output
The synthesis includes:
| Field | Description |
|---|---|
summary |
2-3 sentence overview of the debate. |
consensus_points |
Points where participants agreed. |
disagreement_points |
Points where participants disagreed. |
key_insights |
Notable insights that emerged. |
recommendation |
Actionable recommendation when applicable. |
Text output:
SYNTHESIS
────────────────────────────────────────
Summary:
The debate focused on microservices vs monolith architecture...
Consensus:
• All participants agreed that team size affects the decision
• Performance requirements favor monolithic architecture initially
Disagreements:
• Timeline for migration varied significantly between perspectives
Key Insights:
• Start with a modular monolith and extract services when needed
Recommendation:
Begin with a well-structured monolith and identify extraction candidates...
JSON output:
Agent Definition Files
Agent definition files provide structured participant configurations for programmatic use.
File Format
Field Validation
| Field | Required | Validation |
|---|---|---|
schema_version |
Yes | Must be "1.0". |
generated_by |
No | Non-empty if present. |
participants |
Yes | At least one participant. |
participants[].cli |
Yes | Valid CLI name or plugin. |
participants[].persona |
Yes | Non-empty string. |
participants[].instructions |
Yes | Minimum 10 characters. |
participants[].expertise |
No | Array of strings. |
participants[].communication_style |
No | Non-empty if present. |
Generating Agent Files
Use generate-agents to create agent files with AI assistance:
Session Management
Sessions maintain conversation history across invocations without modifying underlying CLIs.
How Sessions Work
When you continue a session, GPT Engage injects the full history into the prompt:
[CONVERSATION HISTORY]
User: Review my authentication code
Assistant: I found 3 vulnerabilities...
User: Fix the JWT vulnerability
[/CONVERSATION HISTORY]
[CURRENT REQUEST]
Explain how to implement secure token rotation
[/CURRENT REQUEST]
Session Storage
Sessions are stored in ~/.gptengage/sessions/ as JSON files:
Security Considerations
Session files are stored unencrypted. Do not include sensitive information (passwords, API keys, PII) in session prompts. Use gptengage session end --all after working with sensitive topics.
Output Formats
GPT Engage supports three output formats for debate results.
Text (Default)
Human-readable format with visual separators:
JSON
Machine-readable format for programmatic consumption:
Output structure:
Markdown
Formatted for documentation or reports:
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | CLI not found or invocation failed |
| 2 | Session error or invalid format |
| 3 | File not found |
| 4 | Timeout exceeded |
Use exit codes for scripting:
if [; then
fi
CLI Requirements
Claude Code
GPT Engage invokes Claude with:
With --write flag:
Codex CLI
GPT Engage invokes Codex with:
With --write flag:
Gemini CLI
GPT Engage invokes Gemini with:
Gemini typically requires longer timeouts. Use --timeout 180 for complex prompts.
File Locations
| Path | Purpose |
|---|---|
~/.gptengage/config.json |
Configuration file |
~/.gptengage/sessions/ |
Session storage |
~/.gptengage/plugins/ |
Custom CLI plugins |
~/.gptengage/templates/ |
User-defined templates |
Troubleshooting
CLI not found
Verify the CLI is installed and in your PATH:
Codex requires git repository trust
Run Codex once in a trusted directory to add it to the trust list, or run GPT Engage from within a git repository.
Gemini timeout errors
Increase the timeout:
Plugin not detected
Verify the plugin file syntax:
Check that the plugin command exists:
Development
Building from Source
Project Structure
src/
├── main.rs # Entry point
├── lib.rs # Library root
├── cli.rs # Argument parsing
├── commands/ # Command implementations
├── invokers/ # CLI invokers
├── orchestrator/ # Debate orchestration
├── plugins/ # Plugin system
├── templates/ # Template system
├── session/ # Session management
└── utils/ # Utilities including stdin handling
Running Tests
License
MIT License. See LICENSE file.
Support
Report issues at https://github.com/rahulrajaram/gptengage/issues