Fast, multi-threaded recursive codebase scanner written in Zig.
It produces:
- Language/config "utilization" stats (GitHub-like) by bytes (default) or lines
- Top largest files (bytes) including line counts
- Top longest files (lines) including byte sizes
- Zig
0.16.0(or compatible)
This project is set up to build a single executable for x86_64-windows-gnu with static linkage to the C runtime (system DLLs like kernel32.dll are still used as on any Windows program).
From the repo root:
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-windows-gnuBinary output:
zig-out\bin\code-scanner.exe
Pushing a tag like v1.2.3 triggers a GitHub Actions workflow that builds binaries for:
- Linux:
x86_64-linux-musl,aarch64-linux-musl - macOS:
x86_64-macos,aarch64-macos - Windows:
x86_64-windows-gnu
The GitHub Release includes a SHA256SUMS.txt you can use to verify downloaded artifacts.
Scan current directory:
.\zig-out\bin\code-scanner.exe .Scan a different path:
.\zig-out\bin\code-scanner.exe C:\path\to\repoExclude market data directory and CSV files:
.\zig-out\bin\code-scanner.exe . --exclude-path market_data --exclude-ext csvExclude multiple extensions/paths (comma-separated):
.\zig-out\bin\code-scanner.exe . --exclude-ext "csv,parquet" --exclude-path "market_data,dist"Count utilization by lines instead of bytes (slower; reads files):
.\zig-out\bin\code-scanner.exe . --by linesDisable built-in ignores (lock files, build/vendor dirs, etc.):
.\zig-out\bin\code-scanner.exe . --no-ignoreInclude hidden entries (dotfiles / dotdirs):
.\zig-out\bin\code-scanner.exe . --include-hiddencode-scanner [path]
[--by bytes|lines]
[--top N]
[--top-files N]
[--exclude-ext ext1,ext2]
[--exclude-path pathpart1,pathpart2]
[--no-ignore]
[--include-hidden]
Notes:
--exclude-extmatches file extensions (case-insensitive), without the dot (e.g.csv, not.csv).--exclude-pathmatches if the absolute path contains the provided substring (case-insensitive). This is simple and fast; use a distinctive folder name (e.g.market_data).- The output bars are ASCII (
#/.) to avoid terminal encoding issues on Windows.
- Summary: number of detected languages, scanned files, and total metric (bytes/lines)
- Languages: utilization table with percentages and bars
- Largest files: sorted by bytes, shows bytes + lines + path
- Longest files: sorted by lines, shows lines + bytes + path