Skip to main content

cargo-mono

cargo-mono is a Cargo external subcommand (cargo mono) for monorepo-scale Rust workspace operations.

Why use cargo-mono

  • Discover and scope affected crates with deterministic workspace analysis.
  • Coordinate safe version bumps across internal dependencies.
  • Run release and publish workflows with structured operator-friendly output.

Core capabilities

  • Workspace discovery and reporting: list
  • Git-aware impact analysis: changed
  • Version orchestration and release commit automation: bump
  • Dependency-aware publish flow with optional release tag creation: publish
  • Stable output contract: --output human|json

Install

Tag contract:
  • cargo-mono@v<semver>
cargo-binstall:
cargo binstall cargo-mono --no-confirm
GitHub Actions:
- uses: taiki-e/install-action@v2
  with:
    tool: cargo-binstall
- run: cargo binstall cargo-mono --no-confirm

Common workflows

List publishable workspace crates:
cargo mono list
Find crates changed from the default base ref:
cargo mono changed
Bump changed crates with dependent patch propagation:
cargo mono bump --changed --level patch --bump-dependents
Dry-run publish for selected changed crates:
cargo mono publish --changed --dry-run
Enable publish tag creation for selected crates:
[workspace.metadata.cargo-mono.publish.tag]
packages = ["nodeup", "cargo-mono"]
When enabled, successful publish runs create local tags with <crate>@v<version> naming.

Quality and reliability

cargo-mono is validated with command-level integration tests that run against temporary git workspaces. The suite verifies:
  • Stable human and json output behavior across commands.
  • Change detection contracts, including include/exclude path filters, direct-only mode, include-uncommitted mode, and global-impact file handling.
  • Release bump behavior, including internal dependency updates, workspace dependency updates, and release commit creation without tag creation.
  • Publish safety behavior, including non-publishable crate skipping, invalid package selection errors, and allowlist-based publish tag creation.
Run from repository root:
cargo test -p cargo-mono --test cli