Skip to content

CLI Reference

nolapse provides five top-level commands. Each is documented below with its synopsis, flags, and example output.


Measure current coverage and write an initial baseline.

Terminal window
nolapse init [--repo <path>] [--lang go|python] [--force]
FlagTypeDefaultDescription
--repostring. (cwd)Path to the repository root.
--langstringauto-detectLanguage runner to use: go or python.
--forceboolfalseOverwrite an existing baseline.md and nolapse.yaml.
  • .audit/coverage/baseline.md — baseline header with coverage, timestamp, and commit.
  • nolapse.yaml — configuration file with threshold defaults.
CodeMeaning
0Baseline written successfully.
Non-zeroError: git not available, test runner failed, or --force not passed when baseline exists.
Terminal window
nolapse init --repo . --lang go
Initialized baseline: .audit/coverage/baseline.md
coverage: 82.50% commit: a1b2c3d4... timestamp: 2026-01-15T09:00:00Z

Measure current coverage, compare against the baseline, and enforce thresholds.

Terminal window
nolapse run [--repo <path>] [--lang go|python] [--warn-threshold N] [--fail-threshold N] [--strict-mode]
FlagTypeDefaultDescription
--repostring. (cwd)Path to the repository root.
--langstringfrom nolapse.yamlLanguage runner to use: go or python.
--warn-thresholdfloat0.5Coverage drop (percentage points) that triggers a warn outcome.
--fail-thresholdfloat1.0Coverage drop (percentage points) that triggers a fail outcome.
--strict-modeboolfalsePromote warn → exit code 1.

Flags override the corresponding values in nolapse.yaml.

ConditionOutcomeExit code
delta > -warn_thresholdpass0
delta > -fail_threshold (and not pass)warn0 (or 1 with --strict-mode)
delta ≤ -fail_thresholdfail1
CodeMeaning
0Pass or warn outcome.
1Fail outcome (regression exceeds fail threshold) or warn with --strict-mode.
Non-zeroError: missing baseline, git error, test runner crash.
Terminal window
nolapse run --repo .
file baseline coverage PR coverage delta outcome
. 80.00% 82.30% +2.30% pass
outcome: pass delta: +2.30 coverage: 82.30% baseline: 80.00% outcome: pass
warn_threshold: 0.5 fail_threshold: 1.0
Coverage delta: +2.30% (threshold: 0.5%) pass

Append a new entry to the baseline audit trail and promote it as the active baseline.

Terminal window
nolapse baseline update [--repo <path>]
FlagTypeDefaultDescription
--repostring. (cwd)Path to the repository root.
  1. Runs the test suite to measure current coverage.

  2. Appends a pipe-delimited line to .audit/coverage/baseline.md:

    2026-02-01T14:22:00Z | 83.10% | b2c3d4e5f6...
  3. Updates the header block (coverage:, timestamp:, commit:) to the new values.

  4. Creates a git commit with the updated file.

CodeMeaning
0Baseline updated and committed.
Non-zeroError: git not available, test runner failed, nothing to commit.
Terminal window
nolapse baseline update --repo .
Baseline updated: 82.50% → 83.10%
Committed: .audit/coverage/baseline.md

Show the last 10 baseline update entries from the audit trail.

Terminal window
nolapse audit list [--repo <path>]
FlagTypeDefaultDescription
--repostring. (cwd)Path to the repository root.
CodeMeaning
0List printed successfully.
Non-zeroError: baseline file not found or unreadable.
Terminal window
nolapse audit list --repo .
TIMESTAMP COVERAGE COMMIT
2026-02-15T11:05:00Z 84.00% c3d4e5f6...
2026-02-01T14:22:00Z 83.10% b2c3d4e5...
2026-01-15T09:00:00Z 82.50% a1b2c3d4...

Print the nolapse CLI version string.

Terminal window
nolapse version

No flags accepted.

CodeMeaning
0Version printed successfully.
Terminal window
nolapse version
nolapse v0.1.0

The configuration file written by nolapse init and read by nolapse run.

lang: go # go | python
warn_threshold: -1.0 # negative float, percentage points
fail_threshold: -5.0 # negative float, percentage points
strict_mode: false # bool
KeyTypeDescription
langstringLanguage runner: go or python.
warn_thresholdfloatWarn when delta drops below this value (expressed as a negative number).
fail_thresholdfloatFail when delta drops to or below this value (expressed as a negative number).
strict_modeboolWhen true, warn outcomes exit with code 1.

Command-line flags always override nolapse.yaml values for a single invocation.


VariableDescription
NOLAPSE_RUNNER_PATHAbsolute path to coverage_runner.py. Overrides the default lookup for Python projects.