Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsApr 6, 2026·2 min de lectura

Tokei — Fast Code Statistics for Any Language

Blazing-fast code statistics tool written in Rust. Count lines of code, comments, and blanks across 200+ languages. Perfect for project health reports and AI context. 12,000+ stars.

Introducción

Tokei is a blazing-fast code statistics tool written in Rust that counts lines of code, comments, and blanks across 200+ programming languages with 12,000+ GitHub stars. Run tokei in any directory and instantly get a breakdown of your codebase size by language. Output in table, JSON, YAML, or CBOR format for integration with CI dashboards and project reports. Best for developers who need quick codebase metrics for planning, reporting, or feeding context to AI agents. Works with: any codebase. Setup time: under 30 seconds.


Features

200+ Languages

Tokei recognizes TypeScript, Python, Rust, Go, Java, C++, Ruby, Swift, Kotlin, SQL, Markdown, YAML, and 190+ more.

Output Formats

tokei --output json    # JSON for CI/dashboards
tokei --output yaml    # YAML
tokei --output cbor    # Binary format

Sorting & Filtering

tokei --sort code           # Sort by lines of code
tokei --sort comments       # Sort by comments
tokei -e node_modules -e dist  # Exclude directories
tokei -t TypeScript,Python  # Only specific languages

Per-File Breakdown

tokei --files
# Shows line counts per individual file

Git Integration

# Count only files tracked by git
tokei $(git ls-files)

# Compare branches
diff <(git stash && tokei --output json) <(git stash pop && tokei --output json)

Performance

Written in Rust — counts millions of lines in seconds:

Linux kernel (28M lines): 1.2 seconds
Chromium (35M lines): 1.8 seconds
Small project (10K lines): 0.01 seconds

AI Context Use Case

# Feed codebase stats to your AI agent
tokei --output json | claude "Analyze this codebase breakdown and suggest where to focus refactoring"

Key Stats

  • 12,000+ GitHub stars
  • 200+ languages supported
  • Written in Rust (instant results)
  • JSON/YAML output for CI
  • Respects .gitignore

FAQ

Q: What is Tokei? A: Tokei is a Rust-powered tool that instantly counts lines of code, comments, and blanks across 200+ programming languages.

Q: Is Tokei free? A: Yes, open-source under MIT/Apache 2.0 license.

Q: How does Tokei compare to cloc? A: Tokei is 5-10x faster than cloc and handles modern languages better. Both produce similar output.


🙏

Fuente y agradecimientos

Created by XAMPPRocky. Licensed under MIT/Apache 2.0.

tokei — ⭐ 12,000+

Thanks for making codebase statistics instant.

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados