Overview
metis is a fast, C++20-powered pre-commit hook and CI generator. It ensures code quality before every push with zero runtime dependencies — a single static binary that replaces Python- and Node-based pre-commit frameworks.
Subcommands
| Command | Action |
|---|---|
init | Generate .metis.toml, .clang-format (plus .clang-tidy / CMakeLists.txt with --enable-* flags) |
install | Install pre-commit hook + optional CI workflows |
sync | Refresh hooks/workflows, generate missing tool configs, validate all checks |
run | Execute checks on files (staged by default, --all-files for tracked) |
install-compiler | Install a C++ compiler/toolchain |
generate-gha | Write GitHub Actions workflow to .github/workflows/metis.yml |
generate-gitlab | Write GitLab CI workflow to .gitlab-ci.yml |
test | Run ctest and optional coverage checks |
sanitizer | Run sanitizer checks (ASan, UBSan, TSan, LSan) |
deps | Check project dependencies (Conan, vcpkg, CMake FetchContent) |
build | Configure and build the project with CMake |
perf | Performance checks (build time, binary size, benchmarks); --level quick = size only, default full |
-h, --help / -v, --version | Help / version |
Global flag: -c, --config <path> (default .metis.toml). Every subcommand accepts --help for its own detailed usage.
Dependencies
| Dependency | Purpose | Version |
|---|---|---|
| tomlplusplus | Header-only TOML config file parser and serializer | v3.4.0 |
| fmt | Modern formatting library | v11.0.2 |
Both are fetched automatically at configure time via CMake's FetchContent. No system installation required.
Build
# Release build (recommended) cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build --parallel # Verify ./build/bin/metis --version # Quick smoke test ./build/bin/metis init --style google --enable-clang-tidy ./build/bin/metis run --dry-run --all-files ./build/bin/metis install
| Option | Default | Description |
|---|---|---|
METIS_BUILD_TESTS | ON | Build GoogleTest suite |
METIS_ENABLE_SANITIZERS | OFF | AddressSanitizer + UBSan (Debug only) |
METIS_USE_SYSTEM_FMT | OFF | Use system libfmt instead of FetchContent |
METIS_USE_SYSTEM_TOMLPLUSPLUS | OFF | Use system tomlplusplus instead of FetchContent |
Compiler Requirements
GCC >= 11Clang >= 14MSVC >= 2022 17.0
Install (from build): sudo cmake --install build