Updated November 5, 2026 · Maintained by huanglizhuo

OctoCounts vs tokei

tokei is a fast, open-source line counter written in Rust, distributed as a command-line tool from github.com/XAMPPRocky/tokei — it counts files, code, comment, and blank lines per language on whatever checkout you point it at. OctoCounts is a web app that runs that same tokei engine server-side on public GitHub repositories: paste a URL, get a report pinned to an exact commit SHA. There is no official tokei web UI, so the choice is not two competing counters but two workflows: install the CLI when the code is on your machine, use the web app when the code is on GitHub and the result needs to be shared.

This is not a matchup of rival engines — OctoCounts runs tokei under the hood. The comparison below is about workflow: where the code lives, how the result is pinned, and what you can do with the numbers afterward.

Quick comparison

tokei (CLI)OctoCounts (web)
What it isCommand-line tool (Rust)Web app + extensions + API, running tokei server-side
Installcargo install tokei, brew, or a release binaryNone — paste a URL
InputAny directory on your machinePublic github.com repositories, any branch/tag/commit
Private codeYesNo
Commit pinningWhatever checkout you run it onEvery report pinned to an exact commit SHA
OutputTerminal table (text/JSON formats)Linkable report page, PNG card, text/JSON export
SharingCopy-paste yourselfStable URL, README badges, API
CachingNone — each run recountsCached by commit + tokei version + options

The web side: what OctoCounts adds around tokei

OctoCounts takes a public GitHub repository URL, resolves the requested branch, tag, or commit, downloads that revision's compressed source archive (not the full git history), and runs tokei on it. The report you get back states the commit SHA and the exact tokei version used, breaks out files, total lines, code, comments, and blanks per language, and lives at a stable URL you can paste into a pull request, README, or issue.

The CLI side: what tokei does on its own

tokei is the counting engine itself. It is written in Rust, recognizes hundreds of languages, and reports files, code, comment, and blank lines grouped by language. Installed with cargo install tokei, a system package manager, or a prebuilt release binary, it runs against any directory — a git checkout, an extracted source archive, or a folder with no version control at all.

Do the numbers match?

Matching counts require the same actual source tree, tokei version, and effective counting rules, including extraction exclusions and repository attributes. A local checkout at the same commit may differ from an archive: export-ignore can omit paths and export-subst can change file contents. Record the full commit SHA, engine version, options, effective policy, and measurement date; retain the exported JSON and a saved-report link while available. Older reports may lack a complete policy. The filtering pilot measures option effects, not local-versus-server parity. See Git archive attribute semantics.

Which one should I use?

ScenarioReach for
Check a public repo's size from someone else's machine or a locked-down laptopOctoCounts
Link a count in a PR or issue so others can verify it laterOctoCounts (commit-pinned URL)
Cite a codebase size in a paper or report with engine and version namedOctoCounts (report carries tokei version + SHA)
Live badge in a README that follows the cached reportOctoCounts badges
Count private or closed-source codetokei CLI
Count a working tree mid-edit, before any commit existstokei CLI
Air-gapped or offline environmenttokei CLI
Step in a pipeline on your own CI runnerstokei CLI (or the OctoCounts API/GitHub Action for public repos)
Code hosted outside github.comtokei CLI

Bottom line: the code's location decides. On GitHub and public → OctoCounts gives you the same tokei numbers with sharing, pinning, and badges for free; on your machine, private, or mid-edit → install the CLI. You can count locally during development and use an OctoCounts report when you need a public link.

Frequently Asked Questions

Is there an official tokei web UI?

No. tokei is distributed as a command-line tool from github.com/XAMPPRocky/tokei, and its repository ships no official web service. OctoCounts is an independent web app that runs tokei as its server-side counting engine: paste a public GitHub repository URL and the web app downloads the source archive, runs tokei, and publishes the result as a shareable report. The CLI remains the tool of record for local code.

Do OctoCounts and local tokei produce the same numbers?

Matching counts require the same actual source tree, tokei version, and effective counting rules, including extraction exclusions and repository attributes. A local checkout at the same commit may differ from an archive: export-ignore can omit paths and export-subst can change file contents. Record the full commit SHA, engine version, options, effective policy, and measurement date; retain the exported JSON and a saved-report link while available. Older reports may lack a complete policy. The filtering pilot measures option effects, not local-versus-server parity. See Git archive attribute semantics.

Which tokei version does OctoCounts run?

Production currently runs tokei 15.0.0, and every report displays the exact tokei version that produced its numbers next to the commit SHA. Because the version is pinned per report, an old report keeps describing the version that actually counted it, and a citation from OctoCounts names both the commit and the engine version without extra work.

When is the tokei CLI the only option?

Four cases belong to the CLI: code that is private or not hosted on GitHub (OctoCounts analyzes public GitHub repositories only), machines without reliable network access, counting a working tree mid-edit before anything is committed, and scripted pipelines that must run on your own infrastructure. OctoCounts covers the public-GitHub, share-the-result side of that split.

Does OctoCounts replace tokei?

No — it wraps tokei for one workflow. OctoCounts downloads a public GitHub repository's archive, runs tokei, and adds commit pinning, caching, shareable URLs, badges, JSON/text/PNG export, an API, and browser extensions. tokei itself is unchanged: install it with cargo install tokei or a package manager and count anything on your machine, private code included.

Related reading