Repository navigation
Token Counter CLI v0.1.0
π Token Counter CLI v0.1.0
A fast, user-friendly CLI tool for counting tokens in text files using tiktoken, with LLM context limit comparison and rich formatting.
β¨ Features
- Fast tokenization using OpenAI's tiktoken library
- Rich progress bars for large files
- LLM context limit comparison with latest 2025 models from all major providers
- Beautiful color-coded output with provider grouping and readable number formatting
- Flexible file handling with wildcard discovery and recursive scanning
- Multiple encoding support with interactive selection
- Comprehensive configuration via JSON files
π¦ Installation
pip install token-counter-cliπ Quick Start
# Count tokens in a file
token-counter my_document.txt
# Check against LLM limits with beautiful output
token-counter my_document.txt --check-limits
# Process directory recursively with auto-discovery
token-counter my_project/ --recursive --add-extensions "*"
# Interactive encoding selection
token-counter my_file.txt --select-encodingπ What's New in v0.1.0
- Enhanced color system: Green (β€80%), yellow (80-100%), red (>100%) usage indicators
- Provider grouping: LLM limits organized by OpenAI, Anthropic, Google, Meta, xAI, Mistral, Cohere
- Readable numbers: Comma separators and K/M notation (e.g., "1.2M tokens")
- Improved formatting: "122K of 1M tokens" with color-coded context limits
- Latest LLM models: Updated with 2025 models including GPT-4.1, Claude 4, Gemini 2.5, Llama 4
π Links
- PyPI Package: https://pypi.org/project/token-counter-cli/
- Documentation: See README.md for full usage guide
- Issues & Features: https://github.com/puya/token-counter/issues
Enjoy counting tokens! π