Document the TUI as a usage surface - #60
Merged
Merged
Conversation
`bitrouter tui` shipped in v1.0.0-alpha.27 but had no page: the CLI overlay's `## @tui` block is silently dropped because .cli-snapshot.json is still alpha.26, so `usage/cli/harnesses` promises three commands and renders two. Add `usage/tui.mdx` as the concept page, sibling to `usage/mcp.mdx` — the same split that page already has with the generated CLI reference. Usage now reads as the three ways to drive BitRouter: CLI, MCP, TUI. Structured around the console's own model rather than a keybind dump, since none of the keys make sense before the ownership rule does: sessions take your input, subagents never do. Facts are taken from apps/bitrouter/src/tui/ rather than TUI_SPEC_V3, which has drifted — the roster is a right-hand rail (not the spec's left), `Ctrl-C` has three distinct behaviours by pane kind and ownership, and `:` reaches the palette only from a monitor pane. Includes the harness matrix, which is two independent columns: pi and openclaw are routed but get no fleet MCP tools, and grok/agy get neither. A harness without those tools can host the orchestrator pane but can never spawn a subagent — the rail just stays empty, which is the failure this table predicts. The `bitrouter tui` flag reference it links to appears once the CLI snapshot is re-captured from an alpha.27+ binary.
The authoring contract told writers to prefer `> [!NOTE]` blockquotes, but the site registers only remarkGfm + rehypeSlug — no alerts plugin — so those render as a plain blockquote with a literal `[!NOTE]` in the body. Nothing under content/ used the syntax, so nothing was broken; the contract just invited it, and lint:docs stayed green either way. The trap is that alerts DO render in repo Markdown like CONTRIBUTING.md, because GitHub renders those itself. Say so, make <Callout> the only documented form, and fail the lint on the syntax so it can't come back silently. Fenced examples still pass, so docs can document the form they forbid. Also close two gaps found while checking the fix: - `usage/` was excluded from linting outright. The exclusion exists for the generated `usage/cli/` pages, but it was a level too coarse: hand-authored `usage/mcp.mdx` and `usage/tui.mdx` were never checked, so the new rule would not have covered the page that surfaced this. Lint `usage/` and skip only the generated subtree — 45 → 47 docs. - Reported line numbers were body-relative, because splitFrontmatter drops the frontmatter and the blank run after it, so an alert on line 8 reported as :3. Pre-existing for the import/export check too. Both now point at the real line.
Main's #59 collapsed the ten generated `usage/cli/` pages into one `usage/cli.mdx`, moved Integrations and Guides out of the `(guide)` group into their own tabs, and dissolved AI Resources into `usage/`. Three resolutions: - `usage/meta.json`: main made Usage cli + mcp + skills. Insert `tui` after `cli` — those two are the binary's human-facing surfaces, and mcp/skills are how agents drive it. - `scripts/check-docs.mjs`: main independently closed the same `usage/` lint gap this branch did, and did it better for the new layout — section paths are now `(guide)/`-prefixed since Integrations and Guides are top-level, and GENERATED is an exact-path Set because the CLI reference is one file rather than a subtree. Took main's version wholesale and re-applied only what it doesn't have: the alert rule and the frontmatter line-number offset. - `usage/tui.mdx` See also: the CLI subpages it linked to no longer exist. Repointed at the single page's anchors. Main also folded the `tui` blurb into the Harnesses section intro and noted it has no generated subsection (it is absent from the alpha.26 snapshot's `--help`), so the section link now lands on real prose. Also lists `tui.mdx` in CONTRIBUTING's `usage/` inventory. Verified: lint 48 docs / 6 sections; the alert rule still fails a bare alert at the right line and passes a fenced one; 83/83 tests; `generate:cli` reproduces the committed page byte-for-byte; every outbound link on the TUI page returns 200 and all three CLI anchors resolve.
SPIKESPIGEL404
added a commit
that referenced
this pull request
Aug 6, 2026
Both PRs added a page to `usage/`, so the section list and CONTRIBUTING's inventory conflicted. Both resolutions are additive — neither side was replacing the other. Nav order is cli · tui · configuration · mcp · skills: the two surfaces you run, then the file they read, then the two agent-facing ones. Verified after merging: lint 49 docs / 6 sections, now including the GitHub-alert rule main gained in #60 — the configuration page uses <Callout> throughout and passes it; 83/83 tests; all five Usage pages plus the two edited pages return 200.
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.
Adds
usage/tui.mdx, and fixes a docs-contract trap found while writing it.The TUI page
bitrouter tuishipped in v1.0.0-alpha.27 but has no page. Worse, it's half-promised:cli-overlays/harnesses.mdalready carries a## @tuiblock andgenerate-cli.mjsliststuiin the group, but the generated page renders onlylaunchandspawn—.cli-snapshot.jsonis still alpha.26, which predates the command. So the page titled "launch, spawn & tui" silently ships two of three.This adds the concept page as a sibling of
usage/mcp.mdx— the same split that page already has with the generated CLI reference.usage/now reads as the three ways to drive BitRouter: CLI, MCP, TUI.Structure follows the console's model, not a keybind dump. opencode's TUI page was the starting reference, but most of it doesn't transfer: its page is ordered input-first (
@file refs,!bash, 17 slash commands) because its TUI is a text box. Ours has no composer anywhere — subagent panes are read-only by design. So the page leads with the ownership rule (sessions take your input, subagents never do), because no key makes sense before it. Its verb table carries aReached fromcolumn rather than flattening three tiers — inline, leader, palette — into one list.Facts come from
apps/bitrouter/src/tui/, notTUI_SPEC_V3.md, which has drifted:Ctrl-Chas three behaviours by pane kind and ownership, and never quits the console:reaches the palette only from a monitor pane — a session swallows it#[cfg(unix)], so delegation degrades on WindowsThe harness matrix is two independent columns:
piandopenclaware routed but get no fleet MCP tools;grokandagyget neither. A harness without those tools can host the orchestrator pane but can never spawn a subagent — the rail just stays empty, which is the failure that table predicts.The lint fix
The authoring contract told writers to prefer
> [!NOTE]blockquotes. That doesn't work here —source.config.tsregisters onlyremarkGfm+rehypeSlug, so alerts render as a plain blockquote with a literal[!NOTE]visible. Nothing undercontent/used the syntax, so nothing was broken in production; the contract just invited it, andlint:docsstayed green either way. The trap is that alerts do render in repo Markdown likeCONTRIBUTING.md, because GitHub renders those itself.Made
<Callout>the only documented form and added a lint rule. Fenced examples still pass, so docs can document the form they forbid.Two gaps closed while verifying:
usage/was excluded from linting outright. The exclusion exists for the generatedusage/cli/pages, but it was a level too coarse — hand-authoredusage/mcp.mdxandusage/tui.mdxwere never checked, so the new rule wouldn't have covered the page that surfaced this. Now lintsusage/and skips only the generated subtree.splitFrontmatterdrops the frontmatter and the blank run after it, so an alert on line 8 reported as:3. Pre-existing for the import/export check too; both now point at the real line.Verification
pnpm lint:docs— OK, 47 docs across 6 sections (was 45/5)pnpm test— 83/83:8,:7).Follow-up (not in this PR)
The
bitrouter tuiflag reference this page links to still doesn't exist. It appears with no further authoring once the snapshot is re-captured from an alpha.27+ binary — that needs a local upgrade and rewrites two committed generated files, so I left it out:🤖 Generated with Claude Code