Skip to main content

TRI CLI Reference

TRI CLI is the unified command-line interface for the entire Trinity ecosystem. One binary, 203 commands across 11 categories — covering AI chat, code generation, SWE agent, sacred mathematics, sacred science, swarm orchestration, VIBEE compilation, and more.

φ² + 1/φ² = 3 = TRINITY

Installation

# Requires Zig 0.15.x
git clone https://github.com/gHashTag/trinity.git
cd trinity

# Build TRI CLI
zig build tri

# Run (interactive REPL)
./zig-out/bin/tri

# Run with command
./zig-out/bin/tri <command> [args]

Quick Reference

CategoryCommandsDescription
AI & Chatchat, code, reason, igla5 commands for AI assistance
Sacred Sciencebio, cosmos, neuro, chem, music, frequency, scale, chord, resonance, waveform, harmony, phi-series, intelligence, identity, swarm, govern, omega, quantum, conscious25 commands for sacred science
Sacred Mathconstants, phi, fib, lucas, spiral, gematria, formula, sacred8 commands for sacred mathematics
Gitstatus, diff, log, commit4 commands for Git workflow
Developmentfix, explain, test, doc, refactor, analyze, search, query, context-info, doctor, clean, fmt, stats, gen, convert, serve, build, deploy, deck, bench, time, install22 commands for development
Systeminfo, version, help, deps, tvc-stats, math-agent6 commands for system operations
Demos*-demo (37 commands)37 demo commands
Benchmarks*-bench (36 commands)36 benchmark commands
Golden Chainpipeline, pipeline-demo, decompose, plan, spec-create, loop-decide, verify, verdict8 commands for autonomous development
Advancedevolve, distributed, multi-cluster, hardware, fpga-demo, sacred-full-cycle, research, launch, needle, needle-search, needle-check, monitor, math-agent13 advanced commands
DePINwallet, mesh, reputation, hardware4 commands for DePIN operations

Total: 203 commands

Most Used Commands

AI & Chat

tri chat "Explain ternary computing"    # Chat with AI
tri code fibonacci # Generate code
tri reason "how does VSA work" # Chain-of-thought

Development

tri fix src/main.zig                     # Detect and fix bugs
tri explain src/vsa.zig # Explain code
tri test src/vsa.zig # Generate tests
tri gen specs/my_module.vibee # Compile VIBEE spec
tri serve --port 8080 # Start HTTP server

Sacred Math

tri constants                             # Show φ, π, e, Lucas, Fibonacci
tri phi 10 # Compute φ^10
tri fib 50 # Fibonacci with BigInt
tri lucas 10 # Lucas L(10)

Git

tri status                               # Git status --short
tri diff # Show changes
tri log # Show last 10 commits
tri commit "fix: memory leak" # Stage all and commit

Interactive REPL

Running tri without arguments launches the interactive REPL:

$ ./zig-out/bin/tri
TRI CLI v3.0 — Absolute + Final Transcendence + New Era
100% Local AI | Code | Chat | SWE | Swarm
phi^2 + 1/phi^2 = 3 = TRINITY

REPL Commands:
/chat - Chat mode
/code - Code generation
/fix - Bug fixing
/explain - Explain code
/test - Generate tests
/doc - Generate docs
/refactor - Refactoring
/reason - Chain-of-thought
/zig - Zig language
/python - Python language
/rust - Rust language
/js - JavaScript
/stats - Statistics
/verbose - Toggle verbose
/quit - Exit

Just type to send a message!

Architecture

TRI CLI is built from 6 Zig modules:

ModuleFileResponsibility
Mainsrc/tri/main.zigEntry point, command dispatch
Utilssrc/tri/tri_utils.zigCommand enum, parser, REPL, help
Commandssrc/tri/tri_commands.zigTool commands (gen, serve, git, dev utils)
Pipelinesrc/tri/tri_pipeline.zigGolden Chain pipeline commands
Mathsrc/tri/tri_math.zigSacred math module
Strictsrc/tri/tri_strict.zigVIBEE-first strict mode
Demossrc/tri/tri_demos.zigAll demo and benchmark functions

Command Categories

AI & Chat (5 commands)

Chat, code generation, and reasoning assistance.

Sacred Science (25 commands)

Biology, cosmology, neuroscience, chemistry, music, consciousness, quantum mechanics.

Sacred Math (8 commands)

Golden ratio (φ), Fibonacci, Lucas, spiral coordinates.

Git (4 commands)

Streamlined Git workflow: status, diff, log, commit.

Development (22 commands)

SWE agent tools (fix, explain, test, doc), VIBEE compiler, build tools, HTTP server.

System (6 commands)

System info, version, dependencies, health check.

Demos (37 commands)

Interactive demonstrations of all Trinity features.

Benchmarks (36 commands)

Performance benchmarks for all subsystems.

Golden Chain (8 commands)

Autonomous development pipeline (22-link Golden Chain).

Advanced (13 commands)

Distributed computing, FPGA, research tools.

DePIN (4 commands)

Wallet management, mesh networking, reputation system.

Quick Start

# 1. Build TRI CLI
zig build tri

# 2. Start interactive REPL
./zig-out/bin/tri

# 3. Or run a specific command
./zig-out/bin/tri chat "Hello, Trinity!"
./zig-out/bin/tri phi 10
./zig-out/bin/tri pipeline run "add new feature"
./zig-out/bin/tri doctor

Command Flow

User Input

├── No args ──────────→ Interactive REPL (tri_utils.zig)
│ ├── /chat, /code, /fix ...
│ └── /quit to exit

├── chat/code ─────────→ Multi-modal Chat (IglaHybridChat)
│ ├── TVC corpus check (hit/miss)
│ ├── Groq/Claude/OpenAI/local GGUF
│ └── --stream, --image, --voice

├── fix/explain/test ──→ SWE Agent (TrinitySWEAgent)
│ doc/refactor/reason └── Language: Zig/Python/Rust/JS

├── pipeline/decompose → Golden Chain (22 links)
│ plan/verify/verdict └── TVC gate → spec → gen → test → bench → verdict

├── math/phi/fib ──────→ Sacred Math Engine (φ calculations)
│ lucas/spiral └── Cycles 82-90

├── status/diff/log ───→ Git Integration (child process)
│ commit

├── *-demo/*-bench ────→ Demo Engine (52+ cycles)
│ └── Needle Check: threshold = φ^-1 = 0.618

└── swarm/omega/... ───→ Swarm & Economy ($TRI)
└── 16 agents, marketplace, staking

Help System

tri help                    # Show all commands by category
tri help --category math # Show commands in category
tri help --search "test" # Search commands
tri help fix # Show detailed command help
tri --help # Show all commands
tri -h # Show all commands

Version

$ tri version
TRI CLI v3.0.0
Trinity Unified Command Line Interface
phi^2 + 1/phi^2 = 3 = TRINITY

Next Steps