Skip to content

Building & Testing

This page covers how to build clido from source, run the test suite, check code quality, and produce a release build.

The required toolchain version is pinned in rust-toolchain.toml at the repository root. rustup will pick this up automatically:

Terminal window
# Install rustup if not already installed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# rustup reads rust-toolchain.toml on first use
rustc --version
PlatformRequiredPurpose
Linuxpkg-config, libssl-devTLS for HTTP clients
macOSXcode Command Line ToolsLinker and system headers
Bothsqlite3 (usually pre-installed)Memory and index storage

On Ubuntu/Debian:

Terminal window
sudo apt install pkg-config libssl-dev

On macOS:

Terminal window
xcode-select --install
Terminal window
cargo build --workspace

The clido binary is written to target/debug/clido.

Terminal window
cargo build --workspace --release
# or
make release

The clido binary is written to target/release/clido. Release builds have LTO enabled and produce a smaller, faster binary.

Terminal window
cargo install --path crates/clido-cli

This compiles in release mode and copies clido to ~/.cargo/bin/.

Terminal window
cargo test --workspace
Terminal window
cargo test -p clido-core
cargo test -p clido-agent
Terminal window
cargo test -p clido-core -- config_file_exists_true_when_project_config_present

Integration tests live in tests/ at the workspace root:

Terminal window
cargo test --test '*'

Some integration tests require an API key:

Terminal window
ANTHROPIC_API_KEY=sk-ant-... cargo test --test integration

Integration tests that need a live API are marked #[ignore] and must be explicitly included:

Terminal window
ANTHROPIC_API_KEY=sk-ant-... cargo test --test integration -- --include-ignored
Terminal window
cargo clippy --workspace --all-targets -- -D warnings

The CI pipeline uses -D warnings so all lint warnings are treated as errors. Fix warnings before opening a PR.

Terminal window
cargo fmt --all

Check only (no changes):

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

Coverage reports use cargo-tarpaulin:

Terminal window
cargo install cargo-tarpaulin
cargo tarpaulin --workspace --out Html --output-dir target/coverage
open target/coverage/tarpaulin-report.html

::: tip Tarpaulin does not support macOS on Apple Silicon. On macOS, use cargo-llvm-cov instead:

Terminal window
cargo install cargo-llvm-cov
cargo llvm-cov --workspace --html

:::

Performance-critical code in clido-context and clido-index has Criterion benchmarks:

Terminal window
cargo bench --workspace

Results are written to target/criterion/.

GitHub Actions runs the following on every pull request:

JobCommandWhen
formatcargo fmt --all -- --checkAlways
clippycargo clippy --workspace -- -D warningsAlways
testcargo test --workspaceAlways
test (integration)cargo test --test '*' -- --include-ignoredWith secrets
build (release)cargo build --releaseOn merge to master

The workflow files are in .github/workflows/.

The Makefile provides convenience targets:

Terminal window
make build # cargo build --workspace
make release # cargo build --workspace --release
make test # cargo test --workspace
make lint # fmt check + clippy
make fmt # cargo fmt --all
make clean # cargo clean
make install # cargo install --path crates/clido-cli --force

clido does not currently use Cargo feature flags. All functionality is compiled into the binary.

Cross-compilation is not officially supported but is possible with cross:

Terminal window
cargo install cross
cross build --target aarch64-unknown-linux-gnu --release

::: warning Cross-compiled binaries have not been tested in CI. If you need a specific target, please open an issue. :::