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 check-ignore

Command reference for `libra check-ignore`

Report which pathnames are excluded by .libraignore rules — the equivalent of git check-ignore, adapted to Libra's ignore file.

Intentional difference: Libra's ignore rules live in .libraignore, not .gitignore (see docs/development/commands/_compatibility.md). The matching engine, precedence, and pattern syntax are otherwise the same as Git's.

Synopsis

libra check-ignore [-v] [-n] [-z] [--no-index] <pathname>...
libra check-ignore [-v] [-n] [-z] [--no-index] --stdin

Description

For each <pathname> (given on the command line, or read from --stdin), check-ignore consults the active .libraignore rules and prints the paths that are ignored (excluded). It is a read-only query: it never changes the index or the working tree.

By default a path that is already tracked in the index is reported as not ignored (an explicit add overrides the rules). Pass --no-index to report a raw pattern match even for a tracked path — useful for debugging why a path was not ignored as expected.

Options

OptionDescriptionExample
<pathname>...One or more paths to test. Mutually exclusive with --stdin.libra check-ignore build/ a.log
--stdinRead pathnames from standard input instead of the command line (newline-separated, or NUL-separated with -z).libra check-ignore --stdin < paths.txt
-zUse NUL (\0) as the delimiter for --stdin input and for output. Safe for pathnames containing whitespace or newlines.libra check-ignore -z --stdin
-v, --verboseFor every matched path, also print the deciding rule: <source>:<line>:<pattern>\t<path>. The line number is recovered by scanning the source file.libra check-ignore -v target/
-n, --non-matchingAlso output pathnames that match no pattern (with empty source/line/pattern fields). Requires -v.libra check-ignore -v -n a.txt b.log
--no-indexDo not consult the index; report a pattern match even for a tracked path.libra check-ignore --no-index tracked.log
--json / --machineStructured output: { results: [{ path, ignored, source?, line?, pattern? }] }.libra check-ignore --json target/

Exit codes

Aligned with Git:

CodeMeaning
0At least one of the given paths is ignored.
1None of the given paths are ignored (a clean signal, not an error; no output on stderr).
128Usage error (e.g. -n without -v, paths combined with --stdin) or not inside a repository.

Output

  • Default: one ignored pathname per line (NUL-terminated with -z).
  • -v: <source>:<line>:<pattern>\t<path> per line. With -z, the four fields are NUL-separated and the record is NUL-terminated.
  • -n (with -v): non-matching paths appear with empty source/line/pattern.

Examples

# Is target/ ignored?
libra check-ignore target/

# Show the rule that ignores each path
libra check-ignore -v build/ debug.log

# Stream pathnames from another command, NUL-framed
libra ls-files --others -z | libra check-ignore -z --stdin

# Debug: would this path match a rule even though it is tracked?
libra check-ignore --no-index src/generated.rs

# Structured output for agents
libra check-ignore --json target/ node_modules/

Comparison with Git

TaskLibraGit
Check a pathlibra check-ignore target/git check-ignore target/
Show the matching rulelibra check-ignore -v target/git check-ignore -v target/
Read from stdinlibra check-ignore --stdingit check-ignore --stdin
Ignore the indexlibra check-ignore --no-index pgit check-ignore --no-index p

Not exposed (deferred): Git's --exclude, --exclude-from, --exclude-per-directory, and full pathspec magic.

libra check-attr

Command reference for `libra check-attr`

libra check-mailmap

Command reference for `libra check-mailmap`

On this page

SynopsisDescriptionOptionsExit codesOutputExamplesComparison with Git