Overview

sniffercommit 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

CommandAction
initGenerate .sniffercommit.toml, .clang-format (plus .clang-tidy / CMakeLists.txt with --enable-* flags)
installInstall pre-commit hook + optional CI workflows
install-compilerInstall a C++ compiler/toolchain
runExecute checks on files (staged by default, --all-files for tracked)
generate-ghaWrite GitHub Actions workflow to .github/workflows/sniffercommit.yml
generate-gitlabWrite GitLab CI workflow to .gitlab-ci.yml
--version, -vPrint version and exit
--helpPrint help and exit

Global flag: --config <path> — use a non-default config file path with any subcommand.

Dependencies

DependencyPurposeVersion
tomlplusplusHeader-only TOML config file parser and serializerv3.4.0
fmtModern formatting libraryv11.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/sniffercommit --version

# Quick smoke test
./build/sniffercommit init --style google --enable-clang-tidy
./build/sniffercommit run --dry-run --all-files
./build/sniffercommit install
OptionDefaultDescription
SNIFFERCOMMIT_ENABLE_SANITIZERSOFFAddressSanitizer + UBSan (Debug only)
SNIFFERCOMMIT_USE_SYSTEM_FMTONUse system libfmt instead of FetchContent
SNIFFERCOMMIT_USE_SYSTEM_TOMLPLUSPLUSOFFUse system tomlplusplus instead of FetchContent

Compiler Requirements

Install (from build): sudo cmake --install build