CLI Help
Help is the one part of a CLI every user reaches for first. A conforming tool answers the usual ways of asking for help, shows a short progressive overview instead of a wall of text, and builds that help from an authored document rather than from strings scattered through its code.
FreeCLI help is based on prohelpunchecked, the progressive help specification and reference library (DUB package prohelp, 0.2.3 at the time of writing).
Prohelp solves help only; argument parsing and dispatch stay with the tool’s CLI framework (see prohelp-cli for D with arsd.cli).
The key words MUST, MUST NOT, SHOULD, SHOULD NOT and MAY are to be interpreted as described in BCP 14unchecked (RFC 2119, RFC 8174) when, and only when, they appear in all capitals.
In this page, a conforming tool is a CLI that claims conformance with this standard, a help document is the authored prohelp schema for a tool, and a help trigger is an argument that asks for help.
Requirement ids (CH-n) are stable so tools, reviews and certification can cite them.
An id is never reused or renumbered; a withdrawn rule keeps its id and is marked withdrawn.
This page builds on CLI Dispatch (which input is an error, bare invocation, CD-16 help completeness) and CLI Output (stdout versus stderr, exit codes, -json).
|
Current prohelp versus required prohelp
Each rule says whether prohelp already provides the behaviour.
Prohelp today describes what prohelp does or documents now.
Prohelp gap marks behaviour this standard requires that prohelp does not yet provide; until prohelp adds it, a conforming tool MUST provide it itself (around its |
Help invocations
- CH-1
-
A conforming tool MUST print help when its first argument is
-helpor-h(single-dash options, NS-15).Prohelp today:
prohelp.intercept(args)treats?,help,--help,-hand--?(case-insensitive) in the first argument position as help triggers.--helpand--?are legacy GNU-style spellings; prohelp does not yet recognize-helpor-?. - CH-2
-
A tool that has subcommands MUST also accept
helpas a command:<tool> helpprints the same top-level help as<tool> -help, and<tool> help <command>prints help for that command.helpMUST therefore be listed among the tool’s commands (CD-16) and MUST NOT fall through to any other path. A tool without subcommands MAY accepthelpthe same way.helphere is a bare-word node, not an option: under NS-15 a command line has switches (-help), values and bare-word nodes, and a bare word is a node only where the tool’s namespace declares one at that position (NS-15 token kinds). A tool that meets CH-2 declareshelpas a node at the top level (and under each command that takeshelp), so<tool> helpand<tool> -helpare both legal and do not conflict. Help is help-first (decided 2026-10-26): the primary mode is shell-levelhelp <path>(prohelp), which serves help from the resources tools ship, and the path tokens are values (help git commitnames the pathgit/commit).<tool> helpand<tool> -helpare compatibility paths to that same resource.This closes the case shown in CLI Dispatch:
redub helpis read as a package namedhelpand run, while onlyredub --help(redub’s current, legacy GNU-style spelling) prints help. Under CH-2 that tool does not conform untilredub helpprints help (and under CD-3 it must not run anything either way).Prohelp today:
helpis already a trigger inintercept, so a tool that callsinterceptbefore its dispatcher meets CH-2 for the top level. - CH-3
-
A conforming tool SHOULD accept
?as a help trigger, and MAY accept-?. Under NS-15-?is a one-character short alias, like-h. The?form is the progressive entry point (<tool> ? <section>). Because?is a glob character in many shells, documentation SHOULD show it quoted where that matters. Mode and format attach tohelpand-helpwith/(help/i,-help/i,help/json), as specified in [ch-27], not as glued keys on?. Locale is a separate-langswitch. Ryan is leaning toward abandoning?as a help trigger entirely ([ch-27]);?is not removed from this rule in this change.Prohelp today: both
?and-?are triggers;prohelp ?and<tool> ? <section>are the documented forms. Namespace-form modes (help/i,-help/i) are a gap; see [ch-27]. - CH-4
-
A help trigger MUST take precedence over every other interpretation of the first argument: no package, file, plugin or target named
help,-help,-h,?or-?may shadow it (CD-3, CD-4). Help MUST perform no action other than printing help (CD-2): no network access, builds, file writes or process launches.Prohelp today: calling
interceptfirst, as prohelp documents, gives precedence; the interceptor only reads the help document and prints.
Help mode and format (namespace form)
- CH-27
-
DECIDED (Ryan, 2026-12-05). A conforming tool that accepts help (CH-1, CH-2) MUST accept a namespace-form mode or format on the
helpnode and on the-helpswitch, written with the generic/separator (the same separator used for the legacy form of records and nesting):-
short and long mode:
help/i,help/interact,-help/i,-help/interact -
format:
help/json,-help/json,help/text,-help/text
-
Examples: git help/i commit and git commit -help/i.
The interact keyword stands unless Ryan says otherwise.
This form replaces glued help keys (?i, ?interact, ?json, ?text), which are not the supported spelling.
A mode or format token MUST NOT carry a locale.
+
Short alias (MUST NOT). The one-letter switch -h MUST NOT take a /mode suffix (-h/i is not a supported spelling). In Git Bash and MSYS2, a native argument that is one letter after - and then a / is rewritten before the tool sees it (measured 2026-12-05: -h/i arrived as -hI:/; -h/interact arrived as -hC:/Program Files/Git/interact under Git Bash). The decided forms help/i and -help/i arrived unchanged. See also [ch-28].
+
Locale (DECIDED, Ryan, 2026-12-05). The locale is a separate switch, -lang <code>, space-separated, following NS-15 (hyphen switches take a space-separated value and MUST NOT use =): git commit -help/i -lang de or git help/i commit -lang de.
A token that looks like a locale in the namespace slot (help/de, -help/de) is an unknown mode (CH-16). A did-you-mean suggestion SHOULD point at -lang de (or the corresponding code), not treat the token as a locale.
See CH-10 for how -lang fits locale resolution.
+
The older prohelp colon form ?:[locale][,mode] is not a supported spelling of this standard.
Glued keys on ? (?i, ?json, and so on) are also not the supported spelling; they were the CH-27 form earlier on 2026-12-05 and are replaced by this namespace form.
+
Deprecation path (DECIDED for ?:, 2026-12-05; replacements amended the same day). For one release, prohelp MUST still accept the colon form and MUST print a warning on stderr (CH-20) that names the deprecated token and the namespace-form (and -lang, when a locale was in the suffix) replacement, then continue to serve help.
Examples: ?:i warns warning: '?:i' is deprecated and will be removed in the next release / use: -help/i (or help/i); ?:de warns use: -help -lang de; ?:de,i warns use: -help/i -lang de; ?:json warns use: -help/json.
The following release MUST reject the colon form entirely (a CH-16 usage error, not a silent treat-as-?).
Glued keys (?i, ?json) get the same warning for one release (warning: '?i' is deprecated and will be removed in the next release, then use: -help/i), and the following release rejects them as unknown input (CD-1, exit 2). This is PROPOSED as a rule; prohelp v0.3.1 already does it, and its glued-key warning is provisional.
Exact triggers (?, help, -help, -h, --help, --?) are unchanged by the colon path.
+
Keywords (DECIDED, Ryan, 2026-12-05). The opt-in viewer mode is spelled i (short), interact and interactive (long forms): help/i, help/interact, help/interactive, -help/i, -help/interact and -help/interactive. All three are accepted, mean the same thing and print no warning; interactive is neither an error nor a deprecated alias. Docs and help SHOULD teach i and interact.
The single-pane fallback of the viewer is its own mode, pane (help/pane, -help/pane; DECIDED 2026-12-05). See the reserved-modes table.
+
Origin. The colon form was introduced in prohelp v0.1.0 (commit 9b16e20, 2026-05-27) as a hybrid console parameter that "isolates help system parameters (like locales and output formats) from actual subcommand navigation tokens."
That suffix sits on the ? trigger itself.
It is not the NS-15 lone-: value escape (decided 2026-10-26), which is a separate token meaning "treat the following as a value" (help-checker : help).
Do not treat the two as the same rule.
The later glued-key form (?i) is replaced by the namespace form on help and -help.
+
LEANING, not final (Ryan, 2026-12-05): abandon ? as a help trigger entirely, because it globs in bash and zsh and users should not need per-shell rules.
This is a leaning only: ? is not removed from this standard in this change.
If the leaning is confirmed, it would affect at least: CH-3 <tool> ? <section> (and ? as a SHOULD trigger), mid-line ? / ?? as a grammar form, and the exact triggers --? and -? (CH-1 / CH-3). The namespace form help/i / -help/i and the CH-1 / CH-2 triggers -help and help would remain.
+
The recognition, "how many modes" and -lang scope rules below are PROPOSED and wait on Ryan’s confirmation, except where a row is marked superseded by the namespace form.
Until they are decided, a tool that already ships help modes SHOULD follow them so implementations do not diverge.
SUPERSEDED: only ? glues.
Mode and format attach to help and -help with /. They MUST NOT be glued onto ?. The earlier proposal that only ? could carry a mode is superseded.
PROPOSED: how a namespace-form token is recognised.
-
The token is
help/<key>(a bare-wordhelpnode with a/and a mode or format key) or-help/<key>(the CH-1 switch with the same key).-h/<key>is not recognised (see the short-alias rule above). -
A namespace-form help token may appear in any position where
helpor-helpis already accepted (CH-2, CH-15), sogit commit -help/i -lang deandgit help/i commit -lang deare help invocations forcommit. -
The remainder after the
/is a single mode or format spelling. It MUST NOT contain a comma. -
After
-help/<key>, remaining non-switch arguments are the topic path:<tool> -help/i install subopens the interact viewer oninstall/sub. Afterhelp/<key>, the following path tokens are the topic path, as withhelptoday:<tool> help/i install sub.
PROPOSED: reserved modes only; unknown keys are errors.
The remainder is compared, case-insensitively, to the reserved mode registry.
If it is not a listed spelling, it is a usage error under CH-16: name the token, offer a did-you-mean over the mode registry, write to stderr, and exit 2.
If the unknown token looks like a language code (help/de, -help/en-GB), the suggestion SHOULD be -lang de (or the corresponding code).
Do not parse it as a locale and do not fall back to English: today’s intercept silently assigns an unrecognised suffix to localeCode and then falls back to en, which would hide json or a misspelt mode.
The reserved mode registry is closed.
New mode keywords MUST be added to this table and MUST NOT be valid ISO 639 primary language subtags, so a typo like help/de stays an unknown key with a -lang hint rather than becoming a new mode.
| Short | Full | Meaning |
|---|---|---|
|
|
Opt-in interact viewer (CH-21). Nested windows by default; the single-pane fallback is the separate mode |
(none) |
|
Static text help (not the viewer). |
(none) |
|
JSON help (CH-23). |
(none) |
|
DECIDED name. Open the viewer in the current single-pane viewport, with no nested windows: the fallback for sessions where nested windows are not wanted or not possible (CH-21). It is a mode of its own, so under the one-mode rule it does not combine with |
ISO 639 check of the decided spellings (2026-12-05). None of them is a language code: i is one letter; text, json and pane are four letters; interact and interactive are eight and eleven. ISO 639-1 codes are two letters and ISO 639-2/-3 codes three. BCP 47 allows four-letter language subtags but assigns none (the IANA Language Subtag Registry, File-Date 2026-11-30, has no language subtag of four or more letters outside the private-use range qaa..qtz), and ISO 639-3 (table dated 2026-10-15) has no pane, text, json, interact or interactive. A future mode MUST pass the same check.
PROPOSED: no prefix abbreviation.
Only the spellings in the table are accepted.
help/inter is not help/interact.
Prefix matching would become ambiguous as modes are added (help/in would also be easy to typo or to confuse with a language code).
PROPOSED: one mode per invocation, no commas, no second mode token.
Modes can be thought of as two axes — presentation (i / interact / interactive, pane, text) and output format (json) — but help produces one result, so this rule does not let them combine.
A namespace-form token carries exactly one mode or format. There are no commas in a key (-help/i,json is an unknown key, CH-16).
An invocation accepts at most one mode or format key. A second such token (-help/i -help/json, or help/i together with -help/json) is a CH-16 error, not a combination and not a topic path.
Conflicting or duplicate keys are the same error.
The reason to keep this strict: -help/i opens a viewer, -help/json prints JSON on stdout, and -help/text prints boxed text; there is no defined product for combining them, and commas in a key existed only to mix in a locale, which now lives on -lang.
PROPOSED: -lang is a reserved global switch. (The full -lang specification, both readings, code forms and errors, is [ch-29].)
NS-15 does not currently have a reserved-name list for hyphen switches. What it reserves is forms: repeated dashes (--x, ---x) are reserved and MUST NOT be given a meaning yet (NS-15 repeated -), and it splits sigils: - is contextual and may depend on position (NS-7), while + free flags mean the same everywhere and are order-independent (NS-7; SOS grammar).
This proposal adds -lang as a reserved global hyphen switch in that (today missing) name list: any tool MAY honour it as the language of its own output; help MUST honour it first (CH-10); a tool MUST NOT reuse -lang for any other purpose.
The decided spelling is -lang with a space-separated value, not +lang. +lang would fit the existing NS-7 free-flag mechanism more neatly for "same meaning everywhere, order does not matter," but it would not match the decided example git commit -help/i -lang de.
+
PROPOSED: position. -lang may appear before or after the help token (git commit -lang de -help/i and git commit -help/i -lang de are the same). It does not use the + order-free marker. A missing value, a repeated -lang, or -lang= is a usage error (NS-15: no = on hyphen switches).
+
PROPOSED: relation to CH-10. Locale resolution is: (1) -lang <code> if present; (2) otherwise the process locale, as prohelp does today (OS locale / LANG / LC_ALL); (3) English, if the requested or detected locale is missing from the help document. -lang with an unknown or unsupported code still falls back to English (CH-10) and SHOULD say so on stderr.
Former aliases.
prohelp’s intercept today accepts interactive (and also viewport and tui) as aliases of the viewer, and txt and static as aliases of text.
interactive stays, as a DECIDED long form (2026-12-05), with no warning and no deprecation clock.
PROPOSED: drop viewport, tui, txt and static (same unknown-key error), leaving only the table spellings.
| Supported form | Deprecated colon form | Meaning |
|---|---|---|
|
|
Interact viewer, process locale. |
|
|
Interact viewer, German. |
|
|
Default (text) help, German. |
|
|
Static text help, process locale. |
|
|
JSON help (CH-23), process locale. |
|
|
JSON help, German. |
|
|
Interact viewer for |
|
|
Level 0 help; no mode key; process locale. |
|
|
Legacy exact trigger; not a mode key. Subject to the leaning on abandoning |
|
|
Error (CH-16): unknown mode; suggest |
|
— |
Error (CH-16): not in the alias table. |
|
— |
Error (CH-16): at most one mode or format key (PROPOSED). |
|
|
Interact viewer, process locale (a DECIDED long form, the same as |
|
(none) |
Interact viewer in the single-pane viewport (DECIDED name). |
| Status | What |
|---|---|
DECIDED (Ryan, 2026-12-05) |
The spellings |
PROPOSED (normative below so implementers can build and test it) |
How a token is recognised (positions, topic path); unknown mode is a CH-16 error; no prefix matching; the closed registry and its ISO 639 guard; one mode per invocation; the one-release warning for leftover glued |
OPEN |
Whether |
LEANING (not final) |
Abandon |
help-node-form = "help" [ "/" mode ] *( SP topic-word )
help-switch-form = *( command-word SP ) "-help" [ "/" mode ] *( SP topic-word )
mode = "i" / "interact" / "text" / "json" ; closed registry, case-insensitive
topic-word = word ; a path token, never a switch
lang-switch = "-lang" SP code ; CH-29, anywhere on the line
| Line | Reading | Result |
|---|---|---|
|
node form: |
interact viewer on |
|
switch form on |
the same |
|
node form, no topic |
interact viewer on the top level |
|
shell-level help (decided 2026-10-26): |
the same |
|
switch form, topic after the switch (PROPOSED) |
interact viewer on |
|
|
German interact viewer on |
|
node form, format key |
JSON help for |
|
CH-21 |
text help on stdout, exit |
| Input | stderr | Exit |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CH-16: unknown help path |
|
|
help is served on stdout; stderr carries the two-line warning of the deprecation path above |
|
|
rejected like any unknown mode (CH-16) |
|
leftover glued |
For one release (prohelp v0.3.1 does this today, provisionally): warn |
|
|
DECIDED: served exactly like |
|
|
|
|
Prohelp today: as of prohelp v0.3.2unchecked (2026-12-06; URL and text updates for FreeCLI; the behaviour below landed in v0.3.1unchecked), interceptHelp recognises help/<key> and -help/<key> for i, interact, interactive, pane, text and json, and it exits 2 for an unknown help mode, two help modes, an empty mode, -h/i, a bad or repeated -lang and an unknown topic. -lang takes BCP 47, POSIX-style and hyphenless codes, and rejects a codeset or modifier. -help/json and help/json print the command tree as JSON; the option level detail of CH-25 is not in that JSON yet. A level switch takes its value only if the token is in the declared set (0 to 9, low, med, high), so medium is an operand. The older intercept still compiles and returns true for both outcomes, so older callers keep working. ?: forms and glued ?i keys still warn and are served for this release.
Prohelp gap: the next release removes the ?: form and rejects glued ?i keys; the CH-25 level detail for JSON help; and the open points in this section that Ryan has not decided (CH-29 scope, ? as a trigger).
Compatibility and incompatibilities
- CH-28
-
DECIDED (Ryan, 2026-12-05). A conforming tool MUST ship a help page, or a clearly titled section of its help, that lists compatibility and incompatibilities of its command-line syntax with the shells a user may type it in. The page MUST say which official spellings are simply unavailable on a given shell, and why, rather than offering a second official spelling as a fallback. In particular:
-
Intensity is a level value (
-clean 2,-verbose 0; NS-15, DECIDED 2026-12-05), which needs no special character and reaches the tool unchanged in every shell tested. The!/!!suffix survives only as an optional Plus Shell shorthand (NS-15), so a page that shows it MUST say it is Plus Shell-only in practice: interactive bash and zsh expand!by default (history expansion), so unless the user has turned history expansion off (set +H,unsetopt BANG_HIST) the shorthand is not available there, and the same is true of cmd.exe when delayed expansion is on. There is no~fallback (this reverses the 2026-10-26 decision); the portable spelling is the level value. -
The help tokens
?,??and the replaced glued keys such as?i(CH-3) are glob characters in bash and zsh. On those shells the unquoted form is not available (it may expand to filenames, vanish undernullglob, or error undernomatch/failglob). The current supported mode form ishelp/iand-help/i(CH-27), which is not a glob. Ryan is leaning toward abandoning?as a trigger, which would shrink this bullet;?is not removed yet. -
In Git Bash and MSYS2, do not document
-h/ior any one-letter switch plus/mode: those arguments are rewritten before a native tool sees them (measured 2026-12-05:-h/iarrived as-hI:/). The decided formshelp/iand-help/iarrived unchanged. -
Dotted names are not used for nested options or help modes. In Windows PowerShell 5.1 and PowerShell 7.7 an unquoted
-video.codec x264is split into-video,.codecandx264before a native program sees it (measured 2026-12-05, and reproduced by D Lang withcmd /c echo). The nested form is/(-video/codec x264, NS-15); a page or help text that shows a dotted spelling is wrong. -
If the tool’s help or docs show an Plus Shell native line with a data-flow arrow (an OPEN idea, schema-first seed D14), the page MUST say loudly that arrows are Plus Shell-only. In bash and zsh an unquoted
a -> bora => bis not a token: it is-or=plus a>redirection that silently creates or truncates the fileb(measured 2026-12-05, bash 5.2.37;a <- bredirects stdin from a file named-). PowerShell passes->and=>through as ordinary arguments and rejects<-as a parse error. The legacy spelling is|. A tool MUST NOT show an arrow in a line meant for bash or zsh.The page SHOULD name the spellings that remain available on those shells (for help:
-help,help/i,-help/i, and the other CH-1 / CH-2 / CH-27 forms, plus-langwhere locale is needed). Quoted'?'or'-clean!!'may reach the tool; that is a shell fact, not a taught official fallback. Conforming tools MUST NOT accept~as an intensity stand-in. A token that looks like the retired fallback (-clean~,-clean~~) is an unknown option, and the error SHOULD point at this page.
-
| Section | Content (the page MUST contain all of them, in this order) |
|---|---|
Verified on |
The date and the exact shell versions the page was checked on (for example |
Unavailable spellings |
A table, one row per official spelling that a shell mangles: the spelling, the shell, what happens, and the official spelling that works there. No row offers a second official spelling for the same thing; the answer is "not available on this shell" or an already-official form. |
Always works |
The official spellings that every listed shell passes through unchanged ( |
Quoting facts |
Optional. Facts such as "quoted |
Legacy lowering |
How the native form of records, lists and help modes appears on a legacy shell ( |
Arrows |
Only when the tool documents Plus Shell native lines: the arrow warning of CH-28. |
The page SHOULD be a top-level help section named compatibility, so it is reachable as <tool> help compatibility and <tool> -help compatibility (section name PROPOSED). It is requested help: stdout, exit 0 (CH-17). A usage error about a mangled spelling (-clean~, -h/i, help/de) SHOULD end with see: <tool> help compatibility.
| Spelling | Shell | What happens | Official spelling that works |
|---|---|---|---|
|
bash |
Glob: becomes a one-character file name, stays literal when nothing matches, vanishes under |
|
|
zsh |
Error |
the same |
|
PowerShell 5.1, 7.7 |
Passed through intact (measured). |
any |
|
interactive bash, zsh; cmd with delayed expansion |
History or delayed expansion rewrites the word. Not available unless the user turned it off ( |
the shorthand is not available there; write the level value ( |
|
PowerShell 5.1, 7.7 |
Split into |
|
|
Git Bash, MSYS2 |
Rewritten before a native tool sees them ( |
|
|
bash, zsh |
|
Plus Shell ( |
Output language (-lang)
- CH-29
-
DECIDED (Ryan, 2026-12-05): the switch. The language a tool answers in is chosen with a separate
-lang <code>switch, space-separated, following NS-15 (a hyphen switch takes its value as the next argument and MUST NOT use=). It is not a help mode key (CH-27), not the?:colon suffix and not a glued key. It is the output language; the language the user types command words in is a different setting, set by thelangcommand (Input language). Neither reads the other.
lang-switch = "-lang" SP code
code = bcp47 / posix / hyphenless ; defined once, in Input language IL-3
Accepted code forms (DECIDED). The same three spellings of one language tag as lang accepts, case-insensitively: BCP 47 (de, en-US, zh-Hant), POSIX style (en_us, zh_hant) and hyphenless (enus, zhhant, es419). The grammar, the deterministic hyphenless parse and the build-time collision checks are specified once, in IL-3 and IL-4; this page does not repeat them. A tool MUST normalize the code to BCP 47 before it looks up a locale. A .codeset or @modifier suffix (en_US.UTF-8) is not accepted.
Resolution order (PROPOSED, normative here). A tool resolves the output language as follows and stops at the first hit:
-
-lang <code>, when present, looked up exactly (de-AT), then by language alone (de). -
Otherwise the process locale (OS locale;
LC_ALL,LANGand the platform’s user language, as prohelp does today, CH-10). -
Otherwise English.
The input language of the shell is never consulted.
| Reading | -lang on a help invocation |
-lang on any other invocation |
|---|---|---|
A: help-only |
Honoured. |
An unknown option: usage error, exit |
B: reserved global switch (the recommendation of the schema-first seed) |
Honoured. |
Accepted. Honoured if the tool localizes its output, otherwise accepted and ignored. |
Both readings agree on every help invocation, so a tool that implements help alone is conforming under either. Until Ryan decides, a tool SHOULD implement reading B outside help, and MUST NOT give -lang any other meaning. Whether the structured form -help {lang: de} may also set a help-local language is OPEN (schema-first seed, D10). -lang may appear before or after the help token (git commit -lang de -help/i is git commit -help/i -lang de; PROPOSED).
| Input | stderr | Exit |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
notice |
|
|
falls back to |
|
Compatibility. The switch is a hyphen option and is not mangled by any listed shell. Legacy shells keep today’s process-locale detection when -lang is absent.
== Bare invocation
- CH-5
-
A bare invocation (the tool name with no arguments) of a strict-style tool SHOULD print the top-level help overview, or a short usage line that names the exact help command, and perform no action (CD-5). If the tool runs a default action instead, its help MUST name that default and the bare run MUST announce it (CD-6), and
-helpMUST still print help without running the default.Prohelp today:
interceptreturnsfalsewhen there are no arguments, so bare-invocation behaviour is the tool’s own choice. A tool meets CH-5 by rendering its top-level help whenargs.length < 2; prohelp has no single call for that (see Requirements for prohelp to add).
Content and structure
- CH-6
-
Help MUST be progressive. The top-level view (Level 0) MUST be an overview that fits a screen: the tool’s name, title and one-line summary, then its top-level sections or commands, each with a one-line summary. Detail lives one level down (
<tool> ? <section>), not in the overview.Prohelp today: the help document is a tree of
sectionentries under acommand; prohelp renders one section per view in a box panel, and enforces sliding-scale line budgets (20 lines for the Level 0 menu; 20 / 40 / 60 lines by depth in the prohelp-cli model). - CH-7
-
The help document MUST set
name,summary,homepage,docsandissues, and every section MUST have a non-empty summary.titleanddescriptionSHOULD be set.Prohelp today: these are fields of the
commandmodel; prohelp warns at run time whenhomepage,docsorissuesis empty, andprohelp checkreports empty summaries, missing discovery URLs, empty sections and line-budget overruns. - CH-8
-
Help MUST list every command the dispatcher accepts, including aliases and any bare-invocation default (CD-16), and every flag each command accepts. Help MUST NOT document a command or flag the dispatcher rejects.
Prohelp gap: prohelp does not read the dispatcher, so it cannot check this; the tool’s tests must (for example by comparing the dispatch table with the help document’s sections).
- CH-9
-
A tool that declares a non-strict style MUST state it in its top-level help (CS-2).
- CH-10
-
Help SHOULD be localized when the tool ships other languages, and MUST fall back to English when the requested locale is missing. The explicit override is
-lang <code>, space-separated, following NS-15 (no=on hyphen switches), for examplegit commit -help/i -lang deorgit help/i commit -lang de([ch-27]). When-langis absent, the tool SHOULD use the process locale (OS locale /LANG/LC_ALL, as prohelp does today). The switch, its accepted code forms, its errors and both readings of its scope (help-only or a reserved global switch) are specified in [ch-29].Prohelp today: locale blocks in the document, OS locale detection, and fallback to
en. Locale used to be a colon suffix (?:de) or, briefly proposed, a glued key (?de); both are replaced by-lang. Prohelp gap: accept-lang <code>on a help invocation and resolve locale as:-langif present, otherwise the process locale, otherwise English.
Source of truth
- CH-11
-
A conforming tool’s help MUST come from an authored prohelp help document, not from strings assembled in code. The document MAY be
help.sdl(canonical) or a whole-documenthelp.md,help.adocorhelp.cmkwith frontmatter; section bodies MAY be pulled from shared files withcontent-ref. Generated help (for example a framework’s automatic-helpor--helpbuilt from method signatures) MUST NOT be the shipped help; a generator MAY scaffold a help document that people then edit.Prohelp today: all these formats load into the same
Commandtree (see Authoring schemas);prohelp initscaffolds ahelp.sdl, andprohelp fillcompletes it. - CH-12
-
The help document MUST ship with the tool and be found without network access. It SHOULD sit beside the binary, or be embedded in it.
Prohelp today: the global
helpcommand andprohelp --as-helplook beside the binary (and one directory up) forhelp.sdl,help.md/help.markdown,help.adoc/help.asciidoc,help.cmk, then<cmd>.help..interceptcalled with a defaultInterceptConfigreadshelp.sdlfrom the *current directory only, so a tool MUST pass anInterceptConfigthat points at its shipped document.Prohelp gap:
interceptdoes not yet use the beside-the-binary discovery order by default, and cannot yet read an embedded document. - CH-13
-
A conforming tool MUST render help through prohelp: by calling
prohelp.intercept(args)before its own argument parser (D, or other languages through FFI), or through prohelp-cli for D tools built on arsd.cli. A tool MUST NOT keep a second, hand-written help text that can drift from the document.Prohelp today:
interceptis the documented one-line integration; the C-compatible API is planned, not shipped. - CH-14
-
A project’s CI MUST run
prohelp check --strict(prohelp’s current, legacy GNU-style spelling) against the shipped help document, so empty or over-budget help cannot ship.Prohelp today:
prohelp check --strictfails the process on findings; the reusable workflowFreeCLI/prohelp/.github/workflows/check-schema.ymlruns it (pin a release tag rather than@main).
Subcommand help
- CH-15
-
For every command
<c>, these MUST all print help for<c>:<tool> help <c>(when CH-2 applies),<tool> ? <c>, and<tool> <c> -help/<tool> <c> -h. Nested commands follow the same pattern (<tool> ? <c> <sub>).Prohelp today:
<tool> ? <c>and<tool> help <c>resolve<c>as a section path in the document. With the prohelp-cli folder model,help/<version>/<c>/help.sdlmirrors the command and subdirectory names are the navigation tokens.Prohelp gap (NS-15): prohelp does not yet warn when a help document or tool declares a
--spelling (build time), or when a user types--help/--?(run time, CD-13 format on stderr, naming-help/-?). NS-15 requires both of a conforming framework.Prohelp gap:
interceptonly inspects the first argument, so<tool> <c> -help(or the legacy<tool> <c> --help) is not intercepted. Until prohelp handles a trailing trigger, the tool MUST map<c> -helpto the<c>section itself. - CH-16
-
A help path that names no section or command MUST be a usage error under CD-1: name the token, offer a did-you-mean suggestion when one is close, point to the top-level help, write to stderr and exit
2.Prohelp gap: today
interceptprintsprohelp error: Category path '<path>' not found.on stdout, offers no suggestion, and returnstrue, so a tool that returns0afterinterceptexits0.
Output, exit codes and streams
- CH-17
-
Requested help is a result: it MUST go to stdout (CO-19) and the tool MUST exit
0.Prohelp today: rendered help goes to stdout.
- CH-18
-
Help that the tool prints because of an error (the help pointer in a CD-1 or CD-8 error, or a usage summary after bad input) MUST go to stderr with the error, and the tool MUST exit
2. A missing or unreadable help document MUST be an error: message on stderr and a non-zero exit code.Prohelp today: a missing
help.sdlor a parse error is reported on stderr. Prohelp gap:interceptreturns only a boolean, so the tool cannot tell success from failure and the documented pattern (if (prohelp.intercept(args)) return 0;) exits0. Prohelp needs to return a status (or exit code). - CH-19
-
Help MUST NOT emit colour or terminal control sequences when stdout is not a terminal, and MUST stay readable on consoles that cannot draw Unicode boxes.
Prohelp today: colour only when stdout is a TTY; Unicode boxes when the console is UTF-8 or piped, ASCII
+|-on legacy Windows code pages; overridesPROHELP_ASCII=1andPROHELP_UNICODE=1. - CH-20
-
Notices about the help system itself (missing metadata, missing shell wrapper, feature-request nudges) MUST go to stderr, MUST NOT appear in the help body, and MUST be suppressible.
Prohelp today: suppressible with
PROHELP_QUIET=1. - CH-21
-
An interactive full-screen help viewer MAY be offered, but MUST be opt-in (for example
-help/iorhelp/i, long forms-help/interact/-help/interactive, and-help/panefor the single-pane viewport, [ch-27]) and MUST NOT start when stdout is not a terminal.Prohelp today:
?:i/?:interactiveopens the TUI only when stdout is a TTY; otherwise text help prints. Prohelp gap: the supported spellings are-help/i,help/i,-help/interact,help/interact,-help/interactiveandhelp/interactive(all accepted, DECIDED 2026-12-05), plus-help/paneandhelp/panefor the single-pane viewport (DECIDED name). The colon form is deprecated, and glued?ikeys are replaced ([ch-27]).
Machine-readable help
- CH-22
-
A conforming tool MUST offer a plain-text dump of a help subtree for scripts and agents, with no interactive behaviour and no colour when piped.
Prohelp today:
<tool> ? <section> *(orall) prints the section and all its descendants. - CH-23
-
A conforming tool MUST offer help as JSON on stdout (
<tool> -help -json, or<tool> -help/json/<tool> help/json, [ch-27]): the command tree with name, title, summary, description,homepage,docs,issues, the declared style (CS-2), and for each section or command its name, summary, body and child sections, with the requested locale applied. The field names are a public interface (CO-13).Prohelp gap: prohelp has no JSON output. Until it does, this rule is provisional: a tool is not marked non-conforming for missing it, and the field set above is the requirement for prohelp to implement.
- CH-25 (PROVISIONAL)
-
The JSON help of CH-23 SHOULD describe options precisely enough for shell tooling. Each option object carries
name,aliases,summary, and when they apply:levels(an array whose entry i is the meaning of the option at the i-th declared level; with the DECIDED level-as-value rule, 2026-12-05, the entries are keyed by the level value,-clean 1,-clean 2,-clean high, and alevelswitch also carries"type": "level"and its acceptedvalues; the older!-count reading applies only to the optional Plus Shell shorthand),operand(name,typeone ofpath,file,dir,string,int,enum, andvaluesforenum) andchildren(options one dash deeper under the NS-15 hierarchy candidate, nested to any depth). Each command carriesoperandswith the samename/type/valuesshape, options that apply everywhere go inglobal_options, and the document carries the toolversionso consumers can cache it per version. Provisional until the repeated-dash question (NS-15) is decided and prohelp emits it.
- CH-26
-
A tool SHOULD generate shell completions from the same help source:
<tool> completions zsh|bash|fish|pwshprints a completion script for that shell on stdout. This is the baseline. An OPTIONAL shell companion (NS-15 shell companion) may add more on top for interactive bash and zsh, but a tool MUST NOT depend on one.
Did-you-mean and errors
- CH-24
-
Every dispatch error (CD-1, CD-7, CD-8, CD-10) MUST name the exact help command that resolves it, such as
see: <tool> helporsee: <tool> help <command>, and that command MUST work under CH-2 and CH-15. Suggestions offered by did-you-mean (CD-1) SHOULD be drawn from the same command list the help document shows, so a suggestion is always a documented command.Prohelp gap: prohelp has no did-you-mean for commands or help paths; tools supply it in their dispatcher.
Requirements for prohelp to add
This standard requires these behaviours, which prohelp 0.2.3 does not yet provide.
Each belongs in FreeCLI/prohelp (or prohelp-cli where noted); until then the tool provides them.
-
Status from
intercept(CH-16, CH-18): return a result or exit code instead ofbool, so help success exits0and errors exit non-zero. -
Unknown help path is a usage error (CH-16): message on stderr, did-you-mean over section names, exit
2. -
Trailing triggers (CH-15): handle
<tool> <c> -help/-hby mapping it to section<c>. -
Bare-invocation helper (CH-5): one call that renders the Level 0 overview for a no-argument run.
-
Beside-the-binary discovery in
intercept(CH-12): use the same discovery order ashelpand--as-help(prohelp’s current spelling) instead of the current directory, and support an embedded document. -
JSON help (CH-23):
-help/json/help/json/-help -jsonemitting the field set in CH-23. The historical?:jsonspelling is deprecated ([ch-27]). Honour-langwhen JSON help is requested. -
Dispatch cross-check (CH-8): a way to compare the help document’s commands with a list the tool supplies (for example from prohelp-cli’s planned arsd.cli bridge) and fail
prohelp checkon a mismatch. -
C-compatible API (CH-13): already planned in prohelp, needed for non-D tools.
-
Compatibility and incompatibilities page (CH-28): ship a help page (or a clearly titled section) that lists official spellings that are simply unavailable on a given shell (at least unquoted
?/??/ glued keys in bash and zsh, and the optional!intensity shorthand in interactive bash and zsh), and points at the remaining official spellings (-help; level values such as-clean 2, which every shell passes through; and!only where the shell passes it through). Do not teach~as a fallback. -
-langcode forms and errors (CH-29): accept BCP 47, POSIX-style (en_us) and hyphenless codes case-insensitively, normalize to BCP 47, reject.codeset/@modifier, fall back fromde-ATtodeto English with a stderr notice, and use the error table of CH-29. Both readings of the scope must pass the help cases. -
Namespace-form help modes and
-lang(CH-27, CH-10): accepthelp/<key>and-help/<key>(i/interact/interactive,pane,json,text); do not treat-h/<key>as a mode; honour-lang <code>for locale; warn on?:forms for one release (mapping?:de,ito-help/i -lang deand?:deto-help -lang de), then remove them; keepinteractiveas a long form with no warning, and addinteract,iandpane; treathelp/deand other unrecognised keys as a CH-16 error, with a-langhint when the token looks like a language code.
Conformance checklist
-
-helpand-hprint help and exit0(CH-1, CH-17). -
A tool with subcommands accepts
helpandhelp <command>;helpis never read as a target (CH-2, CH-4). -
Bare invocation shows help, or announces its documented default;
-helpnever runs the default (CH-5). -
The Level 0 overview fits the line budget and every section has a summary (CH-6, CH-7).
-
Help lists every accepted command, alias, flag and default, and nothing the dispatcher rejects (CH-8, CD-16).
-
Help comes from a shipped prohelp document rendered through prohelp; no hand-written duplicate (CH-11 to CH-13).
-
CI runs
prohelp check --strict(CH-14). -
<tool> <c> -help,<tool> ? <c>and<tool> help <c>agree for every command (CH-15). -
An unknown help path is an error on stderr with exit
2(CH-16). -
Requested help on stdout, exit
0; error help on stderr, exit2; no colour when piped (CH-17 to CH-19). -
Help-system notices go to stderr and
PROHELP_QUIET=1silences them (CH-20). -
<tool> ? *dumps the help tree as text (CH-22); JSON help when available (CH-23, provisional). -
Namespace-form help modes (
help/i,-help/i,help/interact,help/interactive,help/pane,-help/json, and the other CH-27 spellings) are accepted,interactivewithout a warning; locale is-lang <code>; the colon form and glued?ikeys are not the supported spelling (CH-10, CH-27). -
A compatibility/incompatibilities help page (or section named
compatibility) has the required sections of CH-28 (verified-on, unavailable spellings, always-works, legacy lowering), covers glob?, history!, PowerShell dotted splitting, Git Bash one-letter/rewrites and, where shown, the bash arrow danger, and does not teach~as a fallback (CH-28). -
-lang <code>accepts BCP 47,en_usand hyphenless codes; resolves-lang, then the OS locale, then English; rejects-lang=de, a missing or repeated value and a malformed code with exit2; falls back to English with a notice for an unsupported code (CH-29). -
Intensity options are
level-typed switches (-clean 2,-verbose 0; NS-15): the next token is the level only if it is in the declared enum,0means disabled, and-clean2or-clean=2is a usage error. -
The CH-27 error cases of the error table (unknown mode, prefix, two modes, commas, empty key,
-h/i) exit2with the stated messages. -
Every dispatch error names a working help command (CH-24).
-
JSON help carries option levels, operand types and children (CH-25, provisional).
-
<tool> completions zsh|bash|fish|pwshprints a completion script (CH-26).
Self-test cases are in CLI Dispatch conformance.