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
# Analyze commits and recommend version bump
# Plan the release (shows order and what will be published)
# Bump versions and create commit/tag
# Full release pipeline
# Dry run to preview
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