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-attr

Command reference for `libra check-attr`

Report the .libra_attributes attributes that apply to one or more pathnames — the Libra analogue of git check-attr.

Intentional difference (see docs/development/commands/_compatibility.md decision D5): Libra does not implement the Git .gitattributes smudge/clean filter bridge. check-attr is a read-only query over .libra_attributes, not a filter driver. Libra's attribute model currently expresses a single meaningful attribute: filter (value lfs for an LFS-tracked path).

Synopsis

libra check-attr [-z] <attr>... [--] <pathname>...
libra check-attr [-z] -a | --all [--] <pathname>...
libra check-attr [-z] (<attr>... | --all) --stdin

Description

For every (pathname, attribute) pair, check-attr prints the attribute's value. The value is one of:

  • lfs — for the filter attribute when the path is LFS-tracked (.libra_attributes has a filter=lfs pattern matching it).
  • unspecified — the attribute is not set on the path.

--all reports only the attributes that are actually set on each path (today: filter: lfs for LFS-tracked paths, nothing otherwise).

The command always exits 0 on success, even when every queried attribute is unspecified; it exits 128 on a usage or repository error.

Argument forms

Because attributes and pathnames are both positional, they are disambiguated as:

  • --all: every positional argument is a pathname.
  • An explicit --: attributes precede it, pathnames follow it.
  • --stdin: positional arguments are attribute names; pathnames come from stdin.
  • Otherwise: the first positional is the attribute and the rest are pathnames (use -- for multiple attributes).

Options

OptionDescriptionExample
<attr>...Attribute names to query.libra check-attr filter a.bin
<pathname>...Paths to test (after --, or following the attribute).libra check-attr filter -- a.bin b.c
-a, --allReport every attribute set on each path.libra check-attr --all data.bin
--stdinRead pathnames from standard input.libra check-attr filter --stdin
-zNUL-delimit --stdin input and output.libra check-attr -z filter --stdin
--json / --machineStructured output: { results: [{ path, attr, value }] }.libra check-attr --json filter a.bin

Output

  • Default: <path>: <attr>: <value> per line.
  • -z: the three fields NUL-separated, each record NUL-terminated.

Examples

# Is a.bin run through the LFS filter?
libra check-attr filter a.bin
# -> a.bin: filter: lfs   (if .libra_attributes tracks *.bin)

# Query multiple attributes (use -- to separate)
libra check-attr filter text -- a.bin notes.txt

# All set attributes for a path
libra check-attr --all a.bin

# Stream pathnames from another command
libra ls-files -z | libra check-attr -z filter --stdin

# Structured output for agents
libra check-attr --json filter a.bin

Comparison with Git

TaskLibraGit
Query an attributelibra check-attr filter a.bingit check-attr filter a.bin
All attributeslibra check-attr --all a.bingit check-attr --all a.bin
From stdinlibra check-attr filter --stdingit check-attr filter --stdin

Libra recognizes only the filter attribute (mapped to LFS), and does not run smudge/clean filters. Git's --cached, --source, and arbitrary .gitattributes macros are not applicable.

libra cat-file

Command reference for `libra cat-file`

libra check-ignore

Command reference for `libra check-ignore`

On this page

SynopsisDescriptionArgument formsOptionsOutputExamplesComparison with Git