talira

Count your code, quickly.

open sourceApache-2.0self-hostablefree

Tokei displays statistics about your code: number of files, total lines, code, comments and blanks grouped by language. It is very fast, handles multi-line and nested comments correctly, supports over 150 languages, and can output CBOR, JSON or YAML. It is also usable as a Rust library.

Ways to install

Problems it solves

  • how many lines of code are in this repo, by language
  • cloc is slow on a big monorepo
  • count lines of code excluding comments and blank lines
  • track codebase size over time in CI as JSON
  • what languages is this project actually written in
  • compare how much test code versus app code we have
  • need a library to count source lines programmatically in Rust
  • quick stats about an unfamiliar codebase I just cloned

Features

  • 150+ languages
  • accurate comment handling
  • JSON/YAML/CBOR output
  • library API

Capabilities

Has an APIplan not known
Has a command line toolplan not known
Has official SDKsplan not known

Alternatives

The same job

These do what Tokei does.

  1. cloc cloc counts blank lines, comment lines, and physical lines of source code in many programming languages
  2. hyperfine A command-line benchmarking tool

Compare Tokei with the top 3