Build the fastest, most reliable CLI for intelligent code analysis and context extraction. Dex turns any codebase—of any size—into structured, token-efficient, agent-ready context that’s still easy for humans to read.
-
Command-Based CLI
- Each command (
extract,distill,combine,tree) is self-contained, typed, and tested. - Clear, stable interfaces between CLI, core logic, and output.
- Each command (
-
Pluggable Parsing
- Unified
Parserinterface:init,parse,extract,supportsLanguage. - Supports both high-precision (Tree-sitter) and fallback (regex) parsing.
- Easy to add new languages without touching existing commands.
- Unified
-
Git as Source of Truth
- All file operations are git-aware.
- Detects project root, respects ignore rules, works from any subdirectory.
- Uses git metadata for change detection and context scoping.
-
Token-Efficient, Agent-First Output
- Output is deterministic, unambiguous, and structured for machine parsing.
- Human readability is secondary but never sacrificed entirely.
- Reliability First – Must work consistently across OSes, filesystems, and repo layouts. Fail gracefully, explain failures clearly.
- Speed + Scale – Handle large repos efficiently with streaming, concurrency controls, and caching.
- DX-Driven – Sensible defaults, fast startup,
--dry-runeverywhere, rich help text. - Extensible – Add new languages, outputs, and analyses without regressions.
- Separation of Concerns – Core logic has no CLI/UX code; CLI has no parsing or business logic.
- Type Safety + Validation – All options, results, and inputs validated with TypeScript + Zod.
- Parser Abstraction – Every parser implements the unified interface.
- Central Output Management – All generated files in
.dexat project root; consistent naming (dex.<cmd>.<context>.<ext>). - Progress Feedback – For long operations, show file counts, phase names, ETA.
- Error Boundaries – Clear recovery paths; never crash with raw stack traces.
- Comprehensive Testing – Unit + integration + e2e. No feature “done” without tests.
- Git-aware change analysis.
- Supports commit ranges, staged/unstaged, and smart file inclusion.
- Full codebase/API extraction.
- Outputs structured symbol maps, dependency graphs, and summaries.
- Configurable depth & filtering.
- Merges multiple files into a single structured context.
- Preserves relationships & metadata.
- Visual or textual API structure.
- Custom grouping, formatting, and output target (terminal or file).
- Unix-Like – Predictable flags, clear stdout/stderr usage.
- Readable + Parseable Output – No hidden ANSI codes in saved files.
- Smart Defaults – Works immediately on any repo without config.
- Cross-Platform – Identical behavior on macOS, Linux, Windows.
-
Developer Experience Run
dex distill ./in any repo and get a complete, agent-ready snapshot—no setup required. -
Agent Readiness An LLM can consume the output and correctly infer architecture, key APIs, and dependencies.
-
Integration Ready Dex runs headless in CI/CD and automation pipelines; all outputs stable and versioned.
-
Extensibility Proven Adding a new language parser requires <30 min and no edits to unrelated commands.
This charter is the P0 baseline for all decisions.