Skip to content

Running in CI

Terminal window
# Clean only whitelisted categories, no prompts
bekas clean --apply --non-interactive --accept-categories "docker,python,node"
# Or build a signed plan on one machine and apply it on another
bekas plan --safe-only --save plan.json
bekas clean --apply --yes-all --non-interactive --plan-file plan.json

--non-interactive requires --yes-all or --accept-categories, otherwise bekas exits with code 2.

A ready-made ci-runner profile (no quarantine, safe threshold) is part of the default config:

Terminal window
bekas --profile ci-runner clean --apply --yes-all --non-interactive
Code Meaning
0 Success
1 Invalid plan signature / aborted / generic failure
2 Invalid flag combination
3 Another bekas clean --apply is already running
4 audit --exit-code-above threshold exceeded

audit --exit-code-above <size> makes bekas cron/CI friendly: it exits with code 4 when the reclaimable total crosses the threshold, so a job step can fail or alert.

Terminal window
# Nightly: notify when >5GB reclaimable, fail the job when >10GB
bekas audit --notify
bekas audit --exit-code-above 10GB

--notify sends a desktop notification (macOS osascript, Linux notify-send) with the reclaimable total; it is best-effort and never fails the run.