Crew is not a framework. It is a Dependency Manager (like npm for JavaScript or cargo for Rust) designed specifically for C and C++.
It solves the biggest headache in C++ development: Installing Libraries.
- Python 3.x: To run the
crewtool. - Git: To download packages.
- Compiler:
gcc,g++, orclangfor building your projects.
Once published, you can install it with a single command:
pip install crew-cli-
Clone the repo:
git clone https://github.com/127crew/crew.git cd crew -
Install locally:
pip install . -
Verify: Open a new terminal and type:
crew --help
If it works, you can now go to any folder and just run
crew initorcrew create.
Best for starting from scratch. Creates a folder, code, and config.
# Create a C project
python3 crew.py create my-app --template cBest if you already have code. Creates crew.json in the current folder.
cd my-existing-project
python3 crew.py init# Install a C library (stb)
python3 crew.py install https://github.com/nothings/stb.git
# Install a C++ library (nlohmann json)
python3 crew.py install https://github.com/nlohmann/json.git@v3.11.2This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
File: main.c
#include <stdio.h>
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
int main() {
printf("STB Image Version: %d\n", STBI_VERSION);
return 0;
}Build & Run:
gcc main.c -lm $(python3 crew.py flags) -o app_c
./app_cFile: main.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main() {
json j = { {"name", "Crew"}, {"awesome", true} };
std::cout << j.dump(4) << std::endl;
return 0;
}Build & Run:
g++ main.cpp $(python3 crew.py flags) -o app_cpp
./app_cppYou don't need to change your build system. Just add $(crew flags) to your compiler command. It generates the necessary -I flags (e.g., -Icrew_modules/stb).