Repository navigation
feat: one output contract for errors, pages, help and examples - #161
Merged
Merged
Conversation
First step of the CLI design review. Additive only: released fields, reasons and commands keep working. - Errors: every failure carries `command` and a stable `error` object (code, message, server_code, http_status, retryable, hint) next to the released `reason`/`detail`. Reasons are categories, never exception class names. Usage errors are JSON on stdout. Exit codes: 3 not found, 4 authentication required, 5 conflict (0/1/2/130 unchanged). - Pages: paged reads add a normalized `page_info` over the three page shapes domains return; read commands with --page take --all, which follows every page and reports completeness instead of truncating silently. - Discovery: every flag prints help (common flags and schema descriptions fill the gaps) and every command shows a runnable example generated from its required inputs; `schema` accepts CLI paths and reports `resource` and `cli`. - Fix: slideshow generation lost its run and links in CLI 2.0 because async detection still named the retired `generation.create`. - Conventions tests now enforce runnable examples, flag help, unique and reversible command names, summaries that only reference real shortcuts, and no singular/plural duplicate flags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First step of the CLI design review: phases 0–1 of its rollout plan. Every change is additive: released fields,
reasonvalues and commands keep working.Errors
commandand a stableerrorobject:code,message,server_code,http_status,retryable, andhintfor usage errors.reasonanddetailfields are kept alongside.reasonis always a category. Previously it could be a Python class name such asRuntimeError.Pagination
page_info. It covers the three page shapes domains return today:data.{items,total,…},data.{items,pagination}, anddata.dataplus a top-levelpagination.--pagetake--all. It follows every page and reportspage_info.complete. Hitting its cap of 100 pages or 10,000 records produces a warning instead of silent truncation.Discovery
museoncli schema <self>.schemaaccepts CLI paths, e.g.museoncli schema hireaicreator video +get, and reportsresourceandcli.Fix
ai-slideshow generation +createlost itsrunand frontend links in CLI 2.0: async detection and URL templates still named the retiredgeneration.*/asset.*commands.Conventions tests
The tests now enforce:
Verification
uv run pytest -q: 1157 passed.ruff, the docs and contract--checks, wheel build,verify_public_artifacts.pyandsmoke_install.pyall passed.hireaicreator account +list --allon a real workspace fetched 9 pages, 877 records with no duplicates, matching manual paging.page_infois correct for both hireaicreator and ai-slideshow page shapes.Follow-ups (separate PRs)
<domain> <resource> +<verb>, fixed verb set,batch/bulk).--wait, and idempotency on the remaining writes.🤖 Generated with Claude Code