Skip to main content
Skip to main content

b verify

Check every managed artifact (binaries and env files) against b.lock checksums. Exits with code 0 if all artifacts match, or code 1 if any mismatches are found.

Usage​

b verify [flags]

Examples​

Verify all artifacts​

b verify

Example output when everything is clean:

  jq                                       ✓
kubectl ✓
github.com/org/infra
config.yaml ✓
ingress.yaml ✓

All artifacts verified ✓

Example output with mismatches:

  jq                                       ✓
kubectl ✗ sha256 mismatch
github.com/org/infra
config.yaml ✗ sha256 mismatch (local changes)
ingress.yaml ✗ missing

FAIL: 3 artifact(s) differ from lock

Use in CI/CD​

Use b verify in CI pipelines to ensure the working tree matches the lock file:

steps:
- name: Verify artifacts
run: b verify

How it works​

For each entry in b.lock:

  • Binaries: Computes SHA-256 of the installed binary file and compares against the lock checksum. The name of the row is the name of the file in .bin, or the file: of b.yaml: a name with ./ or ../ in front is relative to the directory of b.yaml, and an absolute name is absolute. b reads only a regular file inside the project, the directory of b.yaml or .bin, or a file that a b.yaml entry installs (for example a file: outside the project). It reports another row as outside the project, the b.yaml directory and the binary directory (not read), and a directory or a FIFO as not a regular file. It follows a symlink. A dangling symlink, a symlink loop or a path through a file (plain/sub) is a missing file. When b cannot follow the path (for example, no permission), it reports the error. The project is the directory in PATH_BASE, else the root of the git repository, else the working directory.
  • Env files: Computes SHA-256 of each synced file at its destination path and compares against the lock checksum. b reads only a regular file: it reports a FIFO as not a regular file.

A mismatch means the file on disk differs from what was last synced — either due to local edits, corruption, or a missing file.

Flags​

FlagDescription
-h, --helphelp for verify

Global Flags​

FlagDescription
-c, --config stringPath to configuration file (current: /home/fentas/github/fentas/b/.bin/b.yaml)
--forceForce operations, overwriting existing binaries
-q, --quietQuiet mode
-v, --versionPrint version information and quit
Was this section helpful?