Source: ViewEdit

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 prohelp, 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 14 (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 prohelp.intercept call). The gaps are collected in Requirements for prohelp to add.

Help invocations

CH-1

A conforming tool MUST print help when its first argument is -help or -h (single-dash options, NS-15).

Prohelp today: prohelp.intercept(args) treats ?, help, --help, -h and --? (case-insensitive) in the first argument position as help triggers. --help and --? are legacy GNU-style spellings; prohelp does not yet recognize -help or -?.

CH-2

A tool that has subcommands MUST also accept help as a command: <tool> help prints the same top-level help as <tool> -help, and <tool> help <command> prints help for that command. help MUST therefore be listed among the tool’s commands (CD-16) and MUST NOT fall through to any other path. A tool without subcommands MAY accept help the same way.

help here 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 declares help as a node at the top level (and under each command that takes help), so <tool> help and <tool> -help are both legal and do not conflict. Help is help-first (decided 2026-10-26): the primary mode is shell-level help <path> (prohelp), which serves help from the resources tools ship, and the path tokens are values (help git commit names the path git/commit). <tool> help and <tool> -help are compatibility paths to that same resource.

This closes the case shown in CLI Dispatch: redub help is read as a package named help and run, while only redub --help (redub’s current, legacy GNU-style spelling) prints help. Under CH-2 that tool does not conform until redub help prints help (and under CD-3 it must not run anything either way).

Prohelp today: help is already a trigger in intercept, so a tool that calls intercept before 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 to help and -help with / (help/i, -help/i, help/json), as specified in [ch-27], not as glued keys on ?. Locale is a separate -lang switch. 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 intercept first, 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 help node and on the -help switch, 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-word help node 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 help or -help is already accepted (CH-2, CH-15), so git commit -help/i -lang de and git help/i commit -lang de are help invocations for commit.

  • 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 sub opens the interact viewer on install/sub. After help/<key>, the following path tokens are the topic path, as with help today: <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.

Table 1. Reserved modes (spellings DECIDED 2026-12-05; registry rules PROPOSED)
Short Full Meaning

i

interact, interactive

Opt-in interact viewer (CH-21). Nested windows by default; the single-pane fallback is the separate mode pane (DECIDED 2026-12-05).

(none)

text

Static text help (not the viewer).

(none)

json

JSON help (CH-23).

(none)

pane

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 i (-help/i -help/pane is a CH-16 error).

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.

Table 2. Worked examples
Supported form Deprecated colon form Meaning

-help/i or help/i (long: -help/interact, help/interact)

?:i or ?:interact

Interact viewer, process locale.

-help/i -lang de or help/i …​ -lang de

?:de,i or ?:i,de

Interact viewer, German.

-help -lang de or help -lang de

?:de

Default (text) help, German.

-help/text or help/text

?:text

Static text help, process locale.

-help/json or help/json

?:json

JSON help (CH-23), process locale.

-help/json -lang de

?:de,json

JSON help, German.

git commit -help/i -lang de or git help/i commit -lang de

git commit ?:de,i

Interact viewer for commit, German.

-help or help

? (still a CH-3 form, unchanged for now)

Level 0 help; no mode key; process locale.

--?

--? (unchanged)

Legacy exact trigger; not a mode key. Subject to the leaning on abandoning ?, above.

help/de or -help/de

?:de (as a glued locale)

Error (CH-16): unknown mode; suggest use: -help -lang de.

help/inter or -help/inter

 — 

Error (CH-16): not in the alias table.

-help/i -help/json

 — 

Error (CH-16): at most one mode or format key (PROPOSED).

help/interactive or -help/interactive

?:interactive

Interact viewer, process locale (a DECIDED long form, the same as help/interact; no warning).

help/pane or -help/pane

(none)

Interact viewer in the single-pane viewport (DECIDED name).

Table 3. CH-27 status at a glance
Status What

DECIDED (Ryan, 2026-12-05)

