| Crates.io | porters |
| lib.rs | porters |
| version | 0.0.1 |
| created_at | 2025-11-06 07:58:42.94337+00 |
| updated_at | 2025-11-06 14:40:03.887325+00 |
| description | A universal C/C++ project manager and build orchestrator |
| homepage | https://muhammad-fiaz.github.io/Porters |
| repository | https://github.com/muhammad-fiaz/Porters |
| max_upload_size | |
| id | 1919270 |
| size | 901,570 |
A universal C/C++ project manager and build orchestrator with GitHub-integrated package publishing
Porters is a modern, production-ready project manager for C/C++ that simplifies dependency management, build orchestration, and package publishing. Inspired by Cargo but designed specifically for C/C++ ecosystems.
porters execute file.c compiles and runs instantly with automatic dependency resolutionporters.lock~/.porters/~/.porters/cache/ports/ folderporters sync with --dev and --optional flagsporters extension create scaffolds extension projects~/.porters/config.tomlBefore installing Porters, ensure you have the following tools installed:
Porters auto-detects and supports 14+ build systems. Install the ones you plan to use:
Note: You don't need to install all build systems - Porters will auto-detect and use what's available for your projects.
Note: You need to install Rust and Cargo first. See Installation Guide.
cargo install porters
# After installation, add to PATH if needed:
# Windows: [Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:USERPROFILE\.cargo\bin", "User")
# Linux/macOS: export PATH="$HOME/.cargo/bin:$PATH"
Install the latest development version directly from GitHub:
cargo install --git https://github.com/muhammad-fiaz/Porters.git
⚠️ Note: Nightly builds may contain unstable features and bugs. Use stable releases for production.
Windows:
# Clone and run installer
git clone https://github.com/muhammad-fiaz/porters
cd porters
.\install.ps1
Linux/macOS:
# Clone and run installer
git clone https://github.com/muhammad-fiaz/porters
cd porters
chmod +x install.sh
./install.sh
The installer will:
git clone https://github.com/muhammad-fiaz/porters
cd porters
cargo build --release
cargo install --path .
Download pre-built binaries from GitHub Releases
Note: Porters will automatically check if cargo bin is in your PATH on first run and show setup instructions if needed.
# Interactive project creation
porters create my-awesome-project
# Quick creation with defaults (C++, CMake, Application)
porters create my-project -y
cd your-existing-cpp-project
porters init
# Execute any C/C++ file - works immediately!
porters execute hello.c
# With arguments
porters execute main.cpp arg1 arg2
# NO porters.toml needed - works anywhere!
100% Automatic - Zero Configuration:
.c, .cpp, .cxx, .cc, .c++, .cpporters.toml if presentSee Execute Guide for detailed documentation.
porters create <name> # Create new project
porters init # Initialize existing project
porters add <package> # Add dependency
porters remove <package> # Remove dependency
porters build # Build whole project
porters execute <file> # Execute single C/C++ file (zero config!)
porters run [args] # Run compiled project executable
porters test # Run tests
porters update # Update dependencies
porters clean # Clean build artifacts
porters lock # Generate lockfile
porters vendor # Vendor dependencies
porters graph # Show dependency graph
porters publish # Publish to GitHub
porters upgrade # Update porters itself
porters run-script <name> # Run named script from config
porters <custom-command> # Run custom command from config
[project]
name = "my-project"
version = "1.0.0"
description = "My awesome C++ project"
license = "Apache-2.0"
authors = ["Your Name <you@example.com>"]
repository = "https://github.com/username/my-project"
project-type = "application" # or "library"
entry_point = "src/main"
platforms = ["windows", "macos", "linux"]
keywords = ["application", "c", "cpp"]
readme = "README.md"
# Tool version requirements (like Python's requirements.txt)
[requires]
cpp = ">=17" # C++ standard version
cmake = ">=3.20" # CMake version
gcc = ">=9.0" # GCC version
clang = ">=12.0" # Clang version (alternative to gcc)
ninja = ">=1.10" # Ninja build tool version
make = ">=4.0" # Make version
meson = ">=0.60" # Meson version
bazel = ">=5.0" # Bazel version
conan = ">=1.50" # Conan version
vcpkg = "*" # Any version of vcpkg
# Extensions to auto-install from crates.io
extensions = [
"porters-format", # Code formatter extension
"porters-lint", # Linting extension
"porters-doc" # Documentation generator
]
[dependencies]
fmt = { git = "https://github.com/fmtlib/fmt", tag = "10.1.1" }
spdlog = { git = "https://github.com/gabime/spdlog", branch = "v1.x" }
mylib = { path = "../mylib" }
[dev-dependencies]
catch2 = { git = "https://github.com/catchorg/Catch2" }
benchmark = { git = "https://github.com/google/benchmark" }
[optional-dependencies]
zlib = { git = "https://github.com/madler/zlib" }
[build]
system = "cmake"
options = ["-DBUILD_SHARED_LIBS=ON"]
[build.env]
CC = "clang"
CXX = "clang++"
# Build lifecycle scripts
[build.scripts]
pre-build = "echo Building..."
post-build = "strip build/myapp"
pre-install = "echo Installing..."
post-install = "echo Done!"
# Custom CLI commands
[[commands]]
name = "format"
description = "Format source code"
script = "clang-format -i src/**/*.cpp"
[[commands]]
name = "docs"
description = "Generate documentation"
script = "doxygen Doxyfile"
[commands.env]
DOXYGEN_OUTPUT = "docs/html"
# Named script shortcuts
[scripts]
test-all = "cargo build && cargo test"
deploy = "./deploy.sh production"
# Direct file execution configuration (OPTIONAL - works automatically)
[run]
# Extra include directories (beyond automatic dependency includes)
include-dirs = ["./include", "./extra/include"]
# Compiler flags (only if you want warnings, optimizations, etc.)
compiler-flags = ["-Wall", "-O2", "-std=c17"]
# Linker flags (only if you need extra libraries)
linker-flags = ["-lm", "-lpthread"]
# Override compiler (only if you need a specific one)
c-compiler = "clang" # Default: auto-detect
cpp-compiler = "clang++" # Default: auto-detect
Create and use extensions for custom functionality:
# From crates.io
porters extension install porters-format
# From GitHub
porters extension install my-ext --git https://github.com/user/porters-ext-myext
# From local path
porters extension install my-ext --path ./my-extension
porters extension create my-awesome-extension
# extension.toml
name = "porters-format"
version = "0.1.0"
description = "Code formatting extension"
[hooks]
post-build = "hooks/format.sh"
[[commands]]
name = "format"
description = "Format code"
script = "scripts/format.sh"
See the Extension Guide for details.
Porters natively supports and executes the following build systems with auto-detection:
porters.tomlbuild.system in porters.tomlporters install fmt --git https://github.com/fmtlib/fmt
Installs to ~/.porters/packages/
porters add fmt --git https://github.com/fmtlib/fmt
Installs to project's ports/ folder
porters sync # Regular dependencies
porters sync --dev # Include dev dependencies
porters sync --optional # Include optional dependencies
porters lock # Generate/update porters.lock
src/main.cppadd_executable()add_library()[dependencies]
winapi = { git = "...", platforms = ["windows"] }
pthread = { version = "*", platforms = ["linux", "macos"] }
export GITHUB_TOKEN=ghp_your_token
porters publish
Creates GitHub release with:
Contributions welcome! See CONTRIBUTING.md
This project is licensed under the Apache License 2.0 - see LICENSE
if you found any issues please report them at https://github.com/muhammad-fiaz/Porters/issues
Muhammad Fiaz