rocket-cli 0.0.1

A fast, ergonomic command-line interface (CLI) for scaffolding and running [Rocket](https://rocket.rs) web applications in Rust. Spin up production-ready APIs in seconds with idiomatic project structure and database-backed templates.
Documentation

🚀 rocket-cli

Preview

A fast, ergonomic command-line interface (CLI) for scaffolding and running Rocket web applications in Rust.
Spin up production-ready APIs in seconds with idiomatic project structure and database-backed templates.

Features

  • rocket new — scaffold a new Rocket project
  • Built-in templates:
    • minimal (default)
    • mongodb, postgres, mysql, mssql, sqlite (via rbatis)
  • Standard project layout (routes, db, repositories, middleware, fairings)
  • Intuitive UX inspired by the dotnet CLI
  • Optional Git initialization (--git)
  • Cross-platform, written entirely in Rust

Installation

Install from source

cargo install --path .

Clone & build

git clone https://github.com/irfanghat/rocket-cli
cd rocket-cli
cargo build --release

Precompiled binaries

Grab the latest binaries from GitHub Releases:

  • rocket-cli-x86_64-unknown-linux-gnu
  • rocket-cli-x86_64-pc-windows-msvc.exe (via WSL/Windows soon)
  • rocket-cli-aarch64-apple-darwin (macOS ARM soon)

Install (Linux/macOS):

chmod +x rocket-cli-*
mv rocket-cli-* /usr/local/bin/rocket-cli

Verify:

rocket-cli --version

Usage

rocket-cli <command> [options]

Create a new project

rocket-cli new my-api

Options:

--template <name>   # minimal | mongodb | postgres | mysql | mssql | sqlite
--git               # initialize a Git repository

Example:

rocket-cli new my-api --template postgres --git

Run the project

rocket-cli run

Project Layout

All templates follow a production-ready structure:

my-api/
├── Cargo.toml
├── src/
│   ├── main.rs         # Application entrypoint
│   ├── routes/         # Route handlers
│   ├── db/             # Database config & connections
│   ├── repositories/   # Data access layer
│   ├── middleware/     # Middleware & guards
│   └── fairings/       # Fairings & launch hooks

Templates

  • minimal — base Rocket app (default)
  • mongodb — Rocket + MongoDB
  • postgres — Rocket + PostgreSQL (via rbatis)
  • mysql — Rocket + MySQL (WIP)
  • mssql — Rocket + SQL Server (WIP)
  • sqlite — Rocket + SQLite (WIP)

Resources

Contributing

Contributions and new templates are always welcome.

git clone https://github.com/irfanghat/rocket-cli
cd rocket-cli
cargo run -- --help

License

Licensed under the MIT License.


Built with ❤️ in Rust — for the community, by the community.