The spellings help/i, help/interact, help/interactive, help/pane, -help/i, -help/interact, -help/interactive, -help/pane, -help/json, help/json, -help/text, help/text; / as the separator; both positions (git help/i commit, git commit -help/i); they replace glued ?i keys; the keywords i, interact and interactive (all accepted, no warning); the single-pane mode pane; no -h/i; locale is the separate -lang switch (CH-29); the ?: one-release deprecation.

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 ?i (prohelp v0.3.1 implements it provisionally), after which the next release rejects it.

OPEN

Whether -lang is global or help-only and a help-local -help {lang: de} override (CH-29).

LEANING (not final)

Abandon ? as a help trigger. ? is still documented (CH-3) and still not removed.

CH-27 grammar and positions (the rules above and below are normative; the grammar restates them)
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

git help/i commit

node form: help is a declared node under git (CH-2); topic commit

interact viewer on commit

git commit -help/i

switch form on commit (CH-15)

the same

git help/i

node form, no topic

interact viewer on the top level

help/i git commit

shell-level help (decided 2026-10-26): help is the node, git and commit are values naming git/commit

the same

git -help/i commit

switch form, topic after the switch (PROPOSED)

interact viewer on commit

git commit -lang de -help/i

-lang may sit before or after the help token (PROPOSED, CH-29)

German interact viewer on commit

git help/json commit

node form, format key

JSON help for commit on stdout, exit 0

git help/i commit with stdout not a terminal

CH-21

text help on stdout, exit 0; the viewer does not start

Table 4. CH-27 error cases (usage errors are CD-8 / CH-16: stderr, exit 2)
Input stderr Exit

help/de, -help/de

error: unknown help mode 'de', then ` use: -help -lang de`, then ` modes: i, interact, text, json`, then ` see: <tool> help`

2

help/inter

error: unknown help mode 'inter', then ` did you mean: interact`, then ` see: <tool> help`

2

-help/i -help/json, or help/i with -help/json

error: more than one help mode ('i' and 'json'), then ` use one of: i, interact, text, json`, then ` see: <tool> help`

2

-help/i,json

error: unknown help mode 'i,json': a mode key has no commas, then ` see: <tool> help`

2

help/, -help/

error: empty help mode after '/', then ` modes: i, interact, text, json`

2

-h/i, -h/interact

error: invalid option '-h/i': a one-letter option takes no '/key', then ` use: -help/i`

2

git help/i nosuch

CH-16: unknown help path nosuch, did-you-mean, no viewer starts

2

?:i in the deprecation release

help is served on stdout; stderr carries the two-line warning of the deprecation path above

0

?:i in the following release

rejected like any unknown mode (CH-16)

2

leftover glued ?i

For one release (prohelp v0.3.1 does this today, provisionally): warn use: -help/i and serve help (exit 0). The next release rejects it as unknown input (CD-1)

0, then 2

help/interactive

DECIDED: served exactly like help/interact, with no warning

0

-help/i -help/pane

error: only one help mode is allowed (got 'i' and 'pane') (CH-16)

2

