b update
Update binaries and sync env files. If no arguments are given, b updates all binaries and envs from the b.yaml configuration file.
Alias
u
Usage
Examples
Update all binaries and envs
If a b.yaml file is present, this command will update all binaries to their latest versions and re-sync all env files.
Update a specific binary
Update a single binary to its latest version.
Update a specific env
Pass the exact env key that b env status prints — including SSH (git@…) keys
and #label refs. The key round-trips as-is:
A ref like github.com/org/infra is a valid env key and a valid binary
provider ref. When it is configured as an env, b resolves it to the env. To
force env resolution explicitly — useful for label-less keys, or when the same
ref exists as both a binary and an env — append a #:
The
#is safe unquoted as long as there is no space before it (name#label,name#). A space before#starts a shell comment.
With the # marker you can also use a short handle — the repo name, or
org/repo — instead of the full key. b matches it against the trailing
segments of your configured env keys:
If a short handle matches more than one env, b lists the candidates and asks
you to use the fuller key.
If you type the plain https path of an SSH-keyed env (e.g. github.com/org/infra
for an env keyed git@github.com:org/infra), b updates it as an ad-hoc
binary and prints a hint pointing at the env. To target the env instead,
paste the exact key b env status prints, or use a short handle (org/infra#) —
appending # to the https path won't match, since the SSH key has no host
segment.
Scope: envs only / binaries only
Refresh vendored env content without touching the toolchain, or vice versa:
Force an update
Force an update even if the binary is already at the latest version. This is useful for re-installing a corrupted binary.
Update with merge strategy
Use the --strategy flag to control how env file updates handle local changes:
Merge strategies
| Strategy | Description |
|---|---|
replace | Overwrite local files with upstream content (default) |
client | Keep local files unchanged; only add new files from upstream |
merge | Three-way merge using the lock file as a common ancestor. Detects conflicts and prompts for resolution |
When using merge, b computes a three-way diff between:
- The base version (from
b.lock— last known good state) - The upstream version (latest from the remote repo)
- The local version (your current file on disk)
If both upstream and local have changed the same region, a conflict marker is inserted and the user is prompted to resolve it.
Env conflict warnings
When multiple env entries write to the same destination path, b warns about potential conflicts before syncing:
Dry-run
Preview what would change without writing files or updating the lock:
Rollback
Revert envs to their previous commit (from b.lock):
Group filtering
Only update envs tagged with a specific group. Groups are an env-only concept,
so --group implies --envs-only — binaries are left untouched:
Post-update hooks
Binaries configured with an onPost hook in b.yaml will run that hook after
a successful update — the same way it runs after b install. The hook only
fires when the on-disk binary actually changed (not on digest-match skips or
--dry-run).
See b install — Post-install hooks for the full list of environment variables and examples.
Failed downloads
When the download of a binary fails, b update keeps the old binary and
continues with the other binaries and the envs. Then it stops with an error
that names each binary whose download failed (exit code 1), as b install
does. When an env also fails, the error names both.
Flags
| Flag | Description |
|---|---|
--strategy | Merge strategy for env updates: replace, client, or merge |
--dry-run | Show what would change without writing files |
--rollback | Rollback envs to their previous commit from lock |
--group | Only update envs in this group (implies --envs-only) |
--envs-only | Only update envs, skip binaries |
--binaries-only | Only update binaries, skip envs |
-h, --help | help for update |
Global Flags
| Flag | Description |
|---|---|
-c, --config string | Path to configuration file (current: /home/fentas/github/fentas/b/.bin/b.yaml) |
--force | Force operations, overwriting existing binaries |
-q, --quiet | Quiet mode |
-v, --version | Print version information and quit |