8gent Code
Reference

Commands

8gent provides two entry points: the full command 8gent and the short alias 8.

Launch the TUI

# Full command (after npm install -g @8gi-foundation/8gent-code)
8gent

# Short alias
8

# From source (contributors)
bun run tui

Specify a Provider

8gent --provider <name> switches the active provider. Run 8gent providers to list available names.

# Switch to OpenRouter cloud models. Default active provider is "8gent"
# (local localhost:11434, model eight-1.0-q3:14b), with "ollama" also enabled.
8gent --provider openrouter

Auth Commands

8gent includes Clerk-based authentication for syncing sessions and preferences. Auth is optional. The agent works fully offline without logging in.

# Log in via device code flow
8gent auth login

# Log out
8gent auth logout

# Check current auth status
8gent auth status

# Show current user info
8gent auth whoami

Tokens are stored in the macOS Keychain when available, with an AES-256-GCM encrypted file fallback on other platforms.

AST Commands

Query code structure without reading entire files:

# Show file outline (all symbols with signatures)
8gent outline src/parser.ts

# Get a specific symbol's source
8gent symbol src/parser.ts::buildSymbolId

Benchmark Commands

# Run the full benchmark suite
bun run benchmark:v2

# Run autoresearch loop
CATEGORY=battle-test MAX_ITERATIONS=5 bun run benchmark:loop

# Overnight runner
bash benchmarks/autoresearch/overnight-runner.sh

# Validate a kernel fine-tuning checkpoint
bun run benchmarks/autoresearch/validate-checkpoint.ts

Harness CLI

The harness CLI (packages/harness-cli/) provides headless session management:

# Run a session headlessly
harness run "Build a REST API"

# Inspect a past session
harness inspect <session-id>

# Check system health
harness doctor

# List recent sessions
harness sessions

Configuration Paths

PathPurpose
.8gent/config.jsonProject-level configuration
~/.8gent/config.jsonGlobal configuration (overridden by project)
~/.8gent/permissions.jsonCommand permission rules
~/.8gent/hooks.jsonAutomation hooks
.8gent/mcp.jsonMCP server configuration
~/.8gent/personal-lora/Personal LoRA adapter (kernel fine-tuning)
~/.8gent/kernel/Kernel score history and training state

Environment Variables

VariablePurposeRequired
OPENROUTER_API_KEYAPI key for OpenRouter cloud modelsOnly for OpenRouter provider
TRAINING_PROXY_URLTraining proxy URL overrideOnly for kernel fine-tuning
OLLAMA_HOSTOverride default Ollama URL (localhost:11434)No
GITHUB_PERSONAL_ACCESS_TOKENFor GitHub MCP serverOnly for GitHub integration