A Modern C++ Package Manager and Build System
Quick Start • Features • Installation • Documentation • Contributing
scrap is a modern development tool for C++ that brings the simplicity and power of Rust's Cargo to the C++ ecosystem. It provides a unified interface for project management, dependency handling, and build orchestration - all without the traditional complexity of C++ development.
C++ development has traditionally suffered from:
- 🔧 Complex build systems - CMake, Make, Bazel, Meson... each with its own learning curve
- 📦 No standard package manager - Unlike Rust, Go, or Node.js, C++ lacks a unified ecosystem
- 🖥️ System-dependent toolchains - "It works on my machine" is too common
- 📚 High barrier to entry - Setting up a C++ project shouldn't require a PhD
scrap solves these problems by providing:
- 🚀 Zero-configuration project setup - Get started in seconds, not hours
- 📁 Standardized project structure - Convention over configuration
- 🔄 Reproducible builds - Same toolchain, same results, everywhere
- 📦 Modern package management - GitHub-based ecosystem for sharing libraries
- 🛠️ Integrated toolchain management - No more system dependency hell
# Create a new C++ application
scrap new my-app
# Create a new C++ library
scrap new my-lib --type=lib
# Build your project
cd my-app
scrap build
# Run your application
scrap run
# Clean build artifacts
scrap cleanThat's it! No CMakeLists.txt, no Makefiles, no complex setup. scrap handles everything.
Projects are configured with a simple scrap.toml file:
[package]
name = "my-app"
version = "0.1.0"
type = "app"
std = "23"
[[bin]]
name = "my-app"
src = "src/main.cpp"
[dependencies]
fmt = "10.2.1"
boost = { version = "1.84.0", features = ["filesystem", "asio"] }Get started quickly with built-in templates:
# Use the default app template
scrap new my-project
# Use a specific template
scrap new my-game --template=game-engine
# Use a GitHub template
scrap new my-tool --template=github:user/template-repo# Install a specific toolchain
scrap toolchain install llvm@18.0.0
# List available toolchains
scrap toolchain list
# Select a toolchain for your project
scrap toolchain select gcc@13.2.0# Add a dependency
scrap add fmt
# Search for packages
scrap search boost
# Update dependencies
scrap updatescrap is in early alpha development (v0.0.1). Currently implemented:
✅ Core Features
- CLI command framework (help, version, command discovery)
- External command metadata fetching -
scrap-*executables are probed via--scrap-metadata(falling back to--help) for a plain first-line description shown inscrap --help; structured JSON/options metadata is not yet part of the protocol
🚧 In Progress
- Project creation (
scrap new) - currently a placeholder command - Template system with variable substitution
- Basic command structure (build, run, clean) - currently placeholder commands
- Configuration file parsing (
scrap.toml) - Git-based template repository integration
- Build system implementation
- Toolchain management
📅 Planned
- Package registry and dependency management
- Cross-compilation support
- IDE integrations
- CI/CD templates
- C++23 compatible compiler (GCC 13+, Clang 16+, MSVC 2022+)
- CMake 3.20 or higher
- Git
# Clone the repository
git clone https://github.com/skipbit/scrap.git
cd scrap
# Configure and build
cmake -S . -B build/release -DCMAKE_BUILD_TYPE=Release
cmake --build build/release --parallel
# The executable will be at build/release/bin/scrapsudo cp build/release/bin/scrap /usr/local/bin/Detailed documentation is being developed. For now:
scrap is building a comprehensive C++ ecosystem:
- scrap-templates - Official project templates
- scrap-packages (Coming Soon) - Package registry
- scrap-toolchains (Coming Soon) - Toolchain definitions
Our goal is to create a Homebrew-like ecosystem for C++ development, where:
- Libraries are easily discoverable and installable
- Toolchains are managed independently from the system
- Projects are reproducible across different environments
- The community can easily contribute and share packages
We welcome contributions! scrap is built with:
- Clean Architecture - Domain-driven design with clear separation of concerns
- Modern C++23 - Leveraging the latest language features
- SOLID Principles - Extensible and maintainable codebase
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Follow our coding style guide
- Commit your changes
- Push to your branch
- Open a Pull Request
# Clone with submodules
git clone --recursive https://github.com/skipbit/scrap.git
# Build in debug mode
cmake -S . -B build/debug -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON
cmake --build build/debug --parallel
# Run tests
cmake --build build/debug --target test
# Or run tests directly with ctest
ctest --test-dir build/debug --output-on-failureThe project uses GoogleTest for unit and end-to-end testing, run through ctest. Tests are automatically built when BUILD_TESTS=ON.
# Build and run all tests
cmake --build build/debug --target test
# Run tests with verbose output
ctest --test-dir build/debug --output-on-failure --verbose
# Run a specific test executable directly
./build/debug/test/scrap_gtest
./build/debug/test/scrap_gtest_cli11
./build/debug/test/scrap_e2e
# Release build testing
cmake -S . -B build/release -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
cmake --build build/release --target testTest Structure:
test/unit/command/- Unit tests for the command layertest/e2e/- End-to-end tests that spawn the builtscrapbinary as a subprocess
- ✅ Command structure (CLI framework)
- 🚧 Template system
- 🚧 Configuration management
- 🚧 Basic build system
- ⏳ Toolchain management
- ⏳ Full build system implementation
- ⏳ Dependency resolution
- ⏳ Package registry
- ⏳ Binary package distribution
- ⏳ Package publishing tools
- ⏳ Cross-compilation
- ⏳ IDE integrations
- ⏳ CI/CD templates
- ⏳ SBOM generation
scrap follows these core principles:
- Convention over Configuration - Sensible defaults that just work
- Reproducible Builds - Same input, same output, everywhere
- Modern C++ First - Built for C++17/20/23, not C++98
- Community Driven - Open source, open development
- Developer Experience - Making C++ development enjoyable
scrap is MIT licensed. See LICENSE for details.
scrap is inspired by:
- Cargo - Rust's excellent package manager
- Homebrew - The missing package manager for macOS
- Poetry - Python's modern dependency management
Special thanks to all contributors and the C++ community for feedback and support.
- GitHub Issues: Report bugs or request features
- Discussions: Join the conversation
Made with ❤️ for the C++ Community