You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Man pages are the original machine-readable documentation — structured, parseable, and now the ideal format for AI agents to understand CLI tools. With agents increasingly using CLIs directly (see Karpathy's take), shipping proper man pages makes bm a first-class citizen in agent workflows.
The bm CLI has enough subcommands and complex flag combinations (especially search-notes with --hybrid, --min-similarity, --metadata-filters, --project, etc.) that --help output alone isn't sufficient. Man pages provide the EXAMPLES section that both humans and agents need.
Install location: man bm-search-notes should work after uv tool install basic-memory.
3. MCP prompts as structured docs
The same man-page content could be served via MCP prompts capability — giving agents structured reference docs (SYNOPSIS + EXAMPLES) before they call a tool. This is the programmatic equivalent of man for MCP-connected agents.
Second slice: #1389 bundles the 23 section-3 pages in the package (src/basic_memory/man/man3/), serves them as MCP resources (memory://man index, memory://man/<page> with any spelling of a page reference), and adds bm man <topic> / bm man list. bm man install unchanged. Next: registry generator for SYNOPSIS/PARAMETERS, bm man install --project, groff for section 3.
Third slice: #1393 makes the MCP SYNOPSIS block on every section-3 page a generated section — just man-regen renders it from the live tool registry, pages flip to generated: registry, and a test holds the shipped blocks byte-equal to the rendering (a tool change without a regenerate fails CI). Also adds basic-memory-diagnostics(3), so the section-3 corpus now matches the tool registry one-to-one. Remaining from the roadmap: PARAMETERS from schema descriptions, section-1 pages from Typer help, bm man install --project.
Hey Paul — nice work landing the SYNOPSIS generator in #1393! The three-round Codex review cycle that hardened the frontmatter flip and escape handling is a good example of the kind of incremental cleanup that compounds.
I'd like to take the next slice: PARAMETERS generation from schema descriptions. The data source is already there — every tool schema exposes description on each property (I checked: all registered tools have descriptions on all params except the no-param basic_memory_diagnostics).
Specifically what I'm thinking:
render_parameters() in basic_memory.man — renders a ## PARAMETERS section from the tool's JSON schema properties, producing the same - **name** — description bullet format the hand-written pages use. Required params first, then optional, in schema order (mirroring SYNOPSIS). Type info and defaults woven into the description naturally.
extract_parameters() / replace_parameters() — regex helpers matching the ## PARAMETERS block, parallel to the existing extract_mcp_synopsis() / replace_mcp_synopsis() pair.
Update scripts/update_man_pages.py to also regenerate PARAMETERS alongside SYNOPSIS.
Extend the drift test in tests/test_man_pages.py to hold shipped PARAMETERS byte-equal to the rendering (same pattern as SYNOPSIS).
Preserve hand-curated content — the 6 pages that already have PARAMETERS sections (write-note, search-notes, build-context, edit-note, read-note, recent-activity) have field knowledge that goes beyond the schema descriptions (gotcha cross-refs, behavioral notes). The generator should produce the mechanical description; curated additions can either be preserved as-is or folded into tool docstrings upstream so the generator captures them.
The tricky design question: should the generator wholesale replace PARAMETERS (like it does SYNOPSIS), or should there be a merge strategy that preserves hand-written additions? SYNOPSIS is one-to-one with the schema so byte equality makes sense; PARAMETERS currently carry field knowledge (e.g. write-note's notes about overwrite behavior, search-notes' min_similarity threshold guidance) that isn't in the schema. Two approaches:
Option A: Generator owns PARAMETERS entirely. Curated content migrates to tool docstrings so it flows through the schema.
Option B: Generator produces a baseline; hand-written pages can extend individual bullets with curated notes that survive regeneration (trickier regex, more maintenance).
I lean toward Option A — it's the same principle that made SYNOPSIS reliable. Happy to hear your preference before starting.
This builds on my earlier contributions (PR #1380 tool reference, #1386 search_notes example fix). Let me know if this slice is available and if you have any preferences on the approach!
Thanks for checking in — yes, this slice is open, and Option A is the direction we want.
Please have the registry generator own the complete ## PARAMETERS section. Parameter-specific details should live in the MCP schema descriptions so they reach both clients and the generated manual; broader explanations, examples, and gotchas should remain in their existing curated sections.
A few scope notes:
generate every schema property, required first and then optional in schema order;
render required/default information deterministically rather than trying to merge or interpret existing prose;
replace the complete PARAMETERS block on regeneration;
extend the live-registry drift test so every generated page is checked against its actual tool schema;
use clear scenario-focused tests rather than a parameterized formatting matrix.
Please keep the PR to PARAMETERS generation and any schema-description improvements required to preserve genuinely parameter-specific information. Thanks for taking this on.
Got it, thanks — Option A it is. I'll keep the PR to registry-owned PARAMETERS (required first, then optional, schema order; deterministic required/default rendering; full-block replacement on regen) plus the drift-test extension and scenario-focused tests, with only the schema-description changes needed so nothing parameter-specific from the curated pages gets lost. PR coming shortly.
Thanks for merging #1478 — good to see PARAMETERS land clean.
I'd like to take the next slice on the roadmap: section-1 pages generated from the Typer help.
Current state: the eight bundled section-1 pages (apropos, cat, find, grep, head, ls, tail, tree) are all generated: hand, and their SYNOPSIS and OPTIONS blocks are mechanical restatements of the POSIX verb definitions in cli/commands/posix.py. They already drift — grep(1)'s SYNOPSIS lists --json, --plain, --project, --local, --cloud, but OPTIONS only documents -F and the pagination flags. That's exactly the class of drift the section-3 work removed.
Proposed scope, mirroring the SYNOPSIS/PARAMETERS split:
render_cli_synopsis() / render_options() in basic_memory.man, rendering from the Typer command tree (typer.main.get_command(app), walking to the named subcommand) rather than the MCP registry — arguments first, then options in declaration order, with defaults rendered deterministically the same way render_parameters does.
extract_options() / replace_options() regex helpers alongside the existing extract_parameters() / replace_parameters() pair, and a section-1 branch in regenerate_page().
scripts/update_man_pages.py regenerates section-1 alongside section-3, so just man-regen stays the one entry point.
Drift test extension in tests/test_man_pages.py: every section-1 page whose command this build registers is byte-equal to the live rendering, plus the ownership-declaration check. Scenario-focused tests, same as last time.
Help text improvements in posix.py only where a flag currently has no help= and the generated page would otherwise render an empty bullet.
Out of scope: the groff sources (bm.1, basic-memory.1) stay hand-owned — the COMMANDS overview there isn't one-to-one with anything, and groff generation is its own roadmap item.
One design question before I start. Section-3 declares generated: registry because the MCP tool registry is the source. Section-1's source is the Typer tree, which is a different surface — do you want a distinct token (generated: cli) so generated: names the actual owner, or is one registry value across both simpler to reason about? test_registry_pages_declare_registry_ownership gets the corresponding branch either way. I'd lean toward cli, but it's your frontmatter vocabulary.
The other judgement call: generated OPTIONS will be the complete flag list, so pages like grep(1) grow from two bullets to the full set. I read that as the point — but if you'd rather keep OPTIONS curated and only generate SYNOPSIS on section 1, say so and I'll cut it to that.
PR within a week either way. Happy to start on the cli token and adjust if you prefer otherwise.
Thanks—this fits the existing approach. Please extend the current just man-regen pipeline, using the Typer command tree as the source for section-1 SYNOPSIS and OPTIONS, just as the MCP tool schemas drive section 3.
Use generated: cli, and generate the complete public options list, including shared flags. Keep DESCRIPTION, EXAMPLES, and other curated sections hand-owned. Reuse the existing section-replacement machinery where practical, while preserving CLI-specific syntax such as flag aliases and paired boolean options.
Drift tests and targeted improvements to missing help= text sound right. Agreed on leaving the groff sources out of scope.
The CLI: blocks on section-3 pages are owned by neither generator, and no test holds them to the Typer tree.
search-notes(3) advertises bm tool search-notes ... [--search-type TYPE], but the resolved Click command has no --search-type — it exposes --permalink/--title/--vector/--hybrid. The page is already stale.
Nothing catches this by design: replace_mcp_synopsis deliberately leaves the CLI block alone (test_replace_mcp_synopsis_touches_only_the_mcp_block asserts it), and the section-1 generator only walks pages named after a bm verb — bm tool <verb> is not one. 12 of 22 section-3 pages carry such a block.
Which way do you want it?
(a) section-3 generator also owns CLI:, rendered from the Typer tree and drift-tested beside the MCP SYNOPSIS; or
(b) CLI: leaves section 3 for a bm tool section-1 page, section 3 stays MCP-only.
The drift test lands in a different place for each, so this needs deciding first.
Done. bm.1 and the section-1 pages ship in the package, with SYNOPSIS/OPTIONS generated from Typer (#1524). The stale bm tool search-notes CLI block raised above went away with the 1.0 tool surface (#1881); search-notes(3) no longer exists.
Activity
claude commentedon Feb 26, 2026
Claude encountered an error —— View job
I'll analyze this and get back to you.
feat(cli): make 'man bm' real — bundled groff page and 'bm man install'
phernandez commentedon Aug 30, 2026
Second slice: #1389 bundles the 23 section-3 pages in the package (
src/basic_memory/man/man3/), serves them as MCP resources (memory://manindex,memory://man/<page>with any spelling of a page reference), and addsbm man <topic>/bm man list.bm man installunchanged. Next: registry generator for SYNOPSIS/PARAMETERS,bm man install --project, groff for section 3.phernandez commentedon Aug 30, 2026
Third slice: #1393 makes the MCP SYNOPSIS block on every section-3 page a generated section —
just man-regenrenders it from the live tool registry, pages flip togenerated: registry, and a test holds the shipped blocks byte-equal to the rendering (a tool change without a regenerate fails CI). Also addsbasic-memory-diagnostics(3), so the section-3 corpus now matches the tool registry one-to-one. Remaining from the roadmap: PARAMETERS from schema descriptions, section-1 pages from Typer help,bm man install --project.FBISiri commentedon Sep 2, 2026
Hey Paul — nice work landing the SYNOPSIS generator in #1393! The three-round Codex review cycle that hardened the frontmatter flip and escape handling is a good example of the kind of incremental cleanup that compounds.
I'd like to take the next slice: PARAMETERS generation from schema descriptions. The data source is already there — every tool schema exposes
descriptionon each property (I checked: all registered tools have descriptions on all params except the no-parambasic_memory_diagnostics).Specifically what I'm thinking:
render_parameters()inbasic_memory.man— renders a## PARAMETERSsection from the tool's JSON schemaproperties, producing the same- **name** — descriptionbullet format the hand-written pages use. Required params first, then optional, in schema order (mirroring SYNOPSIS). Type info and defaults woven into the description naturally.extract_parameters()/replace_parameters()— regex helpers matching the## PARAMETERSblock, parallel to the existingextract_mcp_synopsis()/replace_mcp_synopsis()pair.Update
scripts/update_man_pages.pyto also regenerate PARAMETERS alongside SYNOPSIS.Extend the drift test in
tests/test_man_pages.pyto hold shipped PARAMETERS byte-equal to the rendering (same pattern as SYNOPSIS).Preserve hand-curated content — the 6 pages that already have PARAMETERS sections (write-note, search-notes, build-context, edit-note, read-note, recent-activity) have field knowledge that goes beyond the schema descriptions (gotcha cross-refs, behavioral notes). The generator should produce the mechanical description; curated additions can either be preserved as-is or folded into tool docstrings upstream so the generator captures them.
The tricky design question: should the generator wholesale replace PARAMETERS (like it does SYNOPSIS), or should there be a merge strategy that preserves hand-written additions? SYNOPSIS is one-to-one with the schema so byte equality makes sense; PARAMETERS currently carry field knowledge (e.g. write-note's notes about
overwritebehavior, search-notes'min_similaritythreshold guidance) that isn't in the schema. Two approaches:I lean toward Option A — it's the same principle that made SYNOPSIS reliable. Happy to hear your preference before starting.
This builds on my earlier contributions (PR #1380 tool reference, #1386 search_notes example fix). Let me know if this slice is available and if you have any preferences on the approach!
FBISiri commentedon Sep 4, 2026
Just checking in — let me know if this slice is open or if you'd rather handle it differently. Happy to adjust scope.
phernandez commentedon Sep 4, 2026
Thanks for checking in — yes, this slice is open, and Option A is the direction we want.
Please have the registry generator own the complete
## PARAMETERSsection. Parameter-specific details should live in the MCP schema descriptions so they reach both clients and the generated manual; broader explanations, examples, and gotchas should remain in their existing curated sections.A few scope notes:
Please keep the PR to PARAMETERS generation and any schema-description improvements required to preserve genuinely parameter-specific information. Thanks for taking this on.
FBISiri commentedon Sep 4, 2026
Got it, thanks — Option A it is. I'll keep the PR to registry-owned PARAMETERS (required first, then optional, schema order; deterministic required/default rendering; full-block replacement on regen) plus the drift-test extension and scenario-focused tests, with only the schema-description changes needed so nothing parameter-specific from the curated pages gets lost. PR coming shortly.
FBISiri commentedon Sep 5, 2026
Opened #1478 implementing Option A.
fix(man): drop stale PARAMETERS for parameterless tools
test(man): load update_man_pages via importlib, not as a package
FBISiri commentedon Sep 7, 2026
Thanks for merging #1478 — good to see PARAMETERS land clean.
I'd like to take the next slice on the roadmap: section-1 pages generated from the Typer help.
Current state: the eight bundled section-1 pages (
apropos,cat,find,grep,head,ls,tail,tree) are allgenerated: hand, and their SYNOPSIS and OPTIONS blocks are mechanical restatements of the POSIX verb definitions incli/commands/posix.py. They already drift —grep(1)'s SYNOPSIS lists--json,--plain,--project,--local,--cloud, but OPTIONS only documents-Fand the pagination flags. That's exactly the class of drift the section-3 work removed.Proposed scope, mirroring the SYNOPSIS/PARAMETERS split:
render_cli_synopsis()/render_options()inbasic_memory.man, rendering from the Typer command tree (typer.main.get_command(app), walking to the named subcommand) rather than the MCP registry — arguments first, then options in declaration order, with defaults rendered deterministically the same wayrender_parametersdoes.extract_options()/replace_options()regex helpers alongside the existingextract_parameters()/replace_parameters()pair, and a section-1 branch inregenerate_page().scripts/update_man_pages.pyregenerates section-1 alongside section-3, sojust man-regenstays the one entry point.tests/test_man_pages.py: every section-1 page whose command this build registers is byte-equal to the live rendering, plus the ownership-declaration check. Scenario-focused tests, same as last time.posix.pyonly where a flag currently has nohelp=and the generated page would otherwise render an empty bullet.Out of scope: the groff sources (
bm.1,basic-memory.1) stay hand-owned — the COMMANDS overview there isn't one-to-one with anything, and groff generation is its own roadmap item.One design question before I start. Section-3 declares
generated: registrybecause the MCP tool registry is the source. Section-1's source is the Typer tree, which is a different surface — do you want a distinct token (generated: cli) sogenerated:names the actual owner, or is oneregistryvalue across both simpler to reason about?test_registry_pages_declare_registry_ownershipgets the corresponding branch either way. I'd lean towardcli, but it's your frontmatter vocabulary.The other judgement call: generated OPTIONS will be the complete flag list, so pages like
grep(1)grow from two bullets to the full set. I read that as the point — but if you'd rather keep OPTIONS curated and only generate SYNOPSIS on section 1, say so and I'll cut it to that.PR within a week either way. Happy to start on the
clitoken and adjust if you prefer otherwise.phernandez commentedon Sep 7, 2026
Thanks—this fits the existing approach. Please extend the current
just man-regenpipeline, using the Typer command tree as the source for section-1 SYNOPSIS and OPTIONS, just as the MCP tool schemas drive section 3.Use
generated: cli, and generate the complete public options list, including shared flags. Keep DESCRIPTION, EXAMPLES, and other curated sections hand-owned. Reuse the existing section-replacement machinery where practical, while preserving CLI-specific syntax such as flag aliases and paired boolean options.Drift tests and targeted improvements to missing
help=text sound right. Agreed on leaving the groff sources out of scope.fix(cli): group mutex options and type Click params in man generation
feat(cli): generate section-1 man SYNOPSIS and OPTIONS from Typer
fix(cli): group mutex options and type Click params in man generation
FBISiri commentedon Sep 18, 2026
The
CLI:blocks on section-3 pages are owned by neither generator, and no test holds them to the Typer tree.search-notes(3)advertisesbm tool search-notes ... [--search-type TYPE], but the resolved Click command has no--search-type— it exposes--permalink/--title/--vector/--hybrid. The page is already stale.Nothing catches this by design:
replace_mcp_synopsisdeliberately leaves the CLI block alone (test_replace_mcp_synopsis_touches_only_the_mcp_blockasserts it), and the section-1 generator only walks pages named after abmverb —bm tool <verb>is not one. 12 of 22 section-3 pages carry such a block.Which way do you want it?
(a) section-3 generator also owns
CLI:, rendered from the Typer tree and drift-tested beside the MCP SYNOPSIS; or(b)
CLI:leaves section 3 for abm toolsection-1 page, section 3 stays MCP-only.The drift test lands in a different place for each, so this needs deciding first.
docs(skills): bring skills up to date with v0.24.0
docs(skills): bring skills up to date with v0.24.0
phernandez commentedon Nov 12, 2026
Done. bm.1 and the section-1 pages ship in the package, with SYNOPSIS/OPTIONS generated from Typer (#1524). The stale
bm tool search-notesCLI block raised above went away with the 1.0 tool surface (#1881); search-notes(3) no longer exists.