Skip to main content

mainbranch (mb)

Main Branch is the system of record for businesses run with AI agents. Agents run the work. You keep the business record and the keys.

mb scaffolds, validates, and graphs the business record: plain files in a git repo you own. It starts and checks the agents you define. It hosts no model and schedules nothing.

This package is the Python entry point. Workflows, playbooks, educational content, and consumer-repo templates ship as bundled package data. Today, the day-to-day "do work" surfaces are Claude Code skills and global Codex mb-* skills grounded in the same deterministic mb facts. The mb CLI stays runtime-agnostic by design so future adapters can operate against the same business record.

The source tree keeps the engine payload in one place: repo-root .claude/. During sdist/wheel builds, setup.py copies that tree into mb/_engine/.claude/ inside the build artifact so installed wheels can resolve skills, playbooks, reference materials, lenses, and educational prompts without a source checkout.

Install

pipx install mainbranch

That puts mb on your PATH. Verify:

mb --version

Subcommands

Command What it does
mb onboard Human setup flow. Creates or connects a business repo, explains the local files/git/GitHub model, wires Claude Code and Codex guidance, verifies discovery, and prints the next start step. Supports --yes and --json for smoke tests.
mb init Scaffold a new business repo (business folders, CLAUDE.md, AGENTS.md, CODEOWNERS, git init) and wire bundled runtime guidance. One question only: business name.
mb doctor Diagnostic. Checks Claude Code, gh auth, network, librsvg, runtime wiring, and package freshness. Warns on cloud-backed finance paths and offers educational triage.
mb status Daily briefing. Summarizes repo shape, install/runtime readiness, recent brain files, recent git activity, and GitHub tasks/proposals when gh is authenticated. Supports --json.
mb start Runtime handoff. Verifies the current business repo, git, Claude Code, Codex guidance, and start-skill wiring, then prints the exact next step. Supports --json.
mb validate Frontmatter shape check across current business repo folders, with compatibility reads for old migrated surfaces where needed. Exit 1 on any fail.
mb graph Walk linked_research / linked_decisions / supersedes; emit Graphviz DOT to stdout. --open shells to dot + open.
mb similar-bets Find similar past bets and offer outcomes from repo truth.
mb checkpoint Plan or save a business-readable git checkpoint.
mb update Refresh the Main Branch engine according to install mode and repair skill links. pipx and clone installs upgrade automatically; a uv tool install upgrades only after an explicit yes; any other wheel install gets the upgrade command printed. --check dry-runs; --json emits an envelope.
mb pulse install Install an operator-owned daily pulse wrapper.
mb leads grade Grade lead batches and calculate eligible-lead CPL beside raw CPL.
mb ledger init Create the what's-working creative ledger structure.
mb automation init Create an inspectable steered-loop automation contract.
mb production plan Inspect launch/production readiness without mutating providers or repos.
mb migrate Inspect and apply numbered repo schema migrations. status, --check, and --apply support --json; --check prints privacy-safe summaries by default, with full diffs behind --diff.
mb connect Connect provider credentials without committing secrets, test provider health, inspect hygiene/identity, and report repair-safe integration status.
mb site Inspect site readiness for launch-adjacent workflows.
mb issue Draft and open privacy-safe GitHub issues from local friction.
mb think <topic> Print the /mb-think workflow invocation hint for the currently supported runtime.
mb resolve <key> Resolve a reference key from the curated library, local core files, or bundled stubs.
mb skill path <name> Print the on-disk path to a bundled skill.
mb skill validate <name> Validate bundled skill frontmatter, local references, and line-count gates.
mb skill link --repo <path> Wire or repair Claude Code skill discovery for a business repo. Future runtime adapters should get equivalent wiring commands.
mb skill repair --repo <path> Detect personal Claude Code skills that shadow Main Branch and safely back up stale Main Branch symlinks with --apply.
mb educational <topic> Print an educational triage file. Powers mb doctor's "tell me more" prompts.

Users on early 0.1.x installs must bootstrap once with pipx upgrade mainbranch before mb update exists locally. Existing business repos should run mb skill link --repo ., then mb skill repair --repo . after upgrading.

If you installed Main Branch as a Claude Code plugin, package updates do not change the plugin that Claude Code has already loaded. After updating, re-add the Main Branch plugin (claude plugin marketplace add dmthepm/mainbranch) and restart Claude Code.

Status

Main Branch is Claude Code first with supported Codex CLI guidance through generated AGENTS.md and global mb-* skills. mb onboard, mb status, mb start, and mb update are public package surfaces. Cursor, OpenClaw, Hermes, and local runtimes remain roadmap work. The schema is v1 and will evolve. The runtime boundary decision lives at decisions/2026-05-01-mb-cli-vs-agent-workflows-boundary.md; the engine master decision lives at decisions/2026-04-29-mb-vip-v0-1-0-master.md.

License

MIT.

Metadata

Release files for mainbranch 0.6.27

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mainbranch 0.6.27
File Size Uploaded Provenance Actions
mainbranch-0.6.27.tar.gz 2.3 MB With provenance Details for mainbranch-0.6.27.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mainbranch 0.6.27
File Interpreter ABI Platform Actions
mainbranch-0.6.27-py3-none-any.whl Python 3 none any Details for mainbranch-0.6.27-py3-none-any.whl

Total release size: 4.2 MB

Release files / mainbranch-0.6.27.tar.gz

Download URL mainbranch-0.6.27.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
6297ee455708e24828f77f1cde9bbc8a34cc86b092d89970ba081d96abc248b9
BLAKE2b-256 checksum
How to use checksums
ca7cb9fdaabdb931356a2cb977a9a9a4d1e44d1819a87a393c8cc9f409209704
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / mainbranch-0.6.27-py3-none-any.whl

Download URL mainbranch-0.6.27-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e757e68db4b336fad146e8bc08182f246e6e3c81a60d300e137c9a68a0876b23
BLAKE2b-256 checksum
How to use checksums
8bae2976de57413da156614fce6ebbd1c4a9cd0a2a41ce2a4fc4e6966a97c625
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for mainbranch 0.6.27

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mainbranch-0.6.27.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.27 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page