@noanono/cmake-cli
v0.2.1
Published
Cross-platform CLI to scaffold and manage CMake C/C++ projects
Readme
cmake-cli
Cross-platform CLI to scaffold and manage CMake C/C++ projects.
Install
npm install -g cmake-cli
# or
npx cmake-cli --helpCommands
cmake-cli new <project>– scaffold a new project (use--hereto stay in current folder)cmake-cli new:component <name>– add a component under src/componentscmake-cli new:class <name>– add a class under src/classescmake-cli new:test <name>– add a test file and register itcmake-cli run– configure, build, and run the main targetcmake-cli run:tests– configure, build, and run ctestcmake-cli lint– run clang-tidy when available
Quick start
# Create a new C++ project with tests and git support
cmake-cli new SampleApp --lang cpp --git
# Navigate into the project
cd SampleApp
# Add a component (creates header + source)
cmake-cli new:component ui/Button
# Add a nested component
cmake-cli new:component networking/HttpClient
# Add a class with auto-generated skeleton
cmake-cli new:class models/User
# Add a test
cmake-cli new:test validation
# Build and run (requires CMake installed)
cmake-cli run
# Run tests
cmake-cli run:tests
# Lint code (requires clang-tidy)
cmake-cli lintGenerated Project Structure
SampleApp/
├── .cmake-cli.json # Project metadata
├── .gitignore # Git ignore rules
├── CMakeLists.txt # CMake configuration
├── README.md # Project documentation
├── main.cpp # Application entry point
├── src/
│ ├── components/
│ │ ├── ui/
│ │ │ ├── Button.h
│ │ │ └── Button.cpp
│ │ └── networking/
│ │ ├── HttpClient.h
│ │ └── HttpClient.cpp
│ └── classes/
│ └── models/
│ ├── User.h
│ └── User.cpp
└── tests/
├── default_test.cpp
└── test_validation.cppOptions
--lang <c|cpp>choose language (default: cpp)--std <standard>set C or C++ standard (defaults: C17, C++20)--no-testsskip test scaffolding--no-srcskip src directory--hereuse current directory instead of creating a new one--forceoverwrite existing files when safe--hpp(component/class) use.hppheaders for C++
Development
npm install
npm run build
npm link
cmake-cli --help