refactor(cli): give each command its own help screen - #5181
Open
orangeCatDeveloper wants to merge 1 commit into
Open
refactor(cli): give each command its own help screen#5181orangeCatDeveloper wants to merge 1 commit into
orangeCatDeveloper wants to merge 1 commit into
Conversation
orangeCatDeveloper
force-pushed
the
docs/cli-output-locale-policy
branch
2 times, most recently
from
September 11, 2026 05:43
c6a87de to
7d078f7
Compare
orangeCatDeveloper
marked this pull request as ready for review
September 11, 2026 05:46
`maka --help` printed 110 lines, 62 of them the Runtime Host service,
access, plugin and profile surfaces that only an operator installing a
service needs. A newcomer asking what the tool does met a wall of
administration syntax, and the six option sections meant the root screen
carried titles like "Managed Runtime Host direct-peer options".
Help is now layered the way `run` and `activate` already were: the root
lists the top-level commands and the TUI options in 25 lines, and
`runtime-host --help` and `runtime-host <command> --help` carry what
belongs to them. `update --help` gains a screen it never had — it used to
answer "Unexpected argument".
Column widths are measured rather than fixed, so a development launcher
("npm run cli:dev --") aligns like the packaged `maka` name.
Generated-by: Claude Code
orangeCatDeveloper
force-pushed
the
docs/cli-output-locale-policy
branch
from
September 11, 2026 05:58
7d078f7 to
ea0a763
Compare
me2seeks
approved these changes
Sep 11, 2026
Contributor
There was a problem hiding this comment.
PR 5181 Review
结论
APPROVE
分层 help 重构行为保持:parseRuntimeHostCommand(argv, cliCommand='maka') 新参数有默认值,唯一生产调用方 cli-core.ts:96 传入 launcher 名;--help 提前返回不影响既有子命令解析顺序(help 之前原本也没有子命令匹配路径,旧代码裸 maka 走 error,新代码走 host overview,属意图内变更)。maka runtime-host connect --help 落在 isRuntimeHostHelpTopic(SUBCOMMANDS 含 activate,其 lines 同时文档化 connect,runtime-host-help.ts:25),与描述"九个 Runtime Host 命令"一致。新增"每命令可达成"覆盖测试与 MAKA_RUNTIME_HOST_ACCESS_CREDENTIAL 保留测试覆盖了分层的主要回归面。
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
maka --helpprinted 110 lines. Sixty-two of them were the Runtime Host surface —service,access,plugin,profileand their six option sections — which only an operator installing a background service needs. Someone running the tool for the first time met a wall of administration syntax before finding out what it does, and the root screen carried section titles likeManaged Runtime Host direct-peer options (Linux or macOS), which is a structure leaking through its own help.Help is now layered the way
runandactivatealready were:Every screen has the same shape —
Usage:, thenCommands:where there ismore than one, then
Options:. The section titles shed the qualifiers theyneeded only while six of them shared the root screen:
Managed Runtime Host service install options (Linux or macOS)is justInstall options (Linux or macOS)onceUsage: maka runtime-host servicesits above it.maka update --help,session-export --helpandsession-import --helppreviously answeredUnexpected argumentor exited 1 with a usage line on stderr. They are real screens now, which matters because the root no longer spells their flags out.Column widths are measured from the entries rather than fixed, so a development launcher (
npm run cli:dev --) aligns like the packagedmakadoes. The previous hardcoded width broke on the longer name —-- --acpServe ACP v1…— which the existing test caught.Refs #2672
Verification
Before and after, root help:
Two existing assertions changed, both because they pinned the old shape rather than a behavior: one matched an exact column width (
/^ maka {14}Start the TUI$/), the other requiredruntime-host serveto appear in the root screen. They now assert the layering — that the root namesruntime-hostonce and points at it, that it stays under 30 lines, that every summary starts in one column whatever the launcher name costs, and that the launcher name survives into the second and third level.Three new assertions guard the move itself, because the new module was
generated by a script that lifted the old text and regrouped it — which is
exactly where content gets dropped or mis-filed. One walks every command the
parser accepts and fails if it appears on no screen; removing
activatefromthe topic table fails it with
runtime-host activate is unreachable from any help screen. That test found nothing when written, because it was writtenafter a review caught what it would have caught:
runtime-host activatewas dropped outright — the generator's topic listomitted
activateandconnect, so a command the parser still acceptsappeared on no screen and answered
Unexpected runtime-host activate option.MAKA_RUNTIME_HOST_ACCESS_CREDENTIALwas lost with the rootOptionsrewrite. It is the credential
profile setreads when--credential-envisomitted, so the advertised default invocation had no documented way to supply
one. It now sits under
runtime-host profile --help.session-export/session-importlost their grammar to...in the rootscreen while neither had a
--helpto move it to.Review focus
This replaces what this PR held before — a decision to record the English-only help as a contract. That framing was wrong on two counts, and the second one is the reason for this rewrite:
So the honest position is that the root help was never decided to be English; it was never localized, and it was also too long to be useful in any language. This PR fixes the length and the structure. Localizing the now-25-line root screen is a separate, much smaller change, and nothing here forecloses it.
AI use
Select exactly one:
Tool(s) and scope: Claude Code — restructured the help, wired the per-command dispatch, updated the tests, and wrote this description. A second model (Codex) argued against the previous framing of this PR and supplied the line counts that overturned it. The commit carries a
Generated-by: Claude Codetrailer.Checklist
Does this PR entail a change in behavior?
maka --helpno longer lists the Runtime Host subcommands; they moved tomaka runtime-host --help