

A powerful CLI & Python library for context that feeds your prompts
Command-line tool and Python API for intelligent code aggregation and analysis.
Surface relevant files. Build optimal context. Track velocity.
Examine code quality metrics. Evaluate and improve your codebase.
All processing stays local - your code never leaves your machine.
See It In Action
$ tenets distill "add mistral api to summarizer"


$ tenets rank "fix summarizing truncation bug" --tree

$ tenets examine . --complexity --hotspots --ownership

$ tenets examine . --show-details --hotspots --format html

$ tenets session create payment-integration
$ tenets tenet add "Always validate user input" --priority critical --category security
$ tenets tenet add "Use type hints in Python" --priority high --category style
$ tenets instill --session payment-integration
$ tenets system-instruction set "Prefer small, safe diffs and add tests" --enable
$ tenets distill "add OAuth2 refresh tokens" --session payment-integration --remove-comments --condense



$ tenets momentum --team --since "last month" --detailed

$ tenets viz deps --format html --output interactive.html

Core Features
Intelligent Context Building
Multi-factor ranking algorithm that goes beyond keyword matching. Analyzes code structure, import relationships, Git history, and semantic meaning to surface exactly the files you need for any development task.
- Multi-Factor Ranking: Keywords, structure, imports, path relevance, and Git signals
- Optional ML: Semantic embeddings and transformers when
tenets[ml]
is installed - Summarization: Rules-based and ML summarizers built-in; LLMs only if API keys enabled
- Token Optimization: Budget-aware packing and model-specific token counting
- Lightweight Extras: Extras-based dependency architecture keeps core lean
Code Quality Metrics & Evaluation
Comprehensive evaluation system that assesses code quality, identifies hotspots, tracks technical debt, and provides actionable insights. Use tenets not just for prompting but for continuous code quality monitoring and improvement.
- Complexity Analysis: Cyclomatic, cognitive, and Halstead metrics
- Quality Evaluation: Maintainability index and code health scoring
- Technical Debt Tracking: Identify and prioritize refactoring needs
- Test Coverage Analysis: Find untested code paths and improve reliability
- Code Pattern Detection: Identify anti-patterns and best practices
Stateful Prompting & Tenets
Build complex features iteratively with persistent sessions. Define guiding principles (tenets) that shape how AI understands your codebase. Perfect for ongoing conversations with AI assistants and maintaining context across multiple prompts.
- Persistent Context: Maintain state across multiple CLI invocations
- Guiding Tenets: Define principles that guide AI interactions
- Incremental Building: Add context without starting over each time
- Session Branching: Explore alternatives without losing work
- SQLite Storage: Reliable local session persistence and history
Development Intelligence & Insights
Track velocity, identify bottlenecks, and understand team patterns. Visualize your architecture, monitor code evolution, and make data-driven decisions about refactoring, technical debt, and resource allocation.
- Velocity Tracking: Monitor team and individual productivity metrics
- Hotspot Analysis: Find frequently changing and problematic areas
- Dependency Visualization: Understand architecture and coupling
- Contributor Analytics: Track code ownership and expertise
- Trend Analysis: Monitor quality and velocity changes over time
How Tenets Works
Input
Natural language prompt
or specific query
Scan
Parallel file discovery
respecting .gitignore
Analyze
Language analyzers & AST
structure and metrics
Rank
Multi-factor scoring
keywords, structure, git
ML (Optional)
Embeddings & semantic
similarity when enabled
Summarize & Output
Token budgeting & summaries
LLMs optional via API keys
Installation Options
Quick InstallQuick
pip install tenets
Core features - lightweight, no ML dependencies
Full FeaturesAll
pip install tenets[all]
Everything including ML models and visualization
Light NLPLight
pip install tenets[light]
Keyword extraction, TextRank, metrics without deep learning
MLML
pip install tenets[ml]
Transformers, embeddings, vector search, providers
VisualizationViz
pip install tenets[viz]
Graphs, plots, and visual dashboards
Web InterfaceWeb
pip install tenets[web]
FastAPI, Uvicorn, SSE, uploads
Install & Build from SourceSource
git clone https://github.com/jddunn/tenets.git cd tenets && pip install -e .
Latest development version with all updates
Docker (Install & Build)Docker
# Official Docker commands are coming soon
Official Docker image and compose examples coming soon