loc
The loc command scans a directory tree, detects built-in languages, and reports:
- code lines
- comment lines
- empty lines
- size in bytes
The current terminal output is a table with per-language rows, totals, and elapsed time.
Use --path for local analysis or --url to clone and analyze a remote repository directly.
Basic usage
Section titled “Basic usage”sephera loc --path .Analyze a remote repository directly:
sephera loc --url https://github.com/Reim-developer/SepheraAnalyze a repository tree URL:
sephera loc --url https://github.com/Reim-developer/Sephera/tree/master/cratesSample Output
Section titled “Sample Output”Scanning: crates
╭──────────┬──────┬─────────┬───────┬─────────╮│ Language ┆ Code ┆ Comment ┆ Empty ┆ Size ││ ┆ ┆ ┆ ┆ (bytes) │╞══════════╪══════╪═════════╪═══════╪═════════╡│ Rust ┆ 9724 ┆ 652 ┆ 1357 ┆ 358209 ││ TOML ┆ 113 ┆ 0 ┆ 11 ┆ 3493 ││ Markdown ┆ 69 ┆ 0 ┆ 35 ┆ 2980 ││ Totals ┆ 9906 ┆ 652 ┆ 1403 ┆ 364682 │╰──────────┴──────┴─────────┴───────┴─────────╯Files scanned: 88Languages detected: 3Elapsed: 3.909 ms (0.003909 s)sephera loc --path crates/sephera_core
fast table output with totals and elapsed time
Ignore patterns
Section titled “Ignore patterns”Repeat --ignore to combine multiple patterns:
sephera loc --path . --ignore target --ignore "*.snap"Patterns containing *, ?, or [ are treated as globs and matched against basenames. Other patterns are compiled as regexes and matched against normalized relative paths.
Remote refs
Section titled “Remote refs”For repo URLs, use --ref to analyze a specific branch, tag, or commit:
sephera loc --url https://github.com/Reim-developer/Sephera --ref v0.5.0--ref applies to repo URLs only. Tree URLs already encode the ref in the URL itself.
Notes on correctness
Section titled “Notes on correctness”Sephera’s scanner is byte-oriented and comment-token aware. It is designed to be fast, stable, and portable across newline styles, rather than to fully parse each language grammar.
In practice, that means:
- support for
LF,CRLF, and classicCR - support for the built-in comment styles declared in the language registry
- stable behavior across all supported language lookups
For the current language metadata source of truth, see config/languages.yml.