Bring the simplicity of Rust's Cargo to C.
c-init [options] [path]From source:
cargo run -- [options] [path]Add to ~/.cargo/bin:
cargo install --path .Options:
--name NAMEProject name (defaults to directory name)--cc clang|gccChoose compiler (default: clang)-s, --strictness LEVELloose | strict (default) | strictest--linter-strictness LEVELloose | strict | strictest (overrides-sfor lint only)--no-testsSkip generating tests and vendoring acutest--color WHENauto (default) | always | never--forceAllow non-empty directory--no-gitSkip git init and .gitignore--no-commitSkip initial git commit--no-helloSkip generatingsrc/main.c-i, --interactiveRun interactive wizard-h, --helpShow help
Example:
c-init my_appAn ./example project is included in this repo with the default settings so you can see the generated output.
Created project 'my_app' at my_app
Next steps:
make # debug build
make run # build+run
make watch # run in watch mode
make test # build and run tests
make release # release build
Note: make watch requires entr or watchexec to be in your $PATH.
- Strict compiler flags by default (with loose/strict/strictest levels).
- clang-tidy config wired to your chosen strictness.
- Tests scaffolded with Acutest, plus a
make testtarget. - Clean project ready for LSP.
- Sanitizer target for quick memory/UB checks.
The generated project structure:
my_app/
├── include/ # public headers
├── src/ # sources
│ └── main.c # entry point
├── target/ # build output
├── tests/
│ ├── test_basic.c # starter tests
│ ├── test-deps/ # vendored test deps
│ │ └── acutest.h # acutest single-header lib
│ └── compile_flags.txt # clangd flags for tests
├── .clang-tidy # lint config
├── compile_flags.txt # clangd/flags for app sources
├── Makefile # build + run targets
└── README.md # project guide
- Simplicity : Use tools you're familiar with.
- Sensible defaults : Everything you need to actually start coding.
- Stay out of the way : Not yet another config file in your root directory, You own your code base.
MIT