pets_tools — MusKitty Multi-Repo Management Tool
One command to manage the MusKitty browser engine's 1 main repo + 9 independent crate repositories: clone, build, test, push, publish, and scaffold new crates.
Quick Start
# 1. Load credentials (one-time per shell session)
cd D:\pets_tools
. .\env.ps1
# 2. See what's going on
pets status MusKitty
# 3. Clone everything
pets clone MusKitty
# 4. Build everything in topological order
pets build MusKitty
# 5. Run all tests
pets test MusKitty
# 6. Push all repos (with confirmation)
pets push MusKitty
# 7. Publish all crates to crates.io
pets publish MusKitty
# 8. Scaffold a new crate
pets new MusKitty css-cascade --deps muskitty-css
Or use the convenience launcher (auto-loads tokens):
.\pets.ps1 status MusKitty
.\pets.ps1 build MusKitty --release
Commands
| Command | Description |
|---|---|
pets clone <project> |
Clone all repos from GitHub |
pets pull <project> |
Fast-forward pull all repos |
pets setup <project> |
Clone + verify deps + pull (one-shot dev setup) |
pets build <project> |
Topological build (cargo check by default, --release for build) |
pets test <project> |
Run lib + integration tests, summary table |
pets push <project> |
Push all repos with confirmation (--all to skip) |
pets status <project> |
Git status overview (branch, dirty, ahead/behind) |
pets publish <project> |
Publish to crates.io in dependency order (--dry-run to preview) |
pets wpt <project> |
Run WPT semantic comparison suites against a TOML baseline |
pets fmt <project> |
Check formatting (--fix to apply) |
pets new <project> <name> |
Scaffold new crate (Cargo.toml, CI, LICENSE, scripts) |
pets run <project> <script> [args...] |
Run a user-defined command from repos.toml (npm scripts style) |
pets list <project> |
List user-defined commands defined in repos.toml |
User-defined commands (npm package.json scripts style)
The core command set above is fixed. Supplementary project/repo scripts are defined in repos.toml and run via pets run:
[]
= "cargo doc --no-deps"
= "cargo clippy --all-targets -- -D warnings"
[[]]
= "muskitty-css"
# ... existing fields ...
= { = "cargo bench" }
pets run MusKitty clippy-all # project-level script
pets run MusKitty bench --repo muskitty-css # repo-level script (falls back to project scripts)
pets list MusKitty # list all defined scripts
Scripts run via cmd /C (Windows) or sh -c (Unix), so quoting, pipes, and redirection behave as usual. The environment variables PETS_PROJECT, PETS_ROOT, PETS_SCRIPT, and PETS_REPO are injected. Trailing arguments after the script name are appended to the command string.
WPT semantic comparison
pets wpt runs a runner per configured suite, parses pass/fail counts, and compares them against a persisted TOML baseline — any increase in failures over the baseline is reported as a regression:
[]
= "cargo test --test wpt" # optional; per-repo `runner` overrides this
= "wpt/expected" # optional; default is <root>/wpt/expected
[[]]
= "muskitty-html5-parser"
# ... existing fields ...
= { = ["html5lib"], = "wpt/html5lib.toml" }
pets wpt MusKitty # run all configured suites
pets wpt MusKitty --only muskitty-html5-parser # a single crate
pets wpt MusKitty --update-baseline # record current results as the new baseline
Architecture
D:\pets_tools\
├── repos.toml ← Single source of truth: repos + dependency graph + commands + WPT config
├── env.ps1 ← Reads tokens from Windows Credential Manager
├── pets.ps1 ← Convenience launcher (auto-loads tokens)
└── src/ ← Rust CLI (binary: pets.exe)
Token Management
env.ps1 reads 3 tokens from Windows Credential Manager via C# P/Invoke (advapi32.dll!CredReadW):
| Env Var | Credential Target | Purpose |
|---|---|---|
CRATES_GIT_TOKEN |
git:https://github.com |
9 muskitty-dev/* crate repos |
MAIN_GIT_TOKEN |
gh:github.com:Ink-dark |
Ink-dark/MusKitty main repo |
CARGO_REGISTRY_TOKEN |
~/.cargo/credentials.toml |
crates.io publishing |
Tokens are never written to disk — they exist only as environment variables for the current process.
Dependency Topology
Topological levels are computed automatically from repos.toml deps fields (Kahn's algorithm):
Level 0: muskitty-dom, muskitty-css-tokenizer, muskitty-html5-tokenizer
Level 1: muskitty-css-parser, muskitty-html5-parser
Level 2: muskitty-css
Level 3: muskitty-css-values, muskitty-cssom, muskitty-selectors
Within each level, crates can be built/tested in parallel.
Build from Source
cd D:\pets_tools
cargo build --release
# Binary: target\release\pets.exe
License
Apache-2.0