https://github.com/vixcpp/cli
vixcpp/cli โ Command Line Interface for vix.cpp. Scaffold new projects, run the server with hot reload, and generate models or resources.
https://github.com/vixcpp/cli
backend cpp cpp20 cross-platform http-server modular repl runtime vix vix-cli vixcpp
Last synced: 5 days ago
JSON representation
vixcpp/cli โ Command Line Interface for vix.cpp. Scaffold new projects, run the server with hot reload, and generate models or resources.
- Host: GitHub
- URL: https://github.com/vixcpp/cli
- Owner: vixcpp
- License: mit
- Created: 2025-10-03T14:39:18.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-01-06T09:09:10.000Z (17 days ago)
- Last Synced: 2026-01-11T04:57:17.051Z (12 days ago)
- Topics: backend, cpp, cpp20, cross-platform, http-server, modular, repl, runtime, vix, vix-cli, vixcpp
- Language: C++
- Homepage: https://vixcpp.com
- Size: 412 KB
- Stars: 6
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐งฉ Vix.cpp โ CLI Module
### Modern C++ Runtime Tooling โข Zero-Friction Development โข Fast Web Apps





> **Vix CLI** is the official command-line interface for
> **Vix.cpp** โ the modern C++ backend runtime.
>
> It provides a **professional, modern, runtime-like developer experience**
> for C++, comparable to **Python**, **Node.js**, **Deno**, or **Bun**.
---
# ๐ Overview
The Vix CLI (`vix`) brings modern runtime ergonomics to C++:
- Instant project creation
- Smart CMake-based builds
- Friendly compiler diagnostics
- Sanitizer-first validation
- Script-like execution of `.cpp` files
- Packaging & artifact verification
- Built-in interactive REPL (**default**)
Running `vix` with no arguments launches the **interactive REPL**.
---
# โ๏ธ Features
## ๐ง Built-in REPL (default)
```bash
vix
```
- Variables & expressions
- JSON literals
- Math evaluation
- Runtime APIs (`Vix.cwd()`, `Vix.env()`, etc.)
- Script-like exploration
Explicit mode:
```bash
vix repl
```
---
## ๐๏ธ Project scaffolding
```bash
vix new blog
```
Creates:
- CMake-based project
- Modern C++20 structure
- Ready-to-run Vix app
---
## โก Smart build system
```bash
vix build
```
- Uses CMake presets automatically
- Parallel builds
- Colored logs & spinners
- Clean Ctrl+C handling
---
## ๐ Run applications
```bash
vix run
```
- Auto-build if required
- Real-time logs
- Runtime log-level injection
Script mode:
```bash
vix run demo.cpp
```
---
## ๐งช Check & Tests (Sanitizers ready)
Compile-only validation:
```bash
vix check
vix check demo.cpp
```
With sanitizers:
```bash
vix check demo.cpp --san
vix check demo.cpp --asan
vix check demo.cpp --ubsan
vix check demo.cpp --tsan
```
Run tests:
```bash
vix tests
vix tests --san
```
---
## ๐ฆ Packaging & Verification
Create a distribution artifact:
```bash
vix pack --name blog --version 1.0.0
```
Verify artifacts:
```bash
vix verify dist/blog@1.0.0
vix verify dist/blog@1.0.0 --require-signature
```
---
## ๐ง ErrorHandler โ your C++ teacher
- Explains template & overload errors
- Detects missing includes
- Highlights the _first real error_
- Provides actionable hints
---
# ๐งฐ Commands
```bash
vix [options]
```
| Command | Description |
| ------------------------- | ---------------------------- |
| `vix` | Start REPL (default) |
| `vix repl` | Start REPL explicitly |
| `vix new ` | Create a new project |
| `vix build [name]` | Configure + build |
| `vix run [name] [--args]` | Build and run |
| `vix dev [name]` | Dev mode (watch & reload) |
| `vix check [path]` | Compile-only validation |
| `vix tests [path]` | Run tests |
| `vix pack [options]` | Create distribution artifact |
| `vix verify [options]` | Verify artifact |
| `vix orm ` | ORM tooling |
| `vix help [command]` | Show help |
| `vix version` | Show version |
---
# ๐งช Usage Examples
```bash
vix
vix new api
cd api
vix dev
vix check --san
vix tests
vix pack --name api --version 1.0.0
vix verify dist/api@1.0.0
```
---
# ๐งฉ Architecture
The CLI is built around a command dispatcher:
```cpp
std::unordered_map commands;
```
### Main components
| Path | Responsibility |
| -------------------------------- | -------------------- |
| `include/vix/cli/CLI.hpp` | CLI entry & parsing |
| `src/CLI.cpp` | Command routing |
| `src/ErrorHandler.cpp` | Compiler diagnostics |
| `src/commands/ReplCommand.cpp` | Interactive REPL |
| `src/commands/CheckCommand.cpp` | Validation |
| `src/commands/PackCommand.cpp` | Packaging |
| `src/commands/VerifyCommand.cpp` | Verification |
---
# ๐ง Build & Installation
### Standalone CLI build
```bash
git clone https://github.com/vixcpp/vix.git
cd vix/modules/cli
cmake -B build -S .
cmake --build build -j$(nproc)
```
Binary:
```bash
./build/vix
```
---
### Full Vix build
```bash
cd vix
cmake -B build -S .
cmake --build build
```
---
# โ๏ธ Configuration
### Environment variables
| Variable | Description |
| --------------------- | ------------------------- |
| `VIX_LOG_LEVEL` | Runtime log level |
| `VIX_STDOUT_MODE` | `line` for real-time logs |
| `VIX_MINISIGN_SECKEY` | Secret key for `pack` |
| `VIX_MINISIGN_PUBKEY` | Public key for `verify` |
---
# ๐ฆ CLI Help Output
```sql
Vix.cpp โ Modern C++ backend runtime
Version: v1.x.x
Usage:
vix [GLOBAL OPTIONS] [ARGS...]
vix help
Quick start:
vix new api
cd api && vix dev
vix pack --name api --version 1.0.0 && vix verify
Commands:
Project:
new Create a new Vix project
build [name] Configure + build
run [name] Build and run
dev [name] Dev mode
check [path] Compile-only validation
tests [path] Run tests
Packaging & security:
pack Create distribution artifact
verify Verify artifact or package
REPL:
repl Start interactive REPL
(default) Run `vix` to start the REPL
Global options:
--verbose
-q, --quiet
--log-level
-h, --help
-v, --version
```
---
# ๐งพ License
**MIT License** ยฉ [Gaspard Kirira](https://github.com/gkirira)
See [`LICENSE`](../../LICENSE) for details.