Skip to main content

Schema Command

warning

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 --format specified and no default format in the config file: defaults to json (standard output envelope with indented JSON).
  • --format compress: same envelope structure as json, but single-line compact JSON (no indentation or line breaks). Machine-readable only; significantly reduces token count.
  • You can still switch to --format pretty or --format table. If a global format is set in the config, the priority is CLI --format > config file > command default json > pretty.

Output Reference

On success, the output follows the standard declarative pipeline envelope:

FieldDescription
okWhether the command succeeded
commandThe current command label, e.g. rabetbase schema export
riskRisk level of this command (schema export is read)
dataSee "Payload Structure" below

Payload Structure (data)

FieldDescription
schemaVersionContract version number; currently 1
clibin, displayName, version, gitCommit
globalFlagsFlag list corresponding to GLOBAL OPTIONS in --help
servicesCallable 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, hasFormat
  • supportsDryRun (whether dryRun preview is declared)
  • args: positional argument declarations (if any)
  • flags: complete list matching the FLAGS section of the individual command's --help (including injected items); pattern is provided in serializable form
  • helpExtra: static string, or { "dynamic": true } indicating the help text is generated at runtime (e.g. run listing 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.