Skip to main content

cppboot

cppboot scaffolds a complete, opinionated C++ project so you can start shipping code instead of wiring build systems.

pip install cppboot
cppboot -n myproj
cd myproj && make && make test

CI PyPI Python versions License

Documentation: bluesentinelsec.github.io/cppboot — including the Android (--with-android-ci), iOS (--with-ios-ci), and Web/Emscripten (--with-web-ci) package guides.


Requirements

Python 3.9 or newer
Generated projects CMake 3.20+ (3.28+ with --with-modules), a C++20 compiler, Ninja recommended

Optional tools used when present: git, clang-format, make / ninja, doxygen, ctags, GitHub CLI (gh).


Install

pip install cppboot

Upgrade:

pip install -U cppboot

Quick start

cppboot -n myproj
cd myproj
make          # Debug build
make test
./myproj --version

On Windows (Developer Command Prompt or any shell with cmake on PATH):

build.bat
build.bat test

Create a public GitHub remote in one step (requires authenticated gh):

cppboot -n myproj --github

What you get

Each project is ready for multi-platform development and release:

Area Included
Build CMake (C++20), GNU Makefile, Windows build.bat, CMakePresets.json
Versioning Root VERSION file (single source of truth) → CMake, CLI --version, release checks
Library + app Static library by default (--shared optional), thin src/main.cpp entrypoint
Sample API Version component with unit tests and a microbenchmark
Deps FetchContent (on by default): CLI11, nlohmann/json, spdlog, GoogleTest, Google Benchmark
Quality Microsoft .clang-format, Google C++ style for code, warnings-as-errors, .clangd
Docs Doxygen Doxyfile, README.md, AGENTS.md for humans and coding agents
IDE VS Code (clangd, CMake Tools, CodeLLDB, C++ TestMate), optional Vim + ctags
CI/CD GitHub Actions: multi-OS CI, sanitizers, tag/dispatch Release with zip assets; optional Android (--with-android-ci), iOS (--with-ios-ci), and Web/Emscripten (--with-web-ci) pipelines
Community CODE_OF_CONDUCT.md, CONTRIBUTING.md, SECURITY.md
Bootstrap make fmt then git init + initial commit (when tools are available)

C++20 modules: cppboot -n myproj --with-modules scaffolds module interface units (no classic include/ tree for the sample API). CI installs module-capable toolchains on Linux/macOS.


CLI

cppboot [-n NAME] [options]

Core options

Flag Default Description
-n, --name (prompt) Project / program name
--license apache-2.0 apache-2.0, mit, bsd-3-clause, gpl-3.0, lgpl-3.0, mpl-2.0, zlib, unlicense
--build-system cmake Only cmake is supported
--with-modules off C++20 modules layout
--with-android-ci off Android Prefab AAR package: android/ Gradle project, emulator device tests, Android CI + release jobs (not compatible with --with-modules)
--with-ios-ci off iOS XCFramework package: build/verify scripts, Simulator package tests, iOS CI + release jobs (not compatible with --with-modules)
--with-web-ci off Web/Emscripten package: HTML5 canvas game demo, browser tests in headless Chrome, web CI + release jobs (not compatible with --with-modules)
--shared off Shared library instead of static
--github off Create a public remote with gh and push
--output-dir . Parent directory for the new project folder
-v, --verbose off Verbose logging
--version Print cppboot version
-h, --help Help

Opt-outs (features are on unless disabled)

Flag Effect
--no-vim Skip project-local .vimrc
--no-ctags Skip Universal Ctags config / make tags
--no-vscode Skip VS Code config and CMake presets
--no-github-actions Skip CI, sanitizers, and release workflows
--no-codespaces Skip Dev Container / Codespaces config
--no-community-docs Skip CoC / CONTRIBUTING / SECURITY
--no-git Skip git init and the initial commit
--no-fmt Skip make fmt after scaffolding

Examples:

cppboot -n service --license mit
cppboot -n libdemo --shared --no-vscode
cppboot -n moddemo --with-modules
cppboot -n droidlib --with-android-ci
cppboot -n applelib --with-ios-ci
cppboot -n webgame --with-web-ci
cppboot -n portable --with-android-ci --with-ios-ci --with-web-ci
cppboot -n tool --github --output-dir ~/src

