CLI interface · 0.8.1

CLI: reading commands and results

Global parameters, starting the editor, help, exit codes and a command map.

On this page

For interactive work, start with the corresponding Generator UI screen. This CLI reference supports scripts and repeatable operations; UI and CLI edit the same model.

Replace ENTITY_NAME, RELATED_ENTITY_NAME and VIRTUAL_ENTITY_NAME with technical names from your model. ENTITY_ROUTE is an API route, TABLE_NAME/JOIN_TABLE_NAME are SQL tables, and RELATION_NAME/COLLECTION_NAME are relationship names. They may differ from the entity name. Commands are templates: do not execute uppercase placeholders literally.

The UI is launched by the admingen binary; scripting commands use admingen-cli. These programs were previously called admingen-ui and admingen; the commands below use the new names.

The CLI suits repeatable actions and scripts. It changes the same manifest as the Generator UI. Creating an entity, generating source files and starting the application are separate operations: after configuring the model, you generate files and run the result separately.

Anatomy of a command

admingen-cli --path ./docs-demo entity add ENTITY_NAME --module content --table TABLE_NAME

admingen-cli is the CLI executable; --path selects the project; entity add is the action; ENTITY_NAME is the entity name. --module and --table concern its creation. Keep command words in order and pass technical names exactly, without translating them.

Parameter Default Purpose
--path PATH . Project root. Set it explicitly when the terminal is in another directory.
--output text|json text Human-readable output or a structured result for a program.
-h, --help disabled Help for the selected command without running the operation.

For a boolean parameter, --required means true and --required=false means false. In update commands, an omitted parameter usually means “leave unchanged”. Do not pass every value from help hoping to preserve settings: this can replace them.

Check a project before writing files

admingen-cli --path ./docs-demo doctor
admingen-cli --path ./docs-demo plan
admingen-cli --path ./docs-demo generate --dry-run

doctor shows whether the directory is initialized. plan builds generation operations. generate --dry-run shows file changes without writing them. These results help distinguish a model problem from a conflict with existing source files.

Enable JSON to process the result in a script:

admingen-cli --path ./docs-demo --output json plan

Check the exit code first, then the data and error. Do not simply search the text for “success”. CLI and generator HTTP API error formats differ: HTTP JSON cannot be used unchanged as a CLI result.

Start the Generator UI

admingen includes CLI commands and the embedded interface:

admingen --path ./docs-demo start --addr 127.0.0.1:8080 --open=true

--addr specifies the address and port, defaulting to 127.0.0.1:8080. --open controls opening the browser. ui is a compatible name for the same startup.

admingen-cli starts the local HTTP API with serve --addr ..., but does not include an embedded UI. The local editor is not intended to be published on the internet as your application's admin system.

Help and completion

admingen-cli help entity
admingen-cli entity field add --help
admingen-cli completion zsh > admingen-completion.zsh

completion supports bash, zsh, fish and powershell. It outputs a completion script; save and load it according to your shell's rules. Do not run the entire output as an arbitrary command. Where supported, --no-descriptions removes descriptions from completions.

Commands by task

Task Commands and section
Create a project and start the local editor init, serve, start
Check a project and obtain files doctor, plan, generate
Group and describe the model module, entity
Configure data and forms field / entity field
Define relationships entity relation
Build a read-only view projection
Configure operations and returned records Permissions and read rules
Rename a field, delete a field or entity Model lifecycle
Create a custom SQL migration migration create
Start the application and maintain the database Generated application commands
Release a version, back up and restore deploy/control

Use field commands for fields, relationships for relationships and projections for read-only queries. Directory preparation is described in init, entity structure in module and entity, and applying the model in generate.

There are no separate admingen-cli history, diff, rollback, git or project settings commands. Diff is available through generate --dry-run; history and model restoration are in the UI. Change project settings in Project settings or the manifest. After init, use ordinary Git commands to work with the repository.

Exit codes

Code Meaning
0 The command completed successfully; its result content still matters.
1 Execution error, including errors not assigned a separate category.
2 Invalid input/model, an unsupported lock contract or a missing required terminal.
130 The operation was canceled through its context.

Even with code0, consider the response content: doctor with initialized: false reports that the project has not been created yet; it does not authorize running Generate immediately.

The current CLI has no separate version command or global --version. init --generator-version sets the generator version written for the project rather than printing the installed binary's version.

Generated application commands serve a different task and are often run from another directory. Do not mix them with model-editing commands.