Compile up there.Code down here.

cargo plane <command> syncs your workspace to a remote machine, runs cargo there and streams the output back.

cargo binstall cargo-plane
scroll to climb ↓
10,000 ftclimb

Choose a build machine.

Run cargo plane setup <provider> in your project to configure one. Built-in providers accept -y to skip setup prompts. For unattended Fly.io or Codespaces setup, log in first; Fly.io also needs --region.

SSH

An existing SSH host. Setup checks for rsync, a C compiler and Rust, and offers to install what's missing.

cargo plane setup ssh box

Fly.io

A per-project Fly.io Machine that starts on demand and stops itself after 15 idle minutes by default.

cargo plane setup fly

Codespaces

Creates or selects a GitHub Codespace and adds the Rust devcontainer feature. Push that change before the codespace is created or rebuilt.

cargo plane setup codespace

Local

Runs Cargo on this machine, so shared scripts can keep using cargo plane.

cargo plane setup local
22,000 ftcruise

Run Cargo on a remote machine.

cargo-plane rsyncs your workspace to the remote, respecting .gitignore and skipping target/ and .git/. It does not sync path dependencies outside the workspace.

Cargo runs over a multiplexed SSH connection, so after the first command each step costs about one round trip.

The remote keeps target/, so builds stay incremental.

~/my-app
$ cargo plane test
     Syncing my-app to box
   Compiling my-app v0.4.0
    Finished `test` profile [unoptimized + debuginfo]
     Running unittests src/lib.rs

running 42 tests
test result: ok. 42 passed; 0 failed
35,000 ftreturn leg
~/my-app
$ cargo plane run -- --my-flag
     Syncing my-app to box
    Finished `dev` profile
    Fetching 1 artifact
     Running `target/debug/my-app --my-flag`
hello from my laptop

Copy build artifacts back.

build copies binaries and cdylib/dylib/staticlib files back to your target/. run builds remotely and runs locally. Commands that edit files copy their changes back. If you also edited a file locally, your copy is kept and the remote version is saved in target/cargo-plane/conflicts/.

Paths in Cargo's output are rewritten to your local workspace. Configure rust-analyzer to use cargo plane check for remote diagnostics.

For binaries you run locally, match the CPU architecture; on Linux, the remote's glibc must be the same version as or older than yours. Requirements and limitations

45,000 ftupper air

Cargo commands and remote controls.

With a remote configured, every other Cargo command, such as check, doc or bench, runs there unchanged. These are the ones that behave differently. Pick one for details.

cargo-plane's own commands

Cargo commands with extra behaviour

60,000 ftstratosphere

Write a provider plugin.

Add a provider as a binary named cargo-plane-provider-<name>. Implement the Provider trait from cargo-plane-provider and pass it to run.

Use Host for status messages and prompts.

cargo-plane-provider-my/src/main.rs
impl Provider for MyProvider {
    type Config = Config;

    fn up(&self, c: &Config, host: &dyn Host)
        -> anyhow::Result<Endpoint> {
        host.status("Starting", &c.host);
        Ok(Endpoint::new(&c.host))
    }
    // Required methods omitted: down, status
    // Optional methods: purge, boot_timeout, setup
}

fn main() -> std::process::ExitCode {
    run(MyProvider)
}
100,000 ftnear space

Install cargo-plane.

Prebuilt binaries for Linux and macOS.

cargo binstall cargo-plane
Platforms
Linux (glibc 2.35+), macOS 15+
CPUs
x86_64, ARM64
Needs
cargo-binstall (external site, opens in a new tab), ssh, rsync
From source
cargo install cargo-plane

More projects on su6.nl