Browser Engine Patcher

Home/Docs

CLI reference

Ten command groups, five global flags, six exit codes. Every command is safe to run twice; the only command that writes outside the working tree is cache gc.

Updated 2026-10-09Applies to 2.8.1Reading time 8 minutes

Usage

bep [global flags] <command> [command flags]
bep --help
bep <command> --help
Global flagEffect
--config PATHUse this file instead of ./bep.toml.
--profile NAMESelect a profile from the config.
--log-level LEVELerror, warn, info, debug.
--jsonMachine-readable output on stdout; progress goes to stderr.
--no-colorPlain text, no escape sequences.

Commands

CommandWhat it doesWrites
init <dir>Create a series with a starter config and two catalogue patches.new directory
fetchFetch the pinned revision and link it into the working directory.cache, bep.lock
applyApply the series in manifest order. --dry-run, --3way, --reject, --patch ID, --from-scratch, --continue.sources, lock
buildConfigure and build the target. --target, --jobs, --clean, --check.out/
verifyCompare the applied tree with the manifest. --manifest prints per-file lines.nothing
doctorReport tools, cache and disk. --json recommended for tickets.nothing
patch add, list, dropManage entries in the series manifest.series.toml
series lint and series orderCheck headers and dependency order without applying.nothing
config show and config checkPrint resolved values, or validate the file.nothing
cache path and cache gcPrint the cache root, or remove old entries. --all removes everything.cache

Exit codes

CodeMeaningTypical cause
0SuccessEverything asked for happened.
1Usage errorUnknown flag, missing argument, unreadable config.
2Patch conflictA hunk failed, a dependency is missing or a cycle exists.
3Build failedCompiler error, OOM killer, missing tool during configure.
4Verification mismatchThe tree does not match the manifest.
5Environment not readydoctor found a failure; run it first.

Codes are stable within a major version. Scripts should branch on the code and read human text from stderr only for logs.

Examples

Apply one patch while debugging

$ bep apply --patch debug-hooks --dry-run
would apply  0100-build-flags   (required by debug-hooks)
would apply  0200-debug-hooks   3 files  clean
2 patches, 0 conflicts

JSON in CI

$ bep apply --json
{"applied": 2, "skipped": 0, "conflicts": 0, "lock": "bep.lock", "duration_ms": 2411}

Rebuild after editing a patch

$ bep apply --from-scratch --patch debug-hooks
restored     0100-build-flags  (unchanged)
applied      0200-debug-hooks  3 files
$ bep build --jobs 12

--from-scratch discards the applied tree and re-applies the whole series, which is the honest way to test an edit that removes lines. Without it, apply works on the current tree and an edit that only deletes a hunk can appear to succeed while leaving the old line behind; the tool warns when a patch shrinks.

Output conventions

Environment

See the configuration page for BEP_CACHE, BEP_JOBS, BEP_PROFILE and the rest. bep --version prints the version, the short commit and the build date; include that line in every bug report.