rcloc
rcloc is a re-implementation of cloc
("count lines of code") in Rust. It accepts the same command line, reads the
same options file and language-definition files, and prints cloc's report
formats. It adds two things on top:
- Interactive mode (
rcloc --tui): an ncdu-style browser for the source tree, showing recursive blank/comment/code counts for every directory, with a per-language breakdown of the selected entry. - Version-control awareness by default: if an input directory is inside a
git, Mercurial or Subversion checkout, rcloc counts only files under version
control, the same as
cloc --vcs=git. Use--no-vcs(or--vcs=none) to walk the directory tree like plain cloc does.
It is also much faster than cloc: it counts the 112 MB cargo registry (about 6,000 files) in 0.4 s, where cloc takes 6.4 s.
Installation
Binary wheels are published on PyPI, so no Rust toolchain is needed:
pip install rcloc
pipx install rcloc and uv tool install rcloc work as well. To build
from source:
cargo install --git https://github.com/renefritze/rcloc-gui
Usage
Anything you would pass to cloc works:
rcloc .
rcloc --by-file --json src/ include/
rcloc --exclude-dir=vendor,third_party --include-lang=Rust,Python .
rcloc --diff v1.0/ v2.0/
$ rcloc --hide-rate --exclude-dir=fixtures .
github.com/renefritze/rcloc-gui v 0.1.0
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Rust 14 338 196 8280
JSON 1 0 0 7720
YAML 2 13 8 176
Markdown 1 40 0 141
TOML 2 6 0 52
Python 1 9 7 45
-------------------------------------------------------------------------------
SUM: 21 406 211 16414
-------------------------------------------------------------------------------
The command-line parser behaves like Perl's Getopt::Long as configured by
cloc: --opt=value, --opt value, single-dash long options (-by-file),
underscore spellings (--exclude_dir) and unique abbreviations
(--by-file-by) are all accepted. rcloc --help lists every option.
Interactive mode
rcloc --tui # current directory
rcloc --tui ~/src/project --exclude-lang=JSON
All filtering options apply in interactive mode too.
| Key | Action |
|---|---|
↑/↓, k/j, PgUp/PgDn, Home/End |
move |
→, l, Enter |
open directory |
←, h, Backspace |
parent directory |
c / m / b / t / f / n |
sort by code / comment / blank / total / files / name (press again to reverse) |
d |
directories first |
L |
filter all counts by one language (Esc clears) |
i |
toggle the language panel |
r |
rescan |
? |
help |
q |
quit |
Version control detection
For each input directory, rcloc looks for .git, .hg or .svn in that
directory and its parents. If it finds one, it lists files with
git ls-files, hg files or svn list -R. If a git checkout is found but
the git executable is missing, rcloc falls back to a walk that honours
.gitignore. Files named explicitly on the command line are always counted.
--vcs=git|svn|hgforces a VCS.--vcs='<command>'uses any command that prints one file per line.--no-vcs/--vcs=nonedisables detection.
--vcs=auto is the default.
Configuration files
- Options file:
~/.config/cloc/options.txtis read (or the file given with--config). It holds one option per line, with or without leading--. Options given on the command line take precedence, exactly as in cloc, so an existing cloc setup works unchanged. - Language definitions:
--read-lang-def(merge),--force-lang-def(replace) and--write-lang-defuse cloc's file format.
Compatibility with cloc
The built-in language table (extensions, file names, shebang interpreters,
comment filters, 3rd-generation scale factors) was extracted from cloc 2.13,
and every comment filter was ported, including the Regexp::Common comment
regexes and the heuristics that tell apart languages sharing an extension
(.m, .pl, .h, .inc, .ts, .v, …). Duplicate detection (MD5),
binary-file detection and the report layouts follow cloc as well.
Results were compared with cloc 1.98 on real code trees: the cargo
registry, /usr/include, the Python standard library and site-packages,
and Perl's library directories. rcloc gives exactly the same per-file
results for every language whose definition did not change between cloc
1.98 and 2.13. For Perl and Python, cloc 2.13 changed the filters (POD
handling and the order of docstring removal), and rcloc follows 2.13.
--diff output is byte-identical to cloc's on the version pairs tested.
scripts/compare_with_cloc.py repeats the comparison against any
installed cloc.
Differences:
- The report header names rcloc (
github.com/renefritze/rcloc-gui v <version>). - Counting runs in parallel;
--processes=Nsets the number of threads. - VCS detection is on by default (see above).
- Not implemented yet: counting inside archives (tar/zip inputs), git
commit or tag inputs and
--git-diff-*,--sum-reports,--sql,--html,--fmt,--use-sloccount,--unicode,--file-encoding.
Development
cargo test
python3 scripts/compare_with_cloc.py /some/source/tree --ignore-langs Perl,Python
The comparison script needs an installed cloc and a release build
(cargo build --release).
Releasing to PyPI
.github/workflows/release.yml builds wheels with
maturin for Linux (manylinux and musllinux:
x86_64, x86, aarch64, armv7, ppc64le, s390x), macOS (x86_64, arm64) and
Windows (x64, x86, arm64), plus an sdist. It runs on every pull request that
touches the packaging files, and it publishes to PyPI when a v* tag
matching the crate version is pushed. Publishing uses
trusted publishing: register
this repository, the workflow release.yml and the environment pypi as a
trusted publisher for the rcloc project on PyPI once.
License
GPL-3.0-or-later. The language definitions in data/languages.json are
derived from cloc, which is © Al Danial and licensed under the GPL (version 2
or later).
Metadata
Release files for rcloc 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rcloc-0.1.0.tar.gz | 118.4 kB | With provenance | Details for rcloc-0.1.0.tar.gz |
Built distributions (wheels)
Total release size: 23.2 MB
Release files / rcloc-0.1.0.tar.gz
| Download URL | rcloc-0.1.0.tar.gz |
|---|---|
| Size | 118.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6aec735a552e766e898e8ce5355f090924310c70f24ae9c8e9767cbe34c7254b
|
|
BLAKE2b-256 checksum How to use checksums |
1a17450ed371f53fbd987b1949d955e61a69f5138735f580c3f86e8ccb2554f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-win_arm64.whl
| Download URL | rcloc-0.1.0-py3-none-win_arm64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | Python 3 Windows ARM64 |
|
SHA-256 checksum How to use checksums |
b6e3ed01a21b4e7f14caae6b6384a331d327d609a5e5d8354e5326347ec6bc6b
|
|
BLAKE2b-256 checksum How to use checksums |
368f7f2f95e365824f910b200647198aa5294c25ccf553cb0a29d63094821a05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-win_amd64.whl
| Download URL | rcloc-0.1.0-py3-none-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8bef8afd76b1bee84fbc089343a90a843b6a2790833d8067322a7e1c8c2d223a
|
|
BLAKE2b-256 checksum How to use checksums |
62e0539937555784434676570504876828dc5bd8f0e0308d02e01dcbacdceaaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-win32.whl
| Download URL | rcloc-0.1.0-py3-none-win32.whl |
|---|---|
| Size | 1.5 MB |
| Tags | Python 3 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
344d02e4721639aa79d267a086e176362bf22b17872e1a6440ec7a52526d32cf
|
|
BLAKE2b-256 checksum How to use checksums |
1665e060e4a1be3972e039fbd328de33ace9a509acf5bd1f82d28fd457f2b91d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-musllinux_1_2_x86_64.whl
| Download URL | rcloc-0.1.0-py3-none-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
19cca07f263c5fe66296ee6beb57f81b24e7556d6e89adbeedf74f3ee00106bc
|
|
BLAKE2b-256 checksum How to use checksums |
357283a40309273eda4fb605f428321dcaa06bbbf8cfcd317aca9dc77ea6a8ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-musllinux_1_2_armv7l.whl
| Download URL | rcloc-0.1.0-py3-none-musllinux_1_2_armv7l.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Linux musl 1.2+ ARMv7l Python 3 |
|
SHA-256 checksum How to use checksums |
35fdfd1a79d9d01b6787df6be4a2636c80c07d565857be2fb7aa7f3ec0c74523
|
|
BLAKE2b-256 checksum How to use checksums |
62869bb62bbf672602d3b00f3d23756fa66d039357c4deee68623ada43e7b084
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-musllinux_1_2_aarch64.whl
| Download URL | rcloc-0.1.0-py3-none-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Linux musl 1.2+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
d1a90832ac9c475ed0c95869163932699fe1768e292df62c924c921ae019903e
|
|
BLAKE2b-256 checksum How to use checksums |
44d8c589a323fd601f6bc8e72b7d980b14519e2f0ecde3e35cd179f79976d05f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | rcloc-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
4e48d8afb9b74468937f99970ad340a85c90ed87941c94eddaf1400a5c6f6286
|
|
BLAKE2b-256 checksum How to use checksums |
9e7b77eea1911912cc59adc0d9033467713d0fef199c9d02ce0849de81aa55f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-manylinux2014_s390x.manylinux_2_17_s390x.whl
| Download URL | rcloc-0.1.0-py3-none-manylinux2014_s390x.manylinux_2_17_s390x.whl |
|---|---|
| Size | 1.8 MB |
| Tags | Linux glibc 2.17+ IBM System/390x Python 3 |
|
SHA-256 checksum How to use checksums |
008194cd144352043bb6234c81a726b65abb688280ace312ef4718a6b5fa8cab
|
|
BLAKE2b-256 checksum How to use checksums |
9b3a491041ef6d6cb6d1efa96e0ad67f5b4c16c70d416d22416f05ada51ed8e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl
| Download URL | rcloc-0.1.0-py3-none-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl |
|---|---|
| Size | 1.8 MB |
| Tags | Linux glibc 2.17+ PowerPC 64-le Python 3 |
|
SHA-256 checksum How to use checksums |
93917f06ad957a93d3aed4a24293d434363ff36b6c7279b1843fefcc309c7d43
|
|
BLAKE2b-256 checksum How to use checksums |
04fdc50718cd586a507a1cc47d253dcbb10952e7139dd49fd2b439284338e2a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-manylinux2014_i686.manylinux_2_17_i686.whl
| Download URL | rcloc-0.1.0-py3-none-manylinux2014_i686.manylinux_2_17_i686.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Linux glibc 2.17+ x86-32 Python 3 |
|
SHA-256 checksum How to use checksums |
d31e589f6845a54366b5eeb54fb612bfe1cf6998a7c15fb074e964a5a043a284
|
|
BLAKE2b-256 checksum How to use checksums |
d0bf0da9f55315727b324641907a42492948a5cd7ae155f1e77af54aeabf9317
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-manylinux2014_armv7l.manylinux_2_17_armv7l.whl
| Download URL | rcloc-0.1.0-py3-none-manylinux2014_armv7l.manylinux_2_17_armv7l.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Linux glibc 2.17+ ARMv7l Python 3 |
|
SHA-256 checksum How to use checksums |
c7226465fc9cf87254e76f07acaedca4eac7963342e995e9854d186e397e868e
|
|
BLAKE2b-256 checksum How to use checksums |
77b2201078ccb6a711048db76322caed0c2774513a6ad6e7db57ac37bb608ed3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | rcloc-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
79ce8a14addeeabb4e904af66261dcd75fcfe1466d7888548c1879a94ca915d2
|
|
BLAKE2b-256 checksum How to use checksums |
030abb9c08b46010d0d26e80775bd8aa9e9c5f7f5e777c9fce800141581ba6ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-macosx_11_0_arm64.whl
| Download URL | rcloc-0.1.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6984dc6323b1a198337a2870e751d78bcdb4f6ff74028412daba12cad3a48664
|
|
BLAKE2b-256 checksum How to use checksums |
0623fbe236e98acbe08b9bf0e52a3906853006a45ef485462b41581da50d7b43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / rcloc-0.1.0-py3-none-macosx_10_12_x86_64.whl
| Download URL | rcloc-0.1.0-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
4a4595b939b9dced366afe61c98bd298c9b04119bde65ebf6ed53b2d4310236c
|
|
BLAKE2b-256 checksum How to use checksums |
eb7d5866167d9aae6dfe0dad692f344da3d9b774e8efd1d25c5090091b0526a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logSecurity for rcloc 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 15 files in this release have been uploaded with provenance metadata.
Attestation for rcloc-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.