open-index/open-npm huggingface dataset:
npm package: @noanono/cmake-cli
Description: Cross-platform CLI to scaffold and manage CMake C/C++ projects
Author: SOLER Noah
Latest version: 0.2.1

# cmake-cli

Cross-platform CLI to scaffold and manage CMake C/C++ projects.

## Install

```
npm install -g cmake-cli
# or
npx cmake-cli --help
```

## Commands

- `cmake-cli new <project>` – scaffold a new project (use `--here` to stay in current folder)
- `cmake-cli new:component <name>` – add a component under src/components
- `cmake-cli new:class <name>` – add a class under src/classes
- `cmake-cli new:test <name>` – add a test file and register it
- `cmake-cli run` – configure, build, and run the main target
- `cmake-cli run:tests` – configure, build, and run ctest
- `cmake-cli lint` – run clang-tidy when available

## Quick start

```bash
# 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 lint
```

## Generated 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.cpp
```

## Options

- `--lang <c|cpp>` choose language (default: cpp)
- `--std <standard>` set C or C++ standard (defaults: C17, C++20)
- `--no-tests` skip test scaffolding
- `--no-src` skip src directory
- `--here` use current directory instead of creating a new one
- `--force` overwrite existing files when safe
- `--hpp` (component/class) use `.hpp` headers for C++

## Development

```
npm install
npm run build
npm link
cmake-cli --help
```