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 ls-files

Command reference for `libra ls-files`

List tracked index entries and untracked working-tree paths.

Synopsis

libra ls-files [OPTIONS] [pathspec]...

Description

libra ls-files reads Libra's index and working tree and prints repository paths without mutating refs, the index, the worktree, or object storage. With no state filter it defaults to the cached index view, so tracked paths remain listed even when the working tree copy is modified or deleted.

This public compatibility slice supports cached listing, modified/deleted filters, stage-style output, untracked listing, .libraignore-aware filtering via --others --exclude-standard, ignored-only listing via -i/--ignored (-i -o for ignored untracked files, -i -c for tracked files matching an exclude pattern), repository-local pathspec filtering, --error-unmatch, NUL-delimited text output via -z, status tags via -t, and unmerged-only listing via -u / --unmerged. --full-name is accepted as a no-op (Libra always prints repo-root-relative paths).

Pathspecs are resolved from the caller's current working directory, not forced to the repository root. Exact-file and directory-prefix filtering are both supported; pathspecs that resolve outside the repository are rejected. The resolve-undo and sparse-checkout integration remain deferred.

Options

OptionDescription
--cachedShow cached index entries. This is the default when no state filter is provided.
--deleted, -dShow tracked paths whose working-tree file is missing.
--modified, -mShow tracked paths whose working-tree content hash differs from the index.
--stagePrint stage-style records, including conflict stages when present.
-sShort alias for stage-style output: <mode> <object> <stage>\t<path>.
--abbrev[=<n>]Abbreviate the object name to <n> hex digits in -s/--stage output. Bare --abbrev uses 7; --abbrev=<n> sets the length (the value requires the = form, so bare --abbrev never consumes a following pathspec). Libra truncates to a fixed length rather than computing the shortest unique prefix.
-tPrefix each path with a status tag: H (cached), R (removed/deleted), C (modified/changed), ? (other/untracked), M (unmerged).
-u, --unmergedShow only unmerged (conflict) entries — index stages 1/2/3 — in stage-style output.
--full-nameAccepted for Git compatibility. Libra always prints repo-root-relative paths (the git --full-name form), so this is a no-op.
--others, -oShow untracked working-tree files.
--cached, -cShow files staged in the index.
-i, --ignoredShow only the ignored set: -i -o lists ignored untracked files (the inverse of -o), -i -c lists tracked files matching an exclude pattern. Must be combined with -o/-c and needs an exclude source — --exclude-standard or an explicit -x/-X pattern (exit 128 otherwise), matching Git.
--exclude-standardWith --others, honor .libraignore rules.
-x, --exclude <pattern>Skip untracked files matching <pattern> (gitignore syntax) from the --others listing. Repeatable; supplements --exclude-standard. With -i the pattern instead defines the ignored set.
-X, --exclude-from <file>Read additional exclude patterns from <file> (one per line; # comments and blank lines skipped) and apply them like -x. Repeatable.
--error-unmatchExit with LBR-CLI-003 if any explicit pathspec matches no files in the selected result set.
--eolPrefix each cached entry with i/<eol> w/<eol> attr/<attr> line-ending info: <eol> is lf/crlf/mixed/none/-text (binary) for the index blob (i/) and the worktree file (w/). Byte-compatible with git ls-files --eol; attr/ is always empty (Libra has no .gitattributes).
-zEmit NUL-delimited text records instead of newline-delimited output. Text mode only; rejects --json / --machine.
<pathspec>...Limit output to an exact file or directory prefix. Pathspecs resolve from the current working directory.
--jsonEmit the standard Libra JSON envelope.
--machineEmit the same envelope as one compact JSON line.

Examples

libra ls-files
libra ls-files --modified
libra ls-files --deleted
libra ls-files --others
libra ls-files --others --exclude-standard
libra ls-files -o -x '*.log'              # untracked files except *.log
libra ls-files -o -X .extra-excludes      # read extra exclude patterns from a file
libra ls-files -i -o --exclude-standard   # only the ignored untracked files
libra ls-files tracked-dir
libra ls-files --others --exclude-standard others-dir
libra ls-files --error-unmatch src/lib.rs
libra ls-files -z tracked-dir
libra ls-files --stage
libra ls-files -t
libra ls-files -t --others --exclude-standard
libra ls-files -u
libra --json ls-files --modified

Human Output

Default output prints one repository path per line:

.libraignore
tracked.txt

--stage and -s print Git-style stage records:

100644 4f3c2d1a7b8c9d0e1234567890abcdef12345678 0	tracked.txt

-z keeps the same record shape but terminates each record with NUL instead of newline, which is useful for shell-safe scripting:

tracked-dir/alpha.txt\0tracked-dir/bravo.txt\0

Structured Output

--json and --machine use the standard Libra command envelope. Each entry in data includes path, hash, mode, stage, and status. Untracked entries use null for fields that do not apply:

{
  "ok": true,
  "command": "ls-files",
  "data": [
    {
      "path": "tracked.txt",
      "hash": "4f3c2d1a7b8c9d0e1234567890abcdef12345678",
      "mode": "100644",
      "stage": 0,
      "status": "modified"
    },
    {
      "path": "untracked.txt",
      "hash": null,
      "mode": null,
      "stage": null,
      "status": "other"
    }
  ]
}

Parameter Comparison: Libra vs Git vs Jujutsu

FeatureLibraGitJujutsu
Cached index listingDefault / --cachedDefault / --cachedUse status/file commands
Modified tracked files-m / --modified-m / --modifiedUse status/diff commands
Deleted tracked files-d / --deleted-d / --deletedUse status commands
Stage-style output--stage / -s--stage / -sDifferent model
Abbreviate object name--abbrev[=<n>] (fixed-length)--abbrev[=<n>] (shortest unique)N/A
Untracked files--others--othersUse status/file commands
Ignore-aware untracked--others --exclude-standardSameDifferent model
Ignored files only-i -o --exclude-standardSame (-i -c for tracked)Different model
Explicit exclude pattern-x / --exclude <pattern>-x / --excludeDifferent model
Explicit exclude file-X / --exclude-from <file>-X / --exclude-fromDifferent model
Pathspec filters<pathspec>...SupportedDifferent model
Unmatched pathspec failure--error-unmatch--error-unmatchDifferent model
Line-ending info--eol (attr/ always empty)--eolN/A
NUL output-z (text mode only)-zDifferent model
Status tags-t (H/R/C/?/M)-t (H/S/M/R/C/K/?)Different model
Unmerged entries-u / --unmerged-u / --unmergedDifferent model
Root-relative paths--full-name (always; no-op flag)--full-name (opt-in)Different model

libra logout

Command reference for `libra logout`

libra ls-remote

Command reference for `libra ls-remote`

On this page

SynopsisDescriptionOptionsExamplesHuman OutputStructured OutputParameter Comparison: Libra vs Git vs Jujutsu