# Velto CLI ๐
**Velto CLI** is the official command-line tool for [Velto](https://github.com/pjdur/velto), a fast and minimal Rust web framework. It helps you scaffold, run, and manage Velto apps with ease.
---
## โจ Features
- `velto new <name>` โ Create a new Velto project instantly
- `velto run` โ Build and launch your app with clean output
- LiveReload support in dev mode
- Graceful shutdown on Ctrl+C
- No noisy Cargo logs โ just your app
---
## ๐ฆ Installation
```bash
cargo install velto-cli
```
---
## ๐ Usage
### Create a new project
```bash
velto new my-app
```
This generates:
- `src/main.rs` with a sample route
- `templates/index.html` with dynamic content
- `static/` for assets like CSS and JS
- `Cargo.toml` with Velto dependencies
---
### Run your app
```bash
velto run --port 3000
```
Options:
- `--port <PORT>` โ Set the port (default: 8080)
- `-r`, `--release` โ Run in release mode
---
## ๐งช CLI Tests
You can run these tests using `cargo test` inside the `velto-cli` repo.
### Example: `tests/cli.rs`
```rust
use std::process::Command;
#[test]
fn test_new_project() {
let output = Command::new("cargo")
.args(["run", "--", "new", "test-app"])
.output()
.expect("Failed to run velto new");
assert!(output.status.success());
assert!(std::path::Path::new("test-app/src/main.rs").exists());
}
#[test]
fn test_run_help() {
let output = Command::new("cargo")
.args(["run", "--", "run", "--help"])
.output()
.expect("Failed to run velto run --help");
let stdout = String::from_utf8_lossy(&output.stdout);
assert!(stdout.contains("Usage"));
assert!(output.status.success());
}
```
---
## ๐ License
MIT
---
## ๐ Links
- [Velto Framework](https://github.com/pjdur/velto)
- [Velto CLI](https://github.com/pjdur/velto-cli)
---
Happy building with Velto! โก