Skip to content

Foxxed909/trident-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฑ TRIDENT CLI

Three Prongs. One Power. All Yours.

TRIDENT is an all-powerful agentic AI coding assistant that runs entirely in your terminal. Inspired by Claude Code, OpenAI Codex CLI, and Qwen Code CLI โ€” built to surpass them all.


Architecture: The Three Prongs

๐Ÿ”ฑ TRIDENT
โ”œโ”€โ”€ โšก FORGE     โ€” Agentic coding engine (tool loop, file ops, shell execution)
โ”œโ”€โ”€ ๐Ÿ”ฎ ORACLE    โ€” Project context engine (TRIDENT.md, framework detection, tree scanning)
โ””โ”€โ”€ ๐Ÿ›ก WARDEN    โ€” Safety & approval layer (risk classification, diffs, session logging)

Quickstart

1. Install

# Clone or copy this project, then:
npm install

# Make globally available
npm link

# Or run directly:
npx tsx src/index.ts

2. Set your API key

export ANTHROPIC_API_KEY=sk-ant-...

3. Run doctor check

trident doctor

4. Initialize your project

cd /your/project
trident init   # Generates TRIDENT.md โ€” the AI memory file

5. Start building

trident                           # Interactive mode
trident "add input validation"    # One-shot task

Commands

Command Description
trident Interactive REPL mode
trident "task" One-shot task execution
trident init Generate TRIDENT.md for current project
trident config Show full configuration
trident config <key> <value> Set a config value
trident doctor Check environment & API keys
trident review Review last session action log
trident --help Show all options

Flags

Flag Description
-m, --model <model> Override model (e.g. claude-opus-4-5)
--mode <mode> Approval mode: yolo, review, lockdown
--max-turns <n> Max agent loop iterations (default: 50)
--budget <usd> Max spend in USD for this session

Interactive Commands

While in interactive mode:

  • exit or quit โ€” Exit TRIDENT
  • init โ€” Generate TRIDENT.md
  • mode yolo|review|lockdown โ€” Switch approval mode
  • model <name> โ€” Switch model

Approval Modes

Mode Description
review (default) Auto-approve reads; ask for writes, shell, destructive
yolo Auto-approve everything โ€” fastest, zero interruptions
lockdown Ask for every single action โ€” maximum safety

Risk Classification

Every tool call is classified before execution:

Risk Color Actions
READ ๐ŸŸข Green read_file, list_dir, search, web_fetch
WRITE ๐ŸŸก Yellow write_file, edit_file
EXECUTE ๐ŸŸฃ Magenta run_command
DESTRUCTIVE ๐Ÿ”ด Red delete_file

TRIDENT.md โ€” Project Memory

TRIDENT reads TRIDENT.md from your project root and injects it into every agent prompt. This gives the AI persistent knowledge about your project.

# TRIDENT Project Context

## Project
- Name, languages, frameworks, package manager

## Commands
- Install, dev, test, build, lint

## Do Not Touch
- Files/dirs TRIDENT should never modify

## Context for AI
- Any conventions, rules, or extra context you want TRIDENT to know

Run trident init to auto-generate it. Edit it freely.


Agent Tools

TRIDENT's agent has access to 10 tools:

Tool Description
read_file Read file contents
write_file Write/create a file
edit_file Surgical string-replace edits
delete_file Delete a file (DESTRUCTIVE)
list_dir List directory (with recursive option)
run_command Execute shell commands
search_codebase Grep across project files
web_fetch Fetch URLs (docs, APIs)
ask_user Ask you a clarifying question
final_answer Signal task completion

All tools have a 30-second timeout and full session logging.


Configuration

trident config                        # Show all config
trident config model claude-sonnet-4-5  # Switch model
trident config mode yolo              # Default to YOLO mode
trident config maxTurns 100           # More iterations

Config stored at ~/.trident-cli/config.json.


Session Logs

All actions are logged to ~/.trident/logs/<session-id>.jsonl.

Review the latest session:

trident review

Each log entry contains: timestamp, tool name, input, result, approved/denied, risk level.


Models

TRIDENT uses Anthropic's models by default:

Model Best For
claude-opus-4-5 Complex agentic tasks (default)
claude-sonnet-4-5 Balanced speed/quality
claude-haiku-4-5-20251001 Fast, cheap tasks

Project Structure

trident/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.ts              โ† CLI entry point & interactive REPL
โ”‚   โ”œโ”€โ”€ config.ts             โ† Config management (conf-backed)
โ”‚   โ”œโ”€โ”€ agent/
โ”‚   โ”‚   โ”œโ”€โ”€ loop.ts           โ† Main agent loop (streaming + tool calling)
โ”‚   โ”‚   โ””โ”€โ”€ tools.ts          โ† Tool definitions + executors
โ”‚   โ”œโ”€โ”€ providers/
โ”‚   โ”‚   โ””โ”€โ”€ anthropic.ts      โ† Streaming Anthropic provider
โ”‚   โ”œโ”€โ”€ oracle/
โ”‚   โ”‚   โ””โ”€โ”€ index.ts          โ† Project scanner, TRIDENT.md, system prompt
โ”‚   โ”œโ”€โ”€ ui/
โ”‚   โ”‚   โ”œโ”€โ”€ renderer.ts       โ† Terminal UI (chalk-based)
โ”‚   โ”‚   โ””โ”€โ”€ diff.ts           โ† Colored diff viewer
โ”‚   โ””โ”€โ”€ warden/
โ”‚       โ””โ”€โ”€ index.ts          โ† Risk classifier, approval, session logger
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsconfig.json
โ””โ”€โ”€ README.md

Philosophy

  1. Think before acting โ€” The agent plans before calling tools
  2. Minimal blast radius โ€” Surgical edits preferred over full rewrites
  3. Verify work โ€” Tests/linters run after changes when available
  4. Ask when uncertain โ€” Clarification over wrong assumptions
  5. Full transparency โ€” Every action logged, every risk shown
  6. Complete tasks โ€” The agent doesn't stop until it's done

Built with โšก TypeScript, Anthropic SDK, Commander, Chalk, Inquirer, Execa

About

๐Ÿ”ฑ TRIDENT โ€” Agentic AI coding CLI. Multi-provider (Anthropic + OpenRouter), interactive REPL, undo stack, slash commands, project-context awareness.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors