tokmd
CLI binary for tokmd - code intelligence for humans, machines, and LLMs.
Overview
This is the Tier 5 entry point that orchestrates all other crates. It provides the tokmd command-line application for generating code inventory receipts, analysis reports, and LLM context.
Installation
# From crates.io
# From source
# With Nix
Quick Start
# Language summary (Markdown)
# Module breakdown
# Pack for LLM context
# Analysis report
# Generate badge
Commands
| Command | Description |
|---|---|
tokmd / tokmd lang |
Language summary |
tokmd module |
Module breakdown by directory |
tokmd export |
File-level inventory (JSONL/CSV/CycloneDX) |
tokmd run |
Full scan with artifact output |
tokmd analyze |
Derived metrics and enrichments |
tokmd badge |
SVG badge generation |
tokmd diff |
Compare two runs or receipts |
tokmd cockpit |
PR metrics with evidence gates for code review |
tokmd gate |
Policy-based quality gates with JSON pointer rules |
tokmd tools |
Generate LLM tool definitions (OpenAI, Anthropic, JSON Schema) |
tokmd context |
Pack files into LLM context window |
tokmd init |
Generate .tokeignore template |
tokmd check-ignore |
Explain why files are ignored |
tokmd completions |
Generate shell completions |
Feature Flags
[]
= ["git", "walk", "content"]
= [] # Enable `tok` binary alias
= [] # Git history analysis
= [] # Asset discovery
= [] # Content scanning
Configuration
Supports tokmd.toml configuration files with:
- Scan settings (excludes, ignore handling)
- Module settings (roots, depth)
- Export settings (format, redaction)
- Analysis settings (presets, limits)
- Named profiles for different workflows
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error (includes non-existent paths) |
| 2 | CLI parsing error |
Dependencies
Coordinates all tokmd crates:
tokmd-analysiswith git, walk, content featurestokmd-analysis-formatwith fun featuretokmd-config,tokmd-core,tokmd-formattokmd-model,tokmd-scan,tokmd-typestokmd-tokeignore
Documentation
License
MIT OR Apache-2.0