Package Exports
- brbgit
Readme
brbgit
brbgit is the npm package for the BRB CLI.
It connects a local git repo to the BRB service, syncs file changes, watches for edits, and can keep registered repos syncing in the background on macOS.
The package name is brbgit, but the command you run is:
brbInstall
npm install -g brbgitThen confirm it is available:
brb helpWhat It Does
- Registers a local git repo with the BRB service
- Syncs working-tree changes to the remote repo agent
- Generates remote commits automatically after edit bursts
- Watches local repos for changes and keeps them in sync
- Runs as a macOS
launchddaemon for background syncing
Quick Start
Start from a real local git repo:
cd ~/github/sample
git statusRegister the repo with BRB:
brb init --repo sample --source ~/github/sample --base-url http://localhost:3000Push the current state:
brb sync --source ~/github/sample --base-url http://localhost:3000Start watching for changes:
brb watch --source ~/github/sample --base-url http://localhost:3000Commands
brb init
Registers the current repo, or a repo at --source, with the BRB service.
brb init [--repo <name>] [--source <path>] [--base-url <url>]Example:
brb init --repo sample --source ~/github/sample --base-url http://localhost:3000brb sync
Runs a one-off sync for a registered repo.
brb sync [--source <path>] [--message <message>] [--base-url <url>]Example:
brb sync --source ~/github/sample --base-url http://localhost:3000brb watch
Watches a registered repo and syncs changes after a quiet period.
brb watch [--source <path>] [--quiet-window-ms <ms>] [--max-batch-window-ms <ms>] [--min-resync-gap-ms <ms>] [--base-url <url>]Example:
brb watch \
--source ~/github/sample \
--base-url http://localhost:3000 \
--quiet-window-ms 5000 \
--max-batch-window-ms 30000 \
--min-resync-gap-ms 2000brb daemon run
Starts the background watcher process for every repo in the local registry.
brb daemon run [--base-url <url>] [--quiet-window-ms <ms>] [--max-batch-window-ms <ms>] [--min-resync-gap-ms <ms>]brb daemon install
Installs a macOS launchd agent that starts BRB on login and watches every registered repo.
brb daemon install [--base-url <url>] [--quiet-window-ms <ms>] [--max-batch-window-ms <ms>] [--min-resync-gap-ms <ms>]Load it with:
launchctl load -w ~/Library/LaunchAgents/com.brb.daemon.plistbrb daemon uninstall
Removes the macOS launchd agent file.
brb daemon uninstallIf it is currently loaded, unload it first:
launchctl unload -w ~/Library/LaunchAgents/com.brb.daemon.plistbrb repo create
Creates a repo on the remote BRB service.
brb repo create --name <name> [--base-url <url>]brb push
Pushes a local repo to a named remote repo in one command.
brb push --repo <name> [--source <path>] [--message <message>] [--base-url <url>]Sync Timing
brb watch and brb daemon use three timing controls:
--quiet-window-msSync after no changes for this long--max-batch-window-msForce a sync if changes keep happening for too long--min-resync-gap-msPrevent immediate back-to-back syncs
Default values:
quiet-window-ms: 5000
max-batch-window-ms: 30000
min-resync-gap-ms: 2000Environment Variables
brb reads:
BRB_BASE_URLGIT_AGENT_BASE_URLas a legacy fallback
If no URL is provided, the CLI falls back to its built-in default service URL.
Local State
Current state directory:
~/.brbThis includes:
- repo registry
- sync manifests
- daemon logs
Legacy ~/.git-agent state is still read automatically when present.
macOS Daemon Logs
When installed via launchd, logs are written to:
~/.brb/logs/daemon.out.log
~/.brb/logs/daemon.err.logRequirements
- Node.js 20+
- A real local git repo
- A running BRB service endpoint
Troubleshooting
Repo is not registered
Run:
brb init --source /path/to/repocommand not found: brb
Your global npm bin directory is probably not on PATH. Reinstall globally and ensure npm's global bin path is available in your shell.
Syncs are not happening
Check:
- the repo is registered in
~/.brb - the service URL is reachable
- the repo is being watched
- you waited past the quiet window
macOS daemon is installed but not running
Check:
launchctl list | grep com.brb.daemon
tail -f ~/.brb/logs/daemon.err.logCompatibility
- Package name:
brbgit - Primary command:
brb - Legacy command alias:
git-agent