LibraLibra
LibraLibra
DocsBlogLibra
Getting Started
Architecture
Design
Commands
libra addlibra agentlibra alternateslibra applylibra archivelibra authlibra automationlibra bisectlibra blamelibra branchlibra bundlelibra cachelibra cat-filelibra check-attrlibra check-ignorelibra check-mailmaplibra checkoutlibra cherry-picklibra cleanlibra clonelibra cloudlibra code-controllibra codelibra commit-treelibra commitlibra completionslibra configlibra credentiallibra depslibra describelibra diff-fileslibra diff-indexlibra diff-treelibra difflibra dirtylibra fast-exportlibra fast-importlibra fetchlibra filelibra for-each-reflibra format-patchlibra fscklibra gclibra graphlibra greplibra hash-objectlibra hookslibra hydratelibra index-packlibra initlibra investigatelibra layerlibra lfslibra loglibra logfilelibra loginlibra logoutlibra ls-fileslibra ls-remotelibra ls-treelibra maintenancelibra medialibra merge-baselibra merge-filelibra mergelibra metadatalibra mvlibra noteslibra oplibra openlibra pack-objectslibra packagelibra prunelibra publishlibra pulllibra pushlibra read-treelibra rebaselibra refloglibra remotelibra repacklibra replacelibra rererelibra resetlibra restorelibra rev-listlibra rev-parselibra revertlibra reviewlibra revisionlibra rmlibra sandboxlibra servicelibra shortloglibra show-reflibra showlibra sparse-viewlibra stashlibra statslibra statuslibra switchlibra symbolic-reflibra taglibra update-indexlibra update-reflibra usagelibra verify-packlibra whoamilibra worktreelibra write-tree
API Reference
Policy
Commands

libra stats

Command reference for `libra stats`

Historical design for showing file statistics for the current working directory.

Status: unpublished. libra stats is not registered in the public CLI in the current release. Running it returns the standard unknown-command error (LBR-CLI-001). The interface below describes preserved design material, not a user-visible command contract.

The unpublished design is a Libra-only extension (it has no git equivalent). It is a read-only command that recursively scans the current working directory, counts regular files, and groups them by file extension. The .libra/ metadata directory and the target/ build directory are skipped.

Synopsis

libra stats

Description

  • Walks the current working directory recursively.
  • Counts every regular file and buckets it by extension. Files without an extension are reported under no_extension.
  • Skips the .libra/ and target/ directories.
  • Prints a human-readable summary by default, or a structured envelope with the global --json / --machine flags.

The command does not read the index or any commit; it reports the on-disk working tree exactly as it is.

Options

If this command is published in a future release, it should take no command-specific options and honor the global output flags:

FlagDescription
--json[=<FORMAT>]Emit the result as JSON (pretty, compact, or ndjson).
--machineStrict machine mode (--json=ndjson --no-pager --color=never --quiet).
--quietSuppress stdout.

Output

Human-readable:

File statistics:
total: 42
no_extension: 3
md: 7
rs: 32

JSON (--json):

{
  "total": 42,
  "extensions": {
    "md": 7,
    "no_extension": 3,
    "rs": 32
  }
}

Examples

# Count working-tree files grouped by extension
libra stats

# Structured JSON output for agents/tooling
libra stats --json

libra stash

Command reference for `libra stash`

libra status

Command reference for `libra status`

On this page

SynopsisDescriptionOptionsOutputExamples