test(bonfire): goldens for list, help and errors

- list, list --all, list --format=json and an --ansi styled list (D-13, D-16)
- admin:token:create help and a passthrough help; help <cmd> equals --help (D-14)
- error blocks: hint with {bin}, unknown command, -v chain on stderr (D-18)
- CheckDocs gaps in order and sorted; the version header and BuildVersion
- goldens render with color detection cleared; -update rewrites them
This commit is contained in:
Jakub Zych
2026-10-21 19:22:00 +02:00
parent 9641a1be59
commit 7b58ad5fa5
12 changed files with 827 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
ERROR db:check: connect to 127.0.0.1:5432: connection refused
Caused by:
- connect to 127.0.0.1:5432: connection refused
- connection refused

View File

@@ -0,0 +1,10 @@
ERROR No application found in /home/jane/acme/plugins.
summer make:command needs an application root (summer.yaml).
Try:
cd ..; bin/acme make:command acme.blog:publish
Run with -v for details.

View File

@@ -0,0 +1,8 @@
ERROR Command "migrat" is not defined.
Try:
bin/acme migrate
Run with -v for details.

View File

@@ -0,0 +1,23 @@
Description:
Run the bundled tool with its own arguments
Usage:
tool:exec [args] [options] [--] <args...>
Arguments:
args The tool's arguments
Global options:
-h, --help Display help for the given command
-q, --quiet Do not output any message
-v|vv|vvv Increase verbosity
--ansi|no-ansi Force (or disable) ANSI output
-n, --no-interaction Do not ask any interactive question
--env The environment the command runs under
Help:
Everything after the command name reaches the tool unchanged, global flags included.
Examples:
# The tool's own version
bin/acme tool:exec --version

View File

@@ -0,0 +1,33 @@
Description:
Create a personal API token for a backend admin
Usage:
admin:token:create <login> [options]
Arguments:
login The admin's login
Options:
--scopes=SCOPES Comma-separated scopes [default: "*"]
--expires=EXPIRES Days until expiry [default: 90]
--json Print the token as JSON
-t, --tag=TAG A tag for the token (multiple values allowed)
Global options:
-h, --help Display help for the given command
-q, --quiet Do not output any message
-v|vv|vvv Increase verbosity
--ansi|no-ansi Force (or disable) ANSI output
-n, --no-interaction Do not ask any interactive question
--env The environment the command runs under
Help:
Creates a token for the admin with the given login and prints it once.
Store it in the client right away; it cannot be shown again.
Examples:
# Token for the MCP server, journal only
bin/acme admin:token:create jane --scopes=journal.*
# Script-friendly output
bin/acme admin:token:create jane --json

26
modules/bonfire/testdata/list.golden vendored Normal file
View File

@@ -0,0 +1,26 @@
SummerCMS acme v1.4.0 (framework v0.3.2)
Usage:
bin/acme <command> [options] [arguments]
Options:
-h, --help Display help for the given command
-q, --quiet Do not output any message
-v|vv|vvv Increase verbosity
--ansi|no-ansi Force (or disable) ANSI output
-n, --no-interaction Do not ask any interactive question
--env The environment the command runs under
Available commands:
help Display help for a command
list List commands
migrate Run the database migrations
serve Serve the application
admin
admin:create Create a backend administrator
admin:token:create Create a personal API token for a backend admin
make
make:command Create a new console command
make:model Create a new model and migration
tool
tool:exec Run the bundled tool with its own arguments

View File

