| Crates.io | metarepo |
| lib.rs | metarepo |
| version | 0.11.0 |
| created_at | 2025-09-06 01:13:09.265172+00 |
| updated_at | 2025-11-21 23:21:37.197888+00 |
| description | A powerful multi-project management tool inspired by the meta npm package - manage multiple git repositories with ease |
| homepage | https://github.com/codyaverett/metarepo |
| repository | https://github.com/codyaverett/metarepo |
| max_upload_size | |
| id | 1826580 |
| size | 566,069 |
A Rust implementation inspired by the Node.js meta tool for managing multi-project systems and libraries.
metarepo/
├── Cargo.toml # Workspace configuration
├── docs/ # Architecture and implementation docs
│ ├── IMPLEMENTATION_PLAN.md
│ └── ARCHITECTURE.md
├── meta-core/ # Shared plugin interfaces
│ └── src/lib.rs # Plugin traits and data types
├── meta/ # Core binary crate with built-in plugins
│ ├── src/
│ │ ├── lib.rs # Main library
│ │ ├── config.rs # Configuration handling
│ │ ├── plugin.rs # Plugin system
│ │ ├── cli.rs # CLI framework
│ │ ├── main.rs # Binary entry point
│ │ └── plugins/ # Built-in plugins
│ │ ├── init/ # Initialize new meta repositories
│ │ ├── git/ # Git operations across repositories
│ │ ├── project/ # Project management (create/import)
│ │ ├── exec/ # Execute commands across repositories
│ │ ├── run/ # Run project-specific scripts from .meta
│ │ ├── rules/ # Project structure enforcement
│ │ ├── worktree/ # Git worktree management
│ │ ├── mcp/ # Model Context Protocol integration
│ │ ├── plugin_manager/ # External plugin management
│ │ └── shared/ # Shared utilities for plugins
│ └── Cargo.toml
└── README.md
.meta) parsing and validation.meta file formatInit Plugin - Initialize a new meta repository
meta init - Initialize a new meta repository.meta file with proper JSON structure.gitignore with meta-specific patternsGit Plugin - Git operations across multiple repositories
meta git clone <url> - Clone meta repo and all child repositoriesmeta git status - Show git status across all repositoriesmeta git update - Clone missing repositoriesProject Plugin - Project management operations
meta project create <path> <repo_url> - Create and clone new projectmeta project import <path> <repo_url> - Import existing projectExec Plugin - Execute commands across multiple repositories
meta exec <command> - Execute a command in all project directoriesmeta exec --projects <project1,project2> <command> - Execute in specific projectsmeta exec --include-only <patterns> <command> - Only include matching projectsmeta exec --exclude <patterns> <command> - Exclude matching projectsmeta exec --existing-only <command> - Only iterate over existing projectsmeta exec --git-only <command> - Only iterate over git repositoriesmeta exec --parallel <command> - Execute commands in parallelmeta exec --include-main <command> - Include the main meta repositorymeta exec --no-progress - Disable progress indicators (useful for CI)meta exec --streaming - Show output as it happens instead of bufferedRun Plugin - Run project-specific scripts defined in .meta
meta run <script> - Run a named script from .meta configurationmeta run --list - List all available scriptsmeta run --project <project> <script> - Run script in a specific projectmeta run --projects <project1,project2> <script> - Run in multiple projectsmeta run --all <script> - Run script in all projectsmeta run --parallel <script> - Execute scripts in parallelmeta run --env KEY=VALUE <script> - Set environment variablesmeta run --existing-only <script> - Only run in existing directoriesmeta run --git-only <script> - Only run in git repositoriesmeta run --no-progress - Disable progress indicatorsmeta run --streaming - Show output as it happensRules Plugin - Enforce project file structure rules
meta rules check - Check project structure against configured rulesmeta rules init - Initialize rules configuration file (.metarules.json)meta rules list - List all configured rulesmeta rules docs - Show documentation for creating and using rulesmeta rules create - Create a new rule interactivelymeta rules status - Show rules status for all projectsmeta rules copy <project> - Copy workspace rules to a specific projectWorktree Plugin - Git worktree management across workspace projects
meta worktree add <branch> - Create worktrees for selected projectsmeta worktree add <branch> --no-hooks - Create worktrees without running post-create commandsmeta worktree remove <worktree> - Remove worktrees from selected projectsmeta worktree list - List all worktrees across the workspacemeta worktree prune - Remove stale worktrees that no longer existworktree_init configurationPlugin Manager - Manage metarepo plugins
meta plugin add <path> - Add a plugin from a local pathmeta plugin install <name> - Install a plugin from crates.iometa plugin remove <name> - Remove an installed pluginmeta plugin list - List all installed pluginsmeta plugin update - Update all plugins to their latest versionsMCP Plugin - Model Context Protocol server management (Experimental)
Before building on Linux, ensure you have the following dependencies installed:
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y libssl-dev pkg-config
# Fedora/RHEL/CentOS
sudo dnf install openssl-devel pkg-config
# Arch Linux
sudo pacman -S openssl pkg-config
cargo build
# Show help
cargo run --bin meta -- --help
# Initialize a meta repository
cargo run --bin meta -- init
# Create a new project (clones and adds to .meta)
cargo run --bin meta -- project create my-project https://github.com/user/repo.git
# Import an existing project
cargo run --bin meta -- project import existing-dir https://github.com/user/existing.git
# Show git status across all repositories
cargo run --bin meta -- git status
# Clone missing repositories
cargo run --bin meta -- git update
# Clone a meta repository and all its children
cargo run --bin meta -- git clone https://github.com/user/meta-repo.git
# Use verbose output
cargo run --bin meta -- --verbose git status
# Execute a command in all projects
cargo run --bin meta -- exec npm install
# Execute in specific projects only
cargo run --bin meta -- exec --projects frontend,backend npm test
# Execute with filters
cargo run --bin meta -- exec --git-only git status
cargo run --bin meta -- exec --exclude node_modules,target ls -la
# Execute in parallel
cargo run --bin meta -- exec --parallel npm test
# Include main repository
cargo run --bin meta -- exec --include-main git status
# Run scripts defined in .meta
cargo run --bin meta -- run build
cargo run --bin meta -- run --list
cargo run --bin meta -- run --parallel test
# Check project structure against rules
cargo run --bin meta -- rules check
cargo run --bin meta -- rules init
cargo run --bin meta -- rules status
# Manage git worktrees
cargo run --bin meta -- worktree add feature/new-feature
cargo run --bin meta -- worktree list
cargo run --bin meta -- worktree remove feature/old-feature
# Manage plugins
cargo run --bin meta -- plugin list
cargo run --bin meta -- plugin install meta-plugin-example
cargo run --bin meta -- plugin update
# 1. Initialize a new meta repository
cargo run --bin meta -- init
# 2. Add some projects
cargo run --bin meta -- project create frontend https://github.com/user/frontend.git
cargo run --bin meta -- project create backend https://github.com/user/backend.git
# 3. Check status of all repositories
cargo run --bin meta -- git status
# 4. If someone else adds projects, update to get missing ones
cargo run --bin meta -- git update
Automatically run commands when creating worktrees (e.g., install dependencies):
{
"worktree_init": "npm ci",
"projects": {
"frontend": {
"url": "git@github.com:user/frontend.git",
"worktree_init": "pnpm install && pnpm run setup"
},
"backend": {
"url": "git@github.com:user/backend.git",
"worktree_init": "cargo build"
}
}
}
# Creates worktree and automatically runs worktree_init command
cargo run --bin meta -- worktree add feature/new-feature
# Skip post-create hooks
cargo run --bin meta -- worktree add feature/quick-test --no-hooks
New in v0.8.2: All projects now use bare repositories by default for cleaner structure!
# Simple add - uses bare repository automatically
cargo run --bin meta -- project add my-app git@github.com:user/my-app.git
This creates:
workspace/
├── my-app/
│ ├── .git/ # Bare repository
│ ├── main/ # Default branch worktree
│ └── feature-1/ # Additional worktrees
To use traditional clones, set "default_bare": false in .meta or "bare": false per-project.
See Worktree Configuration for detailed documentation.
cargo test
We welcome contributions! There are several ways to get involved:
Create issues from the command line for fast capture:
# Interactive mode
make issue-bug # Bug report with prompts
make issue-feature # Feature request with prompts
make issue-idea # Quick idea capture
# Programmatic mode (automation/AI agents)
.github/scripts/new-bug.sh "Title" "Description" "Steps" "Expected" "Actual"
echo '{"title":"..."}' | .github/scripts/new-idea.sh --json --silent
# List recent issues
make list-issues
For automation and AI agents: All scripts support JSON input, environment variables, and silent mode. See .github/scripts/README.md for details.
Use structured templates at github.com/caavere/metarepo/issues/new/choose:
Pre-commit hooks automatically check code quality before each commit, catching issues early and maintaining consistent code standards.
Install the hooks once for your local repository:
make install-hooks
This creates a pre-commit hook at .git/hooks/pre-commit that runs automatically.
The hook runs automatically at this point in your git workflow:
git add <files> # 1. Stage your changes
git commit -m "message" # 2. Hook runs HERE (before commit is created)
# 3. If hook passes, commit is created
The hook only checks staged files (files you've run git add on), not all files in your working directory.
Auto-fixes (applied automatically):
cargo fmt) - Auto-formats all Rust codeWhen auto-fixes are applied, the hook:
Validations (must pass for commit to succeed):
cargo clippy -- -D warnings) - No warnings allowed<<<<<<<, =======, >>>>>>>.yml and .yaml filesCargo.toml and other .toml filescargo-audit installed)✅ Success (all checks pass):
$ git commit -m "fix: update logic"
Running pre-commit checks...
Auto-fix checks:
▶ Formatting Rust code... ✓
▶ Removing trailing whitespace... ✓
▶ Ensuring files end with newline... ✓
Validation checks:
▶ Running clippy... ✓
▶ Checking for merge conflicts... ✓
▶ Checking for large files... ✓
▶ Running security audit... ✓
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ All pre-commit checks passed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[main abc1234] fix: update logic
🔧 Auto-fixed (changes were formatted):
$ git commit -m "feat: add feature"
Running pre-commit checks...
Auto-fix checks:
ℹ Running: cargo fmt --all
✓ Code formatted and staged
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Pre-commit checks passed (1 auto-fixes applied)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Auto-fixed files have been staged
[main def5678] feat: add feature
❌ Failure (must fix issues):
$ git commit -m "broken: bad code"
Running pre-commit checks...
Validation checks:
▶ Running clippy... ✗
Error output:
error: unused variable: `x`
--> src/main.rs:5:9
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✗ Pre-commit checks failed (1 errors)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
To fix:
1. Review the errors above
2. Fix the issues
3. Re-stage your changes: git add .
4. Commit again
To bypass (not recommended):
git commit --no-verify
Sometimes you need to commit even when checks fail. Use --no-verify (or -n):
# Skip ALL pre-commit checks
git commit --no-verify -m "wip: work in progress"
# Short form
git commit -n -m "wip: work in progress"
When to bypass:
When NOT to bypass:
Note: Even if you bypass the hook, CI will still run all checks. You'll need to fix issues before merging.
Hook not running?
# Verify hook is installed
ls -la .git/hooks/pre-commit
# Reinstall if needed
make install-hooks
Hook fails on clean code?
# Manually run the checks to see detailed output
cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings
Slow hook execution? The hook is designed to run in ~10-15 seconds. If it's slower:
cargo-audit installed)Disable hook temporarily:
# Move hook out of the way
mv .git/hooks/pre-commit .git/hooks/pre-commit.disabled
# Re-enable when ready
mv .git/hooks/pre-commit.disabled .git/hooks/pre-commit
If you prefer not to use hooks, run these commands before committing:
make fmt # Format code
make lint # Run clippy with -D warnings
make test # Run tests
make audit # Security audit
# Or run all quality checks at once
make all # Runs: fmt check test build
make install-hooks (recommended)make fmt lint testSee CONTRIBUTING.md for detailed guidelines including:
For security vulnerabilities, please follow our Security Policy. Do not create public issues for security concerns.
.meta file format with Node.js version