Android (--with-android-ci): adds an android/ Gradle project that packages the library as a Prefab AAR (arm/x86_64 ABIs), a consumer test app with on-device native tests, and GitHub Actions jobs that build the AAR, verify its contents, and run the tests on an emulator. Releases attach <name>-android-release-<version>.aar. Local builds need JDK 17 + the Android SDK; Gradle fetches the pinned NDK and CMake automatically.

iOS (--with-ios-ci): adds scripts that package the library as a static XCFramework (device arm64 + simulator arm64/x86_64, headers included), a Simulator test app consuming the package, and GitHub Actions jobs that build, verify, and test it. Releases attach <name>-ios-xcframework-release-<version>.zip. Local builds need macOS with Xcode command line tools.

Web (--with-web-ci): adds a game-development-oriented Emscripten scaffold — an HTML5 canvas demo built around emscripten_set_main_loop with a custom fullscreen-canvas shell (plus commented hooks for --preload-file assets and SDL2), browser tests (GoogleTest compiled to wasm) run in headless Chrome, and GitHub Actions jobs for both. Releases attach <name>-web-wasm32-release-<version>.zip containing the wasm library, headers, and the playable demo. Local builds need an activated Emscripten SDK.


Generated project workflow

After scaffolding, day-to-day commands (Unix / make):

Command Purpose
make / make debug Configure and build Debug
make release Configure and build Release
make test Unit tests (Debug)
make bench Microbenchmarks (Release)
make sanitizer ASan+UBSan (Linux-oriented)
make fmt clang-format
make doc Doxygen HTML under docs/html
make clean Remove build trees

Windows: the same targets via build.bat / build.bat release / build.bat test, etc.

Versioning: edit the root VERSION file only (e.g. 1.2.3). CMake regenerates the version API; the Release workflow requires the Git tag to match.

Releases (generated repos): push tag vX.Y.Z or run the Release workflow; multi-OS zips attach to the GitHub Release when CI succeeds.


Library usage (Python)

from pathlib import Path
from cppboot import ProjectOptions, generate_project

result = generate_project(
    ProjectOptions(
        name="myproj",
        root=Path.cwd(),
        with_git=True,
        with_fmt=True,
    )
)
print(result.project_dir)

Contributing to cppboot

Clone and develop in an editable environment:

git clone https://github.com/bluesentinelsec/cppboot.git
cd cppboot
python3 -m pip install -e ".[dev]"
python3 -m pytest -q
python3 -m ruff check src tests
python3 -m mypy

Package version is defined in src/cppboot/_version.py. Releases are cut from main with an annotated GitHub tag vX.Y.Z (must match that version); CI publishes the wheel/sdist to PyPI.

See CHANGELOG.md for release history.


License

Apache License 2.0. See LICENSE.

Metadata

Release files for cppboot 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cppboot 0.3.3
File Size Uploaded Provenance Actions
cppboot-0.3.3.tar.gz 126.2 kB With provenance Details for cppboot-0.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cppboot 0.3.3
File Interpreter ABI Platform Actions
cppboot-0.3.3-py3-none-any.whl Python 3 none any Details for cppboot-0.3.3-py3-none-any.whl

Total release size: 254.9 kB

Release files / cppboot-0.3.3.tar.gz

Download URL cppboot-0.3.3.tar.gz
Size 126.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5a51889acab6ccfd56f3ee9a72d22f45e17f63f28400a6e05972794d07a9ca8e
BLAKE2b-256 checksum
How to use checksums
c2e100e2838db60abe714ccf15ad500160bb9a1080ecb4fb6cf00b0dedb9ab91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release files / cppboot-0.3.3-py3-none-any.whl

Download URL cppboot-0.3.3-py3-none-any.whl
Size 128.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5058fe8cb048ac37c24f9e71cecc8dde0420d5310481cf83f033915043470bee
BLAKE2b-256 checksum
How to use checksums
0915c866b786dd7aeff0ad8eed8ca2f5db19138676d3b13a53e6fc3db816e392
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Security for cppboot 0.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cppboot-0.3.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page