codelens-0.0.2 is not a library.
Codelens
High performance code statistics tool written in Rust.
Features
- Fast: Parallel file traversal, 30-50x faster than Python alternatives
- 65+ Languages: Built-in support for popular programming languages
- Smart Filtering: Respects
.gitignore, auto-excludes build directories - Multiple Outputs: Console, JSON, CSV, Markdown, HTML with charts
- Complexity Analysis: Function count, cyclomatic complexity, nesting depth
- Extensible: Add custom languages via TOML configuration
Installation
Homebrew (macOS/Linux)
Cargo
Build from source
Usage
# Analyze current directory
# Analyze specific directories
# Only count specific languages
# Output JSON
# Output HTML report
# Show top 20 languages by code lines
# Exclude directories
# List supported languages
Output Formats
| Format | Flag | Description |
|---|---|---|
| Console | -f console |
Colored terminal output (default) |
| JSON | -f json |
Structured data for processing |
| CSV | -f csv |
Spreadsheet compatible |
| Markdown | -f markdown |
Documentation friendly |
| HTML | -f html |
Interactive report with charts |
Configuration
Create .codelens.toml in your project root:
# Exclude patterns
= "*test*,*mock*"
# Target languages
= "rust,go,python"
# Output format
= "json"
# Threading
= 8
# Depth limit
= 10
# Show git info
= true
Custom Languages (Planned)
Note: This feature is planned but not yet implemented.
Custom language definitions will be supported in ~/.config/codelens/languages.toml:
[]
= "MyLang"
= [".ml", ".mli"]
= ["#"]
= [["/*", "*/"]]
= "^\\s*def\\s+\\w+"
= ["if", "for", "while"]
License
MIT