cargo-governor
Machine-First, LLM-Ready, CI/CD-Native release automation tool for Rust Cargo workspaces.
Overview
cargo-governor is a command-line tool that automates the release process for Rust projects. It provides two main commands:
owners— Declarative crate ownership managementrelease— Automated version bumping, changelog generation, and publishing
Features
Owners
- Declarative Configuration: Define owners in
Cargo.tomlmetadata - Group Management: Create logical owner groups reusable across packages
- Workspace Inheritance: Default owners with package-level overrides
- Sync & Validate: Synchronize with crates.io and check for drift
Release
- Semantic Versioning: Automatic version bump detection from conventional commits
- Changelog Generation: Automatic changelog updates with commit categorization
- Workspace Support: Multi-crate workspaces with dependency ordering
- CI/CD Native: JSON output, exit codes, GitHub Actions integration
- Dry Run Mode: Preview changes without executing
Installation
Then authenticate with crates.io once:
The token is stored in ~/.cargo/credentials.toml and used automatically
by cargo-governor.
Commands
Owners Commands
# Show computed owner list
# Sync with crates.io
# Check for drift
# Dry run
Release Commands
# Normal UX:
# 1. Make changes
# 2. Commit them with Conventional Commits
# 3. Preview the full workflow
# 4. Let cargo-governor do the rest
# Advanced / recovery commands
Mutating release commands refuse dirty working trees by default, and
they also block manifest versions that drift away from the last release
tag. This keeps the default workflow simple: commit first, then let
cargo-governor own the release commit/tag/changelog work.
CHANGELOG.md entries are generated from Conventional Commit messages
since the last release tag, using the same commit range as semantic
version analysis.
Configuration
Add to your Cargo.toml:
Workspace-level defaults
[]
= ["org-bot"]
[]
= ["alice", "github:myorg:core-team"]
= ["bob", "carol", "github:myorg:maintainers"]
Package-level configuration
[]
= ["alice", "bob"]
= ["github:myorg:core-team"]
[]
= ["core", "maintainers"]
JSON Output
For CI/CD integration, use JSON output:
Response format:
Conventional Commits
Version bump detection follows conventional commits:
feat:→ minor bumpfix:→ patch bumpfeat!:orBREAKING CHANGE:→ major bump
Examples:
feat(api): add new endpoint
fix: resolve memory leak
feat!: redesign API (breaking)
CI/CD Integration
GitHub Actions
- name: Release
run: cargo-governor release publish
Note: No CARGO_REGISTRY_TOKEN needed — cargo publish uses the token
from cargo login.
Auto-detection
cargo-governor automatically detects CI environments:
- Non-interactive mode (no prompts)
- JSON output by default
- Meaningful exit codes
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 10 | Git error |
| 11 | Registry error |
| 13 | Pre-publish check failed |
License
MIT OR Apache-2.0