TokeiMBT: a MoonBit port of Tokei with imported language definitions and source line statistics.
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
C 1 6 4 2 0
Go 1 6 4 1 1
JavaScript 1 5 4 1 0
Python 1 6 5 1 0
Rust 1 7 6 1 0
===============================================================================
Total 5 30 23 6 1
===============================================================================git clone https://github.com/aicongli-829/TokeiMBT.git
cd TokeiMBT
moon update # fetch the Mooncakes index for moonbitlang/x
moon build --target native
# Windows binary: _build/native/debug/build/cmd/main/main.exe
moon run cmd/main -- path/to/project
moon test --target native # 47 tests, including broad delimiter smoke tests
python tools/verify_release.py # checks build, tests, language table and CLIpython .\tools\verify_release.py --upstream C:\path\to\tokei.exemoon update
moon run cmd/main -- examples/quickstart
moon run cmd/main -- -f examples/quickstart
moon run cmd/main -- -o json examples/quickstarttokei [FLAGS] [OPTIONS] [path]...
FLAGS:
-h, --help Print this help message
-V, --version Print version information
-l, --languages Print supported languages and their extensions
-f, --files Print individual file statistics beneath each language
-C, --compact Hide embedded-language detail rows in the table
--hidden Count hidden files
--no-ignore Do not respect ignore files
--no-ignore-dot Do not respect .ignore or .tokeignore
--no-ignore-vcs Do not respect .gitignore
--no-progress Compatibility flag (accepted, ignored)
OPTIONS:
-o, --output <FORMAT> Output format: table, json, csv, yaml (default: table)
-i, --input <FILE> Merge a previously saved JSON report
--output-file <FILE> Write output to FILE instead of stdout
-t, --type <LANGS> Only count the given languages (comma separated)
-T, --type-not <LANGS> Count everything except the given languages
-e, --exclude <PATTERN> Ignore files/directories matching PATTERN (repeatable)
-s, --sort <ORDER> Sort by files, lines, blanks, code, comments or language
-n, --num-format <STYLE> Format table numbers: plain, commas, dots, underscores
-c, --columns <WIDTH> Set the terminal table width (minimum 79)
-r, --reverse Reverse the sort ordermoon run cmd/main -- . # count current directory
moon run cmd/main -- -o json --output-file stats.json . # JSON report to file
moon run cmd/main -- -t rust,python -s code . # only Rust+Python, sorted by code
moon run cmd/main -- -i stats.json . # merge saved statistics with a fresh scan| Package | Responsibility |
|---|---|
| lang/ | 333 imported definitions; 201 shared definitions have basic differential fixtures |
| counter/ | per-file line-classification state machine (code/comment/blank) |
| ignore/ | ignore pattern matching for .gitignore, .ignore, .tokeignore |
| walk/ | recursive file discovery, hidden/binary filtering, language lookup |
| report/ | aggregation and sorting |
| output/ | table / JSON / CSV / YAML rendering |
| cmd/main | CLI entry point |
moon test --target native # scanner, ignore, CLI and output tests
./tools/compare_tokei.ps1 DIR # Windows: compare with upstream tokei (JSON)
tools/compare_tokei.sh DIR # Bash: same comparisonpython tools/diff_matrix.py --upstream path/to/tokei.exe
python tools/compare_structured.py --upstream path/to/tokei.exe \
--port _build/native/debug/build/cmd/main/main.exe \
tests/fixtures/embedded/sample.ipynbInstall
Download zipTokeiMBT: a MoonBit port of Tokei with imported language definitions and source line statistics.