What Does the Mizu CLI Do?
The Mizu CLI helps you with two main tasks:- Creating new projects - Instead of creating files and folders manually, the CLI generates a complete project structure for you
- Running your application - The CLI can start your web server with a single command
Quick Start Example
Let’s create your first Mizu application. Open your terminal and run these commands:http://localhost:8080. You’ll see your application running.
Press Ctrl+C in the terminal to stop the server.
Commands
The Mizu CLI has five commands. Each command does one specific thing, making it easy to remember what to type.| Command | What it does |
|---|---|
mizu new | Creates a new project from a template |
mizu dev | Runs your project in development mode |
mizu contract | Works with service contracts (for API projects) |
mizu middleware | Explores available middlewares |
mizu version | Shows the CLI version |
Getting Help
You can add--help to any command to see what options are available:
Choosing a Template
When you create a new project withmizu new, you choose a template. Each template gives you a different starting point:
| Template | Best for | Difficulty |
|---|---|---|
minimal | Learning Mizu, quick experiments | Beginner |
api | JSON APIs, backend services | Beginner |
contract | Multi-protocol APIs (REST + JSON-RPC) | Intermediate |
web | Server-rendered websites with HTML | Intermediate |
live | Real-time apps (chat, dashboards) | Intermediate |
sync | Offline-first apps with data sync | Advanced |
minimal to learn the basics, then try api when you want to build a real project.
To see all available templates:
How the CLI Works
When you runmizu new myapp --template api, here’s what happens:
- The CLI reads the template files
- It creates the
myappfolder - It generates all the project files with your project name filled in
- It sets up the correct Go module path
mizu dev, here’s what happens:
- The CLI looks for your main package (usually in
cmd/folder) - It compiles and runs your Go code
- It watches for
Ctrl+Cto shut down gracefully
Design Philosophy
The Mizu CLI follows these principles:- Convention over Configuration - It works with sensible defaults, so you don’t need to configure everything
- Explicit when needed - You can override any default with flags
- Machine-friendly - All commands support
--jsonoutput for scripts and automation - Clear errors - When something goes wrong, you get helpful messages explaining how to fix it