+
Skip to content

irfanghat/rocket-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 rocket-cli

A command-line interface (CLI) for developing, building, and running Rocket web applications in Rust.
Scaffold production-ready APIs in seconds with idiomatic folder structure and database-ready templates.


Features

  • 🔧 rocket new to scaffold new Rocket projects
  • 📦 Multiple templates: minimal (default), mongodb, postgres, mysql, mssql, sqlite, and more via rbatis
  • 📂 Standard project layout (routes, db, middleware, etc.)
  • 💡 Intuitive command design inspired by the dotnet CLI
  • 🛠️ Git integration (--git)
  • ✅ Cross-platform and built in pure Rust

Installation

Install via Cargo

cargo install --path .

Clone & Build Locally

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

Download Precompiled Binary

Download the latest binary from GitHub Releases:

  1. Go to the Releases page

  2. Download the binary for your platform:

    • rocket-cli-x86_64-unknown-linux-gnu
    • rocket-cli-x86_64-pc-windows-msvc.exe (Coming soon/Available via WSL)
    • rocket-cli-aarch64-apple-darwin (macOS ARM - Coming soon)
  3. Make it executable (Linux/macOS):

chmod +x rocket-cli-*
mv rocket-cli-* /usr/local/bin/rocket-cli
  1. Verify installation:
rocket-cli --version

Usage

rocket-cli <command> [options]

Create a new project

rocket-cli new my-api

Options:

--template <name>   Choose a template: minimal, mongodb, postgres, mysql, mssql, rbatis
--git               Initialize a Git repository

Example:

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

Run your project

rocket-cli run

Project Layout (Standardized)

Every template follows a production-grade folder structure:

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

🧪 Templates

Supported templates:

  • minimal — Basic Rocket app (default)
  • mongodb — Rocket with mongodb
  • postgres — Rocket with PostgreSQL (WIP)
  • mysql — Rocket with MySQL (WIP)
  • mssql — Rocket with SQL Server (WIP)
  • sqlite — Rocket with SQLite (WIP)

Documentation


Contributing

Contributions, templates, and suggestions are welcome!

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

License

This project is licensed under the MIT License.


Built with ❤️ and Rust — from the community, for the community.

About

An interactive CLI for the Rocket Web Development Framework.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载