Documentation · Static metrics

km loc

Count lines of code

km loc [path]

Run on the current directory:

km loc

Run on a specific path:

km loc src/

Options:

FlagDescription
-v, --verboseShow summary stats (files read, unique, ignored, elapsed time)
--by-authorBreak down lines of code by git author (requires a git repository)
--format {table,json,short,terse}Output format (default: table)

Example output:

────────────────────────────────────────────────────────────────────
 Language                Files        Blank      Comment         Code
────────────────────────────────────────────────────────────────────
 Rust                        5          120           45          850
 TOML                        1            2            0           15
────────────────────────────────────────────────────────────────────
 SUM:                        6          122           45          865
────────────────────────────────────────────────────────────────────