@@ -0,0 +1,273 @@
{
"application": {
"name": "acme",
"version": "v1.4.0",
"framework": "v0.3.2"
},
"global_options": [
{
"name": "help",
"shorthand": "h",
"description": "Display help for the given command",
"default": "",
"bare": true,
"repeatable": false
},
{
"name": "quiet",
"shorthand": "q",
"description": "Do not output any message",
"default": "",
"bare": true,
"repeatable": false
},
{
"name": "verbose",
"shorthand": "v",
"description": "Increase verbosity (-v, -vv or -vvv)",
"default": "",
"bare": true,
"repeatable": true
},
{
"name": "ansi",
"shorthand": "",
"description": "Force ANSI output",
"default": "",
"bare": true,
"repeatable": false
},
{
"name": "no-ansi",
"shorthand": "",
"description": "Disable ANSI output",
"default": "",
"bare": true,
"repeatable": false
},
{
"name": "no-interaction",
"shorthand": "n",
"description": "Do not ask any interactive question",
"default": "",
"bare": true,
"repeatable": false
},
{
"name": "env",
"shorthand": "",
"description": "The environment the command runs under",
"default": "",
"bare": false,
"repeatable": false
}
],
"commands": [
{
"name": "acme:secret",
"description": "Rotate the internal signing secret",
"long": "",
"usage": "acme:secret [options]",
"hidden": true,
"passthrough": false,
"arguments": [],
"options": [],
"examples": []
},
{
"name": "admin:create",
"description": "Create a backend administrator",
"long": "",
"usage": "admin:create [options]",
"hidden": false,
"passthrough": false,
"arguments": [],
"options": [],
"examples": []
},
{
"name": "admin:token:create",
"description": "Create a personal API token for a backend admin",
"long": "Creates a token for the admin with the given login and prints it once.\nStore it in the client right away; it cannot be shown again.",
"usage": "admin:token:create \u003clogin\u003e [options]",
"hidden": false,
"passthrough": false,
"arguments": [
{
"name": "login",
"description": "The admin's login",
"required": true
}
],
"options": [
{
"name": "scopes",
"shorthand": "",
"description": "Comma-separated scopes",
"default": "*",
"bare": false,
"repeatable": false
},
{
"name": "expires",
"shorthand": "",
"description": "Days until expiry",
"default": "90",
"bare": false,
"repeatable": false
},
{
"name": "json",
"shorthand": "",
"description": "Print the token as JSON",
"default": "",
"bare": true,
"repeatable": false
},
{
"name": "tag",
"shorthand": "t",
"description": "A tag for the token",
"default": "",
"bare": false,
"repeatable": true
}
],
"examples": [
{
"command": "admin:token:create jane --scopes=journal.*",
"description": "Token for the MCP server, journal only"
},
{
"command": "admin:token:create jane --json",
"description": "Script-friendly output"
}
]
},
{
"name": "help",
"description": "Display help for a command",
"long": "Prints the description, usage, arguments, options, long help and examples of a command. Without a command name it prints the command list.",
"usage": "help [command_name] [options]",
"hidden": false,
"passthrough": false,
"arguments": [
{
"name": "command_name",
"description": "The command name",
"required": false
}
],
"options": [],
"examples": [
{
"command": "help migrate",
"description": "Help for the migrate command"
}
]
},
{
"name": "list",
"description": "List commands",
"long": "Prints the commands grouped by namespace. --all includes hidden commands; --format=json prints every command with its arguments, options and examples.",
"usage": "list [options]",
"hidden": false,
"passthrough": false,
"arguments": [],
"options": [
{
"name": "all",
"shorthand": "",
"description": "Show hidden commands too",
"default": "",
"bare": true,
"repeatable": false
},
{
"name": "format",
"shorthand": "",
"description": "The output format (txt or json)",
"default": "txt",
"bare": false,
"repeatable": false
}
],
"examples": [
{
"command": "list --all",
"description": "Every command, hidden ones included"
},
{
"command": "list --format=json",
"description": "The catalog for scripts and agents"
}
]
},
{
"name": "make:command",
"description": "Create a new console command",
"long": "",
"usage": "make:command [options]",
"hidden": false,
"passthrough": false,
"arguments": [],
"options": [],
"examples": []
},
{
"name": "make:model",
"description": "Create a new model and migration",
"long": "",
"usage": "make:model [options]",
"hidden": false,
"passthrough": false,
"arguments": [],
"options": [],
"examples": []
},
{
"name": "migrate",
"description": "Run the database migrations",
"long": "",
"usage": "migrate [options]",
"hidden": false,
"passthrough": false,
"arguments": [],
"options": [],
"examples": []
},
{
"name": "serve",
"description": "Serve the application",
"long": "",
"usage": "serve [options]",
"hidden": false,
"passthrough": false,
"arguments": [],
"options": [],
"examples": []
},
{
"name": "tool:exec",
"description": "Run the bundled tool with its own arguments",
"long": "Everything after the command name reaches the tool unchanged, global flags included.",
"usage": "tool:exec [args] [options] [--] \u003cargs...\u003e",
"hidden": false,
"passthrough": true,
"arguments": [
{
"name": "args",
"description": "The tool's arguments",
"required": false
}
],
"options": [],
"examples": [
{
"command": "tool:exec --version",
"description": "The tool's own version"
}
]
}
]
}

View File

@@ -0,0 +1,28 @@
SummerCMS acme v1.4.0 (framework v0.3.2)
Usage:
bin/acme <command> [options] [arguments]
Options:
-h, --help Display help for the given command
-q, --quiet Do not output any message
-v|vv|vvv Increase verbosity
--ansi|no-ansi Force (or disable) ANSI output
-n, --no-interaction Do not ask any interactive question
--env The environment the command runs under
Available commands:
help Display help for a command
list List commands
migrate Run the database migrations
serve Serve the application
acme
acme:secret Rotate the internal signing secret
admin
admin:create Create a backend administrator
admin:token:create Create a personal API token for a backend admin
make
make:command Create a new console command
make:model Create a new model and migration
tool
tool:exec Run the bundled tool with its own arguments

View File

@@ -0,0 +1,26 @@
SummerCMS acme v1.4.0 (framework v0.3.2)
Usage:
bin/acme <command> [options] [arguments]
Options:
-h, --help Display help for the given command
-q, --quiet Do not output any message
-v|vv|vvv Increase verbosity
 --ansi|no-ansi Force (or disable) ANSI output
-n, --no-interaction Do not ask any interactive question
 --env The environment the command runs under
Available commands:
help Display help for a command
list List commands
migrate Run the database migrations
serve Serve the application
admin
admin:create Create a backend administrator
admin:token:create Create a personal API token for a backend admin
make
make:command Create a new console command
make:model Create a new model and migration
tool
tool:exec Run the bundled tool with its own arguments