Schema Command
This document can currently be read directly via its feishu_doc_id, but its exact wiki node position under the "Rabetbase CLI 2.0" root node has not been confirmed. Locally it is preserved as a docx direct source to avoid incorrectly reusing another page's feishu_node_token.
This document describes the rabetbase schema command (sub-command export): it exports machine-readable metadata sourced from the same data as --help, allowing IDEs, Skills, and scripts to consume the CLI's command contract.
Overview
schema outputs a structured JSON payload (inside the data field of the declarative pipeline envelope) containing descriptions, risk levels, authentication and appCode requirements, positional arguments, and complete flags (including framework-injected ones like --format / --yes) for every service + command. This command does not implement dryRun; do not use --dry-run.
Usage
rabetbase schema
# or
rabetbase schema export
Single-command service: rabetbase schema is equivalent to rabetbase schema export (the default sub-command is export).
Output Format (--format)
- No
--formatspecified and no defaultformatin the config file: defaults tojson(standard output envelope with indented JSON). --format compress: same envelope structure asjson, but single-line compact JSON (no indentation or line breaks). Machine-readable only; significantly reduces token count.- You can still switch to
--format prettyor--format table. If a globalformatis set in the config, the priority is CLI--format> config file > command defaultjson>pretty.
Output Reference
On success, the output follows the standard declarative pipeline envelope:
| Field | Description |
|---|---|
ok | Whether the command succeeded |
command | The current command label, e.g. rabetbase schema export |
risk | Risk level of this command (schema export is read) |
data | See "Payload Structure" below |
Payload Structure (data)
| Field | Description |
|---|---|
schemaVersion | Contract version number; currently 1 |
cli | bin, displayName, version, gitCommit |
globalFlags | Flag list corresponding to GLOBAL OPTIONS in --help |
services | Callable commands grouped as in rabetbase --help; excludes legacy command aliases used only for CLI-internal compatibility |
Each service entry contains: service, label, isSingleCommand, defaultCommand, hasWildcard (whether the service includes a wildcard route, e.g. run), and a commands array.
Each command entry contains:
command,description,tag(if any)risk,requiresAuth,requiresAppCode,hasFormatsupportsDryRun(whetherdryRunpreview is declared)args: positional argument declarations (if any)flags: complete list matching the FLAGS section of the individual command's--help(including injected items);patternis provided in serializable formhelpExtra: static string, or{ "dynamic": true }indicating the help text is generated at runtime (e.g.runlisting scripts)
Wildcard: Services like run appear as <script> in help output. In the schema, such entries use the same metadata as the wildcard definition; hasWildcard indicates that the service supports sub-command names that are not exhaustively listed.
Prerequisites
- No login required (
requiresAuth: false) - No appCode required (
requiresAppCode: false)
Example
Top-level structure with --format json (or no --format and no config override):
{
"ok": true,
"command": "rabetbase schema export",
"risk": "read",
"data": {
"schemaVersion": 1,
"cli": {
"bin": "rabetbase",
"displayName": "Rabetbase CLI",
"version": "...",
"gitCommit": "..."
}
}
}
The full data payload is large and is intended for tool consumption rather than manual reading.