Skip to content

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

Terminal window
# Debug build
cargo build
# Release build (recommended for daily use)
cargo build --release

Resulting binaries:

BinaryPathCrate
limetarget/release/limecrates/lime-cli/
srttarget/release/srtcrates/sandbox-runtime/

Embed a commit hash

Terminal window
GIT_SHA=$(git rev-parse --short HEAD) cargo build --release
lime --version # → "lime 0.x.y (abc1234)"

GIT_SHA is read at build time only; rebuild when you want to refresh it.

Lint and format

Terminal window
cargo fmt
cargo clippy --workspace --all-targets -- -D warnings

The clippy gate is strict (-D warnings). It’s enforced in CI and expected before any PR merges.

Tests

Terminal window
# Whole workspace
cargo test --workspace
# Targeted (per-crate)
cargo test -p runtime
cargo test -p lime-cli
cargo test -p tools
cargo test -p plugins
cargo test -p commands
cargo 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 clean between iterations.
  • cargo nextest if 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

PlatformStatus
LinuxFull support; srt enforces isolation via bwrap (Bubblewrap).
macOSFull support; srt enforces isolation via sandbox-exec.
Windowslime 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 41s

After the build

Add target/release to PATH and verify:

Terminal window
lime --version
lime status
lime sandbox # snapshot of sandbox isolation