CLI command reference
Miblo commands and options for project creation, models, routes, databases and templates.
On this page
Help and main commands
miblo --help
miblo --version
miblo new --help
miblo route add --help| Command | Purpose |
|---|---|
miblo | Open the workspace in an interactive terminal. |
miblo ui --project PATH | Open a project. |
miblo new [NAME] | Create an API. |
miblo add [NAME] [FIELD]... | Add a model. |
miblo edit NAME [FIELD]... | Add optional fields. |
miblo route add NAME --path PATH | Create a route. |
miblo run --project PATH | Run cargo run. |
miblo doctor --project PATH | Check metadata, registries and prerequisites. |
miblo db ACTION --project PATH | check, init, migrate or schema. |
miblo template update | Update templates for future additions. |
Create: miblo new
miblo new shop-api --database sqlite --port 3000 \
--resource Product --field title:string --field price:float --yes| Option | Purpose |
|---|---|
--output PATH | Destination; an existing directory is refused. |
--database sqlite|mysql | SQLite by default interactively; MySQL with --yes and no explicit engine. |
--port PORT | Default: 3000. |
--resource NAME / --field FIELD | Initial model and repeated fields. |
--config PATH | Version 1 YAML definition. |
--template-dir PATH | Local pack; incompatible with direct URL/digest options. |
--template-url URL | Direct archive URL. |
--template-base-url URL | Distribution server. |
--template-version VERSION | Pack version. |
--sha256 HEX | Known digest without fetching a sidecar. |
--yes / --dry-run | Accept choices / preview without writing the project. |
--offline / --cache-dir PATH | Template cache options. |
Add and update models
miblo add User name:string email:string:unique --yes
miblo edit User 'nickname:string?' --yesSupply fields positionally or with repeated --field options, never both. The legacy miblo add resource User --field name:string --yes syntax is still accepted.
Shared options: --project, --yes, --dry-run, --offline, --cache-dir. add also accepts --path. edit requires optional fields and an existing model.
Create a route
miblo route add create_member --resource User --action create --path /members --yes
miblo route add activate --method POST --path '/users/{id}/activate' --resource User --json-body --yes--action list|get|create|update|delete requires --resource and determines the method. Without an action, --method and --json-body describe a custom stub. Other options: --project, --yes, --dry-run, --offline, --cache-dir.
Update templates
miblo template update --project team-api --dry-run
miblo template update --project team-apiOptions: --template-dir or --template-url, --template-version, --template-base-url, --project, --dry-run, --offline and --cache-dir. Check --help for your installed version before automating a new workflow.