Building from source
Lime is a Cargo workspace. The Rust toolchain is pinned by
rust-toolchain.toml at the repository root, so rustup will install the
correct version on first build automatically.
Build
# Debug buildcargo build
# Release build (recommended for daily use)cargo build --releaseResulting binaries:
| Binary | Path | Crate |
|---|---|---|
lime | target/release/lime | crates/lime-cli/ |
srt | target/release/srt | crates/sandbox-runtime/ |
Embed a commit hash
GIT_SHA=$(git rev-parse --short HEAD) cargo build --releaselime --version # → "lime 0.x.y (abc1234)"GIT_SHA is read at build time only; rebuild when you want to refresh it.
Lint and format
cargo fmtcargo clippy --workspace --all-targets -- -D warningsThe clippy gate is strict (-D warnings). It’s enforced in CI and
expected before any PR merges.
Tests
# Whole workspacecargo test --workspace
# Targeted (per-crate)cargo test -p runtimecargo test -p lime-clicargo test -p toolscargo test -p pluginscargo test -p commandscargo test -p lime-config
# A single test by name (substring match across the workspace)cargo test <test_name>Targeted tests during iteration; full workspace before sending a PR.
Faster iteration
- Incremental rebuilds — Cargo already does the right thing. Don’t
cargo cleanbetween iterations. cargo nextestif you have it installed; it parallelizes better than the built-in test runner.- Disable opt-level for dev profile if your machine is memory-bound;
cargo build(debug) is the default.
Cross-platform notes
| Platform | Status |
|---|---|
| Linux | Full support; srt enforces isolation via bwrap (Bubblewrap). |
| macOS | Full support; srt enforces isolation via sandbox-exec. |
| Windows | lime builds and runs; sandbox configuration is parsed but isolation is not applied. |
The srt binary builds on Linux and macOS. On Windows the crate
compiles, but srt is not invoked at runtime — the equivalent controls
are the permission model and exec rules.
What a fresh build looks like
$ cargo build --release Compiling lime-core v0.x.y Compiling lime-config v0.x.y Compiling lime-provider-openai v0.x.y Compiling lime-provider-anthropic v0.x.y Compiling lime-provider-gemini v0.x.y Compiling lime-provider-openai-compat v0.x.y Compiling lime-telemetry v0.x.y Compiling tools v0.x.y Compiling commands v0.x.y Compiling plugins v0.x.y Compiling runtime v0.x.y Compiling lime-cli v0.x.y Compiling sandbox-runtime v0.x.y Finished release [optimized] target(s) in 2m 41sAfter the build
Add target/release to PATH and verify:
lime --versionlime statuslime sandbox # snapshot of sandbox isolation