kixel.me

For Rust CLIs

Run Rust CLIs without compiling them

crabx <crate> runs a crates.io CLI from its author's prebuilt release, verifying the release's attestations when it has them. No toolchain, no cargo install, no waiting.

$ curl -fsSL https://crabx.kixel.me/install.sh | sh
> powershell -ExecutionPolicy Bypass -c "irm https://crabx.kixel.me/install.ps1 | iex"

Then add ~/.local/bin to your PATH if the installer says it's missing.

Then open a new terminal, which picks up crabx on your Path.

Or with npm or Cargo, then run any crate:

$ npm install -g @kixel/crabx
$ cargo install crabx
$ crabx moq-relay --help

Prebuilt for x86_64 and arm64 on Linux (glibc 2.28 or later), macOS, and Windows.

crabx moq-relay on an empty cache
$ crabx moq-relay --version
moq-relay 0.17.18
$ crabx moq-relay --help
moq-relay 0.17.18
Top-level relay configuration, loadable from CLI arguments, environment
variables, or a TOML file.

Usage: moq-relay [FLAGS] [FILE]

Arguments:
  [FILE]  If provided, load the configuration from this file.

Flags:
      --listen <LISTEN>           Listen for QUIC (UDP) on the given address.
                                  Defaults to `[::]:443`.

… 669 more lines

The first run looked up moq-relay on crates.io, fetched its author's release, and started it in 1.7 seconds; the second started from the cache in 0.01 seconds.

It runs what the author shipped

  1. 01

    Find

    Looks up the crate on crates.io and finds its binary in the release its own repository published. A third party's build needs --allow-quickinstall; a missing one is an error, and --build compiles it instead.

  2. 02

    Verify

    Checks GitHub's attestations for the archive's SHA-256 against Sigstore's or GitHub's own trust root, and requires the signer to be the crate's repository, crabx's pipeline, or GitHub's release service for that repository's tag. A bad attestation is an error, never a warning. A release with none, such as moq-relay's above, runs unverified.

  3. 03

    Cache

    Keeps the binary per crate, version, and platform, then runs it with your arguments. A pinned, cached run makes no network request; an unpinned one updates in the background.

Ship your crate's binaries

Publishing to crates.io is enough. Run crabx init once in your crate's repository: it writes one workflow that calls crabx's release pipeline, which builds every crates.io version you publish after you commit that workflow for whichever of the six platforms its release lacks, and attests those archives. The repository must be public and be the one your crate's repository field names on crates.io.

$ crabx init
wrote /home/you/mycrate/.github/workflows/binaries.yml; commit it and push it to main

Build jobs get read-only tokens; only the publishing job, which never runs your crate's code, attests archives and writes releases. See the pipeline.