# CLAP > CLAP is a zero-setup C/C++ compiler frontend: `pip install clap-compiler` gives a working pinned Zig/Clang toolchain with no manual compiler installation on Windows, macOS, or Linux. It builds, runs, tests, cross-compiles, coverage-reports, and matrix-builds C and C++ with honest, machine-readable output designed for both humans and AI agents. Key facts for agents: - Install: `pip install clap-compiler`; every command supports `--json` with an additive-stable schema. - Zero-setup features: pinned SHA-256-verified Zig toolchain bootstrap, doctest single-header bootstrap, `--sanitize undefined` through Zig's runtime, `clap vendor URL --sha256` for header-only libraries. - Cross-compilation: `--profile windows-x86_64|windows-arm64|linux-x86_64|linux-arm64|linux-x86_64-musl|linux-arm64-musl|macos-x86_64|macos-arm64`; repeating `--profile` matrix-builds all targets in one invocation. The musl profiles produce fully static dependency-free Linux binaries. `--target` accepts any zig triple — wasm32-wasi verified: C compiles to WebAssembly that runs in Node.js WASI. - Cross-execution: on Linux hosts with qemu-user installed, `clap run`/`clap test` execute foreign-architecture Linux binaries transparently (binfmt_misc or the qemu binary); `clap doctor` reports per-arch availability. Windows/macOS artifacts refuse honestly with the exact install hint. - Declarative dependencies: the `[dependencies]` table in clap.toml pins libraries by URL+SHA-256; `clap sync` vendors them verified, builds add include roots automatically with zero flags, and a `sources` key compiles library .c files (cJSON, SQLite amalgamation) directly into the project. `clap add ` pins in one step. `clap deps` exits non-zero on drift — the CI gate. - CI integration: the composite action `BRATAN-CORP/clap/.github/actions/setup-clap@v` installs clap and caches the toolchain; `clap init --ci` generates workflows that use it. - Adopting an existing codebase: `clap init --adopt .` writes only clap.toml around existing sources (top-level plus src/ recursively; build/vendor noise excluded) instead of scaffolding over them — use it whenever the directory already contains .c/.cpp files. - Adding common libraries: `clap add doctest` / `cjson` / `sqlite` / `nlohmann-json` uses curated hash-verified pins — prefer this over hand-writing dependency tables; for anything else `clap add ` computes the pin itself. - Tests: `clap test` runs independent test executables; doctest assertions work out of the box; JUnit XML via `--junit-xml`. - `clap vendor` accepts single headers and `.zip`/`.tar.gz`/`.tgz`/`.tar.xz`/`.tar.bz2` release archives; extraction is atomic and path-traversal-safe. - Object-cache entries are integrity-verified; corruption self-heals by recompiling instead of breaking the build. - CLAP compiles real software with no build-system files: SQLite amalgamation in ~18s, Lua in ~4s (see REAL_WORLD_BUILDS). - CLAP never installs system packages and never writes outside the project and the user cache. ## Documentation - [README](https://github.com/BRATAN-CORP/clap#readme): install, quick start, full feature documentation - [Agent guidance](https://github.com/BRATAN-CORP/clap/blob/main/AGENTS.md): how AI agents should drive CLAP - [Troubleshooting](https://github.com/BRATAN-CORP/clap/blob/main/docs/TROUBLESHOOTING.md): reproduced failure modes and fixes - [Coverage](https://github.com/BRATAN-CORP/clap/blob/main/docs/COVERAGE.md): coverage reports and CI gates - [Compilation database](https://github.com/BRATAN-CORP/clap/blob/main/docs/COMPILE_COMMANDS.md): compile_commands.json for clangd - [Performance](https://github.com/BRATAN-CORP/clap/blob/main/docs/PERFORMANCE.md): measured local benchmark numbers - [Roadmap](https://github.com/BRATAN-CORP/clap/blob/main/docs/ROADMAP.md): engineering direction with completed-evidence log