Skip to content

inspect

inspect queries the installed versions of system packages listed in a TOML deps file, together with OS, kernel, glibc, and compiler information. Output is valid TOML. Use -w to write jb.versions alongside jb.toml.

jbx inspect              # print system + package versions to stdout
jbx inspect -w           # also write jb.versions
jbx inspect -w ci.versions   # explicit output path

See install-deps to install the packages.


What it reports

[system]

Field Source
os /etc/os-release (NAME + VERSION_ID or BUILD_ID)
kernel uname -r
arch uname -m
glibc getconf GNU_LIBC_VERSION or ldd --version

[compiler]

Any of gcc, clang, rustc, python3, cmake found on PATH. Missing tools are silently omitted — no error if a tool isn't installed.

[group.pm]

One section per dependency group ([runtime.pacman], [dev.pacman], …), listing each package and its installed version. Packages not installed appear as a comment:

# python-foo = not installed

Sections declared with cmd instead of packages are noted but versions are not queried:

[runtime.pacman]
# cmd = sudo pacman -U /var/cache/pacman/pkg/zeromq-4.3.5-3-x86_64.pkg.tar.zst
# versions not queried for custom cmd sections

jb.versions

jb.versions records what is installed, not what should be installed. It does not pin versions or affect what install-deps installs — the package manager always installs whatever the current distro ships.

Use it to:

  • Record the exact environment a build or release was tested against
  • Detect drift between CI runs or between machines
  • Debug "works on my machine" failures by comparing jb.versions files

Example output:

# jb.versions — generated by jbx inspect 2026-05-24T10:07:23Z
# regenerate: jbx inspect -w

[system]
os = "CachyOS Linux (rolling)"
kernel = "7.0.9-1-cachyos"
arch = "x86_64"
glibc = "glibc 2.43"

[compiler]
gcc = "gcc (GCC) 16.1.1 20260430"
clang = "clang version 22.1.5"
rustc = "rustc 1.95.0 (59807616e 2026-04-14)"
python3 = "Python 3.14.5"
cmake = "cmake version 4.3.3"

[runtime.pacman]
zeromq = "4.3.5-3.1"
fftw = "3.3.11-1.1"

[dev.pacman]
base-devel = "1-2"
cmake = "4.3.3-1.1"
pkgconf = "2.5.1-1.1"
python = "3.14.5-2"
python-numpy = "2.4.6-1.1"
rust = "1:1.95.0-1.1"

CI workflow

A typical workflow commits jb.versions with each release and checks for drift on every CI run:

# 1. Install deps
jbx install-deps

# 2. Build / test
make

# 3. Record the environment (on release)
jbx inspect -w
git add jb.versions && git commit -m "chore: update jb.versions"

# 4. Check for drift on subsequent CI runs
jbx inspect | diff jb.versions - && echo "environment ok" \
    || echo "warning: environment differs from committed jb.versions"

In GitHub Actions:

- name: Install system deps
  run: jbx install-deps

- name: Check environment drift
  run: jbx inspect | diff jb.versions - || true   # warn, don't fail

- name: Update jb.versions on release
  if: startsWith(github.ref, 'refs/tags/')
  run: |
    jbx inspect -w
    git add jb.versions
    git commit -m "chore: update jb.versions for ${{ github.ref_name }}"
    git push

Project setup

Declare both install-deps and inspect in jb.toml to control default groups for each tool independently:

[project]
name    = "my_project"
version = "0.1.0"

[tools.install-deps]
source = "just-bashit:install-deps"
groups = ["runtime", "dev"]   # install-deps skips docs by default

[tools.inspect]
source = "just-bashit:inspect"
groups = ["runtime", "dev"]   # inspect also skips docs by default

[runtime.apt]
packages = ["libzmq3-dev"]

[runtime.pacman]
packages = ["zeromq"]

[dev.apt]
packages = ["build-essential", "cmake"]

[dev.pacman]
packages = ["base-devel", "cmake"]

[docs.apt]
packages = ["doxygen", "graphviz"]

[docs.pacman]
packages = ["doxygen", "graphviz"]

Version pinning

Package strings are passed verbatim to the package manager. Use native PM version syntax to pin:

[runtime.apt]
packages = ["libzmq3-dev=4.3.4-1"]   # apt: pkg=version

[runtime.dnf]
packages = ["zeromq-devel-4.3.4"]    # dnf: pkg-version

pacman has no version-pin syntax

pacman -S pkg always installs the current repo version. Use the cmd escape hatch to install from the package cache:

[runtime.pacman]
cmd = ["sudo", "pacman", "-U",
       "/var/cache/pacman/pkg/zeromq-4.3.5-3-x86_64.pkg.tar.zst"]

brew supports major-version taps (zeromq@4) but not patch-level pinning without locking to a specific formula commit.


Groups

By default inspect reports all groups defined in the deps file. To restrict which groups appear, pass -g or set [tools.inspect].groups in jb.toml (see Project setup above).

The -g flag always overrides the toml setting.


File auto-discovery

Same resolution order as install-deps:

Priority Source
1 explicit DEPS_FILE argument
2 jb-deps.toml in CWD
3 jb.toml in CWD
4 stdin

Options

Flag Long form Description
-h --help Show help and exit
-v --verbose Print resolved section and groups to stderr
-w [FILE] --write [FILE] Write output to FILE (default: jb.versions)
-s SECTION --section SECTION Override auto-detected package manager
-g GROUP --groups GROUP Comma-separated groups to inspect (overrides all defaults)

Examples

# All groups, stdout only
jbx inspect

# Write jb.versions
jbx inspect -w

# Write to a custom path
jbx inspect -w ci-$(date +%Y%m%d).versions

# Runtime packages only
jbx inspect -g runtime

# Verbose: see which section and groups were resolved
jbx inspect -v 2>&1 | head

# CI drift check (exit 0 if matching, non-zero if different)
jbx inspect | diff jb.versions -

# Pin script to a specific commit for reproducible CI output
jbx gh:just-buildit/just-bashit/src/inspect.sh@abc1234 -w