| Crates.io | handling |
| lib.rs | handling |
| version | 0.1.0 |
| created_at | 2025-11-18 10:36:01.930511+00 |
| updated_at | 2025-11-18 16:57:00.469989+00 |
| description | Cargo extensions for binary management |
| homepage | |
| repository | https://github.com/handling-rs/handling |
| max_upload_size | |
| id | 1938164 |
| size | 100,317 |
A Cargo extension that adds cargo load and cargo unload commands for managing binary packages from custom registries and GitHub repositories.
GITHUB_TOKEN when neededcargo install handling
Or build locally:
git clone https://github.com/handling-rs/handling
cd handling
cargo install --path .
From GitHub:
cargo load example/cli
This will install the binary from https://github.com/example/cli.git
With version/ref:
cargo load example/cli@v1.2.3 # Tag
cargo load example/cli@1.2.3 # Tag (adds 'v' prefix automatically)
cargo load example/cli@fed6474 # Commit
cargo load example/cli@main # Branch
cargo load example/cli@latest # Latest
From registry:
cargo load cli # Resolves from default registry
cargo load cli --registry example # Custom registry located in https://github.com/example/handling-registry
cargo load cli --registry example/registry # Custom registry located in https://github.com/example/registry
With authentication:
cargo load cli --token ghp_xxx # Explicit token
# Or set GITHUB_TOKEN env var
Install specific binary:
cargo load cli --bin binary-name
Force reinstall:
cargo load cli --force
Use locked dependencies:
cargo load cli --locked
cargo unload cli
This wraps behind the scenes:
cargo uninstall cli
Uninstall specific binary:
cargo unload cli --bin binary-name
Default registry: github.com/handling-rs/registry
Registry structure (registry.toml):
[packages.cli]
git = "https://github.com/example/cli.git"
[packages.another]
git = "https://github.com/example/tool.git"
Custom registry:
--registry example → github.com/example/handling-registry--registry example/custom → github.com/example/customWhen you install a package by name (without /):
Default behavior (no --registry flag):
Custom registry (with --registry flag):
Examples:
# Tries handling registry first, falls back to crates.io if not found
cargo load ripgrep
# Only searches custom registry, fails if not found
cargo load my-tool --registry myorg
When you specify @version:
@vX.Y.Z or @X.Y.Z → Git tag@<7+ hex chars> → Git commit401 or 403 response:
--token provided: uses that tokenGITHUB_TOKEN env varhttps://<TOKEN>@github.com/...This works for both registry fetching (private registries) and git cloning (private repos).
Prerequisites:
Build:
cargo build --release
Install:
cargo install --path .
Test:
cargo test
cargo run --bin cargo-load -- load --help
cargo run --bin cargo-unload -- unload --help
src/
├── lib.rs # Entry point
├── bin/
│ ├── cargo-load.rs # Load binary
│ └── cargo-unload.rs # Unload binary
├── commands/
│ ├── load.rs # Load command logic
│ └── unload.rs # Unload command logic
└── core/
├── parser.rs # Spec & ref parsing
├── registry.rs # Registry resolution
├── git.rs # Git URL handling
└── http.rs # HTTP fetching
# Install from GitHub
cargo load example/cli
# Install specific version
cargo load example/cli@v1.2.3
# Install from custom registry
cargo load my-tool --registry myorg
# Install with authentication
export GITHUB_TOKEN=ghp_xxx
cargo load private-org/tool
# Install specific binary only
cargo load cli --bin binary-name
# Force reinstall
cargo load cli --force
# Use locked dependencies
cargo load cli --locked
# Uninstall
cargo unload cli
# Uninstall specific binary
cargo unload cli --bin binary-name