The Cobra vs urfave/cli comparison on OctoCounts shows side-by-side source line counts for spf13/cobra and urfave/cli, counted under the rules and on the dates stated below: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.
This page compares the source lines of code (SLOC) of spf13/cobra and urfave/cli using cached OctoCounts reports. Code size is not code quality: a larger count only means more source material, not a better or worse project.
As of 2026-10-31, spf13/cobra contains 17,133 total lines (11,516 code) across 44 files, while urfave/cli contains 35,952 total lines (26,347 code) across 96 files as of 2026-11-10. urfave/cli has about 2.3x the counted code lines of spf13/cobra under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.
| Metric | spf13/cobra | urfave/cli |
|---|---|---|
| Files | 44 | 96 |
| Total lines | 17,133 | 35,952 |
| Code lines | 11,516 | 26,347 |
| Comment lines | 2,917 | 4,864 |
| Blank lines | 2,700 | 4,741 |
| Languages counted | 4 | 7 |
Top languages in spf13/cobra: Go (99.8% of code), Makefile (0.2% of code), Markdown (0.0% of code). Top languages in urfave/cli: Go (99.0% of code), YAML (0.5% of code), Fish (0.4% of code). Go, Makefile appear in both top language lists; Markdown, Plain Text appear only in spf13/cobra's top languages; YAML, Fish, PowerShell appear only in urfave/cli's top languages.
Methodology: both counts come from cached OctoCounts reports generated with tokei. spf13/cobra was counted at ref main (commit adbc8813901b) on 2026-10-31; urfave/cli was counted at ref main (commit d5c06cb04479) on 2026-11-10. See the counting methodology for ignored directories and analysis options.
Both reports use the same engine and effective counting rules. Repository declarations, when enabled, are specific to each repository. spf13/cobra: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed. urfave/cli: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed.
Background observations recorded on 2026-09-16; language descriptions here are historical context, not claims about the current filtered shares. Use this page's measured language breakdown for current counts. Repository layout before counting filters: spf13/cobra is the Cobra repository: a library for building command-line applications in Go, including its generators and documentation. urfave/cli is the urfave/cli repository: a Go library for the same purpose — defining commands, flags, and subcommands. Both are single-purpose Go libraries, making this a relatively like-for-like comparison, counted on the dates shown above.
Both repositories are Go codebases, and the per-language tables show Go dominating both counts — two libraries in the same language addressing the same task of CLI construction.
Repository size does not indicate which library is more capable or more suitable; both expose similar command-and-flag abstractions, and the choice between them is a matter of API preference and existing ecosystem, not of line count.
Sources: spf13/cobra repository · urfave/cli repository. Statements verified 2026-09-16.
Evidence and next steps:
Saved reports remain subject to cache cleanup and replacement. Export their JSON for durable citation; live report URLs can change.
Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.
As of 2026-10-31, spf13/cobra contains 17,133 total lines (11,516 code) across 44 files, while urfave/cli contains 35,952 total lines (26,347 code) across 96 files as of 2026-11-10. urfave/cli has about 2.3x the counted code lines of spf13/cobra under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.
Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for spf13/cobra, urfave/cli, or any repository.
Methodology: both counts come from cached OctoCounts reports generated with tokei. spf13/cobra was counted at ref main (commit adbc8813901b) on 2026-10-31; urfave/cli was counted at ref main (commit d5c06cb04479) on 2026-11-10. See the counting methodology for ignored directories and analysis options.
Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.