Prohelp today: as of prohelp v0.3.2 (2026-12-06; URL and text updates for FreeCLI; the behaviour below landed in v0.3.1), 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 under nullglob, or error under nomatch / failglob). The current supported mode form is help/i and -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/i or any one-letter switch plus /mode: those arguments are rewritten before a native tool sees them (measured 2026-12-05: -h/i arrived as -hI:/). The decided forms help/i and -help/i arrived 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 x264 is split into -video, .codec and x264 before a native program sees it (measured 2026-12-05, and reproduced by D Lang with cmd /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 -> b or a => b is not a token: it is - or = plus a > redirection that silently creates or truncates the file b (measured 2026-12-05, bash 5.2.37; a <- b redirects 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 -lang where 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.

Table 5. CH-28 required sections
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 bash 5.2.37, Windows PowerShell 5.1.26100, PowerShell 7.7.0, Git Bash MSYS 3.6.10, cmd, zsh, fish, plush), and which rows were measured and which come from shell documentation.

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 (-help, help/i, -help/i, -lang de, and the tool’s own).

Quoting facts

Optional. Facts such as "quoted '?' reaches the tool". It MUST NOT present quoting as the way to type an official form.

Legacy lowering

How the native form of records, lists and help modes appears on a legacy shell (-video/codec x264, repeated options, help/i), and that one-letter switches take no /key.

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.

Table 6. CH-28 baseline rows (every tool starts from these and re-checks them for its own spellings)
Spelling Shell What happens Official spelling that works

?, ?? (unquoted)

bash

Glob: becomes a one-character file name, stays literal when nothing matches, vanishes under nullglob. Measured 2026-12-05, bash 5.2.37 with files a, ab, xi: git commit ? became git commit a; ?? became ab xi.

-help, help, help/i, -help/i

?, ??

zsh

Error no matches found by default (NOMATCH; from the zsh documentation, not re-run).

the same

?, ??, ?i

PowerShell 5.1, 7.7

Passed through intact (measured).

any

-clean!, -clean!!

interactive bash, zsh; cmd with delayed expansion

History or delayed expansion rewrites the word. Not available unless the user turned it off (set +H, unsetopt BANG_HIST).

the shorthand is not available there; write the level value (-clean 1, -clean 2), which works everywhere; there is no ~ stand-in

-video.codec

PowerShell 5.1, 7.7

Split into -video and .codec (measured).

-video/codec

-h/i, -v/codec, /i

Git Bash, MSYS2

Rewritten before a native tool sees them (-h/i to -hI:/, /i to I:/; measured).

-help/i, -video/codec (two or more letters before /)

a -> b, a => b

bash, zsh

> redirection: silently creates or truncates b (measured).

Plus Shell (plush) only; not available in legacy shells

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 the lang command (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:

  1. -lang <code>, when present, looked up exactly (de-AT), then by language alone (de).

  2. Otherwise the process locale (OS locale; LC_ALL, LANG and the platform’s user language, as prohelp does today, CH-10).

  3. Otherwise English.

The input language of the shell is never consulted.

Table 7. Scope: two readings (OPEN, written so both work)
Reading -lang on a help invocation -lang on any other invocation

A: help-only

Honoured.

An unknown option: usage error, exit 2 (CD-8).

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).

Table 8. CH-29 error and fallback cases
Input stderr Exit

-lang with no value

error: option '-lang' needs a language code, then ` see: <tool> help`

2

-lang=de

error: invalid option '-lang=de': hyphen switches take a space-separated value, then ` write: -lang de`

2

-lang de -lang fr

error: option '-lang' given twice

2

-lang xx!, -lang en_US.UTF-8

error: invalid language code 'xx!' (or …​'en_US.UTF-8': no codeset or modifier), then ` write: en_us, en-US or enus`

2

-lang tlh, a well-formed code the tool has no help for

notice notice: no 'tlh' help; showing English (CH-20: stderr, suppressible); help is printed in English on stdout

0

-lang de-AT when only de exists

falls back to de, with the same kind of notice (PROPOSED)

0

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 -help MUST still print help without running the default.

Prohelp today: intercept returns false when 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 when args.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 section entries under a command; 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, docs and issues, and every section MUST have a non-empty summary. title and description SHOULD be set.

Prohelp today: these are fields of the command model; prohelp warns at run time when homepage, docs or issues is empty, and prohelp check reports 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 example git commit -help/i -lang de or git help/i commit -lang de ([ch-27]). When -lang is 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: -lang if 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-document help.md, help.adoc or help.cmk with frontmatter; section bodies MAY be pulled from shared files with content-ref. Generated help (for example a framework’s automatic -help or --help built 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 Command tree (see Authoring schemas); prohelp init scaffolds a help.sdl, and prohelp fill completes 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 help command and prohelp --as-help look beside the binary (and one directory up) for help.sdl, help.md / help.markdown, help.adoc / help.asciidoc, help.cmk, then <cmd>.help.. intercept called with a default InterceptConfig reads help.sdl from the *current directory only, so a tool MUST pass an InterceptConfig that points at its shipped document.

Prohelp gap: intercept does 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: intercept is 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 --strict fails the process on findings; the reusable workflow FreeCLI/prohelp/.github/workflows/check-schema.yml runs 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.sdl mirrors 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: intercept only 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> -help to 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 intercept prints prohelp error: Category path '<path>' not found. on stdout, offers no suggestion, and returns true, so a tool that returns 0 after intercept exits 0.

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.sdl or a parse error is reported on stderr. Prohelp gap: intercept returns only a boolean, so the tool cannot tell success from failure and the documented pattern (if (prohelp.intercept(args)) return 0;) exits 0. 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; overrides PROHELP_ASCII=1 and PROHELP_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/i or help/i, long forms -help/interact / -help/interactive, and -help/pane for the single-pane viewport, [ch-27]) and MUST NOT start when stdout is not a terminal.

Prohelp today: ?:i / ?:interactive opens 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/interactive and help/interactive (all accepted, DECIDED 2026-12-05), plus -help/pane and help/pane for the single-pane viewport (DECIDED name). The colon form is deprecated, and glued ?i keys 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> * (or all) 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 a level switch also carries "type": "level" and its accepted values; the older !-count reading applies only to the optional Plus Shell shorthand), operand (name, type one of path, file, dir, string, int, enum, and values for enum) and children (options one dash deeper under the NS-15 hierarchy candidate, nested to any depth). Each command carries operands with the same name/type/values shape, options that apply everywhere go in global_options, and the document carries the tool version so 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|pwsh prints 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> help or see: <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.

  1. Status from intercept (CH-16, CH-18): return a result or exit code instead of bool, so help success exits 0 and errors exit non-zero.

  2. Unknown help path is a usage error (CH-16): message on stderr, did-you-mean over section names, exit 2.

  3. Trailing triggers (CH-15): handle <tool> <c> -help / -h by mapping it to section <c>.

  4. Bare-invocation helper (CH-5): one call that renders the Level 0 overview for a no-argument run.

  5. Beside-the-binary discovery in intercept (CH-12): use the same discovery order as help and --as-help (prohelp’s current spelling) instead of the current directory, and support an embedded document.

  6. JSON help (CH-23): -help/json / help/json / -help -json emitting the field set in CH-23. The historical ?:json spelling is deprecated ([ch-27]). Honour -lang when JSON help is requested.

  7. 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 check on a mismatch.

  8. C-compatible API (CH-13): already planned in prohelp, needed for non-D tools.

  9. 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.

  10. -lang code 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 from de-AT to de to English with a stderr notice, and use the error table of CH-29. Both readings of the scope must pass the help cases.

  11. Namespace-form help modes and -lang (CH-27, CH-10): accept help/<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,i to -help/i -lang de and ?:de to -help -lang de), then remove them; keep interactive as a long form with no warning, and add interact, i and pane; treat help/de and other unrecognised keys as a CH-16 error, with a -lang hint when the token looks like a language code.

Conformance checklist

  • -help and -h print help and exit 0 (CH-1, CH-17).

  • A tool with subcommands accepts help and help <command>; help is never read as a target (CH-2, CH-4).

  • Bare invocation shows help, or announces its documented default; -help never 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, exit 2; no colour when piped (CH-17 to CH-19).

  • Help-system notices go to stderr and PROHELP_QUIET=1 silences 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, interactive without a warning; locale is -lang <code>; the colon form and glued ?i keys 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_us and hyphenless codes; resolves -lang, then the OS locale, then English; rejects -lang=de, a missing or repeated value and a malformed code with exit 2; 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, 0 means disabled, and -clean2 or -clean=2 is a usage error.

  • The CH-27 error cases of the error table (unknown mode, prefix, two modes, commas, empty key, -h/i) exit 2 with 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|pwsh prints a completion script (CH-26).

Self-test cases are in CLI Dispatch conformance.