AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
git-native package and build tool for modern C++20 modules.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
Cargo-inspired, Git-native package and build tool for modern C++20 modules.
C++ has modules now. It deserves a build tool that knows it.
cmod brings Cargo's reliability and Go's simplicity to C++20 — without a central registry.README 전문 보기 ↗Cargo-inspired, Git-native package and build tool for modern C++20 modules.
C++ has modules now. It deserves a build tool that knows it. cmod brings Cargo's reliability and Go's simplicity to C++20 — without a central registry.
init, add, build — and gets out of the way.clang-scan-deps for automatic module dependency discoveryinit to sbom, covering the full development lifecyclecurl -sSf https://raw.githubusercontent.com/satishbabariya/cmod/main/install.sh | sh
Or install a specific version:
curl -sSf https://raw.githubusercontent.com/satishbabariya/cmod/main/install.sh | sh -s -- --version v0.1.0-alpha.1
Supports Linux (x86_64, aarch64) and macOS (x86_64, Apple Silicon). For Windows, download binaries from the releases page.
git clone https://github.com/satishbabariya/cmod.git
cd cmod
cargo install --path crates/cmod-cli
cmod init my_project
cd my_project
cmod add github.com/fmtlib/fmt@^10.0
cmod add github.com/acme/math-core
cmod build
cmod test
cmod build --release
See the examples/ directory for complete working projects:
| Example | Description |
|---|---|
| hello | Minimal binary, no dependencies |
| library | Static library with module partitions |
| with-deps | Git dependencies (fmt + json) |
| workspace | Multi-member monorepo |
| path-deps | Local path dependencies |
| plugin | Plugin system |
cmod.toml is your project manifest:
[package]
name = "my_project"
version = "0.1.0"
edition = "2024"
authors = ["Your Name"]
license = "Apache-2.0"
[module]
name = "com.github.user.my_project"
root = "src/lib.cppm"
[dependencies]
"github.com/fmtlib/fmt" = "^10.0"
"github.com/acme/math-core" = "^1.2"
[toolchain]
compiler = "clang"
version = ">=17"
standard = "c++23"
[build]
type = "library"
optimization = "O2"
See docs/rfc/rfc_unified_cmod_schema.md for the full schema specification.
| Command | Description |
|---|---|
cmod init [--workspace] | Initialize a new module or workspace |
cmod build [--release] | Build the current module or workspace |
cmod test [--release] | Build and run tests |
cmod run [--release] | Build and run the project binary |
cmod clean | Remove build artifacts |
| Command | Description |
|---|---|
cmod add <dep>[@version] | Add a dependency |
cmod remove <name> | Remove a dependency |
cmod resolve | Resolve dependencies and generate lockfile |
cmod update [name] [--patch] | Update dependencies |
cmod deps [--tree] [--why <name>] | Inspect the dependency graph |
cmod tidy [--apply] | Remove unused dependencies |
cmod vendor [--sync] | Vendor dependencies for offline builds |
cmod search <query> | Search for modules by name |
| Command | Description |
|---|---|
cmod graph [--format dot|json] | Visualize the module dependency graph |
cmod explain <module> | Explain why a module would be rebuilt |
cmod plan | Output the build plan as JSON |
cmod compile-commands | Generate compile_commands.json for IDE integration |
cmod emit-cmake | Export a CMakeLists.txt for CMake interop |
cmod lint | Lint C++ source files |
cmod fmt [--check] | Format C++ source files via clang-format |
| Command | Description |
|---|---|
cmod cache status|clean|gc | Manage the build cache |
cmod cache push|pull | Sync with remote cache |
cmod verify [--signatures] | Verify integrity and security |
cmod audit | Audit dependencies for security issues |
cmod sbom [--output <file>] | Generate a Software Bill of Materials |
| Command | Description |
|---|---|
cmod workspace list|add|remove | Manage workspace members |
cmod status | Show project status overview |
cmod check | Validate module naming and structure |
cmod publish [--dry-run] | Publish a release (create a Git tag) |
cmod toolchain show|check | Manage the active toolchain |
cmod plugin list|run | Manage plugins |
cmod lsp | Start the LSP server for IDE integration |
| Flag | Description |
|---|---|
--locked | Use lockfile strictly; fail if outdated |
--offline | Disable network access |
--verbose / -v | Enable verbose output |
--target <triple> | Override the target triple |
--features <list> | Enable specific features |
--no-default-features | Disable default features |
--no-cache | Skip build cache |
--untrusted | Skip TOFU trust verification |
| Code | Meaning |
|---|---|
0 | Success |
1 | Build failure |
2 | Resolution error |
3 | Security violation |
User / IDE ──► CLI ──► Dependency Resolver ──► Workspace Manager
│
┌───────────────────────────────────────┘
▼
Build Orchestrator ──► LLVM/Clang ──► Artifact Cache ──► Security
cmod is implemented as a Rust workspace with focused crates:
| Crate | Responsibility |
|---|---|
cmod-core | Core types, config parsing, error model, cmod.toml/cmod.lock formats |
cmod-cli | CLI frontend, clap-based argument parsing, subcommand dispatch |
cmod-resolver | Git-based dependency resolution, semver solving, lockfile generation |
cmod-build | Module DAG construction, build plan IR, Clang invocation, parallel execution |
cmod-cache | Content-addressed artifact caching with SHA-256 keys |
cmod-workspace | Monorepo support, unified dependencies, cross-member builds |
cmod-security | Hash verification, signature checking, TOFU trust model |
cmod-lsp | LSP server for IDE integration — completion, diagnostics, references |
Key data flows:
cmod.toml → dependency graph → cmod.lock| Feature | cmod | CMake | Conan | vcpkg | Bazel |
|---|---|---|---|---|---|
| C++20 modules | Native | No | No | No | Partial |
| Git-native deps | Yes | No | No | No | No |
| Lockfiles | Yes | No | Partial | Partial | Yes |
| Monorepo support | Yes | Partial | No | No | Yes |
| Remote cache | Yes | No | No | No | Yes |
| Central registry | No (Git) | No | Yes | Yes | Partial |
| Setup complexity | Low | High | Medium | Medium | High |
vs CMake — cmod manages modules and dependencies; CMake generates build files. vs Conan/vcpkg — cmod is source-first and module-native; no global binary registry. vs Bazel — cmod is lightweight and Git-native; no proprietary rule language.
| Phase | Status | Deliverables |
|---|---|---|
| 0 — Foundations | Done | cmod.toml parser, Git resolver, lockfile, CLI |
| 1 — Builds | Done | LLVM/Clang backend, module DAG, build runner |
| 2 — Scale | Done | Workspace manager, local cache, cache keys |
| 3 — Distributed | Done | Remote cache protocol (HTTP), artifact push/pull, BMI distribution |
| 4 — Security | Done | GPG/SSH/Sigstore signing, TOFU trust model, --locked --verify modes |
| 5 — Ecosystem | Done | LSP server, plugin SDK with sandbox, graph visualization (ASCII/DOT/JSON) |
See CONTRIBUTING.md for development setup and guidelines.
Licensed under the Apache License 2.0.