Multilingual SDK/CLI template with Rust/C++ backends for performance-bound tasks. Production-ready starting point for building a CLI, with:
- Dev Container + VS Code defaults for Python (
ruff), Rust (rust-analyzer,clippy) and C++ (clang-format,cppcheck) pre-commithooks for formatting/lintingcommitizenfor Conventional Commits + changelog/version bumping
# Clone and rename
git clone https://github.com/YOUR_USERNAME/cli-template.git my-cli
cd my-cli
rm -rf .git && git init -b mainReplace cli-template / cli_template with your project name:
| File | What to change |
|---|---|
pyproject.toml |
name, description, [project.scripts] |
src/cli_template/ |
Rename folder to your package name |
.devcontainer/devcontainer.json |
"name" field |
native/rust/Cargo.toml |
name, version |
native/cpp/CMakeLists.txt |
project() name |
- Open folder in VS Code
- When prompted, click Reopen in Container (or run
Dev Containers: Reopen in Container) - Wait for container to build (~2-3 min first time)
pre-commit install
pre-commit install --hook-type commit-msgsrc/cli_template/ # Python CLI (main entry point)
native/rust/ # Optional Rust backend
native/cpp/ # Optional C++ backend
tests/ # Test files
scripts/ # Build/release scripts
docs/ # Documentation
python -m cli_template hello --name alicepython -m cli_template echo hello worldpython -m cli_template sum 2 3python -m cli_template info
Build the native backends and switch implementations with --impl.
- Build:
cargo build --manifest-path native/rust/Cargo.toml --release - Run:
python -m cli_template --impl rust hello --name alice - Run:
python -m cli_template --impl rust sum 2 3
- Build:
cmake -S native/cpp -B build/native-cpp -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ONcmake --build build/native-cpp
- Run:
python -m cli_template --impl cpp hello --name alice - Run:
python -m cli_template --impl cpp echo hello world
- Create a commit:
cz commit - Check your last commit message:
cz check -r HEAD - Bump version + update changelog:
cz bump