feat: add docs command for browsing Prismic documentation#85
feat: add docs command for browsing Prismic documentation#85angeloashmore merged 6 commits intomainfrom
docs command for browsing Prismic documentation#85Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Lines like `# install deps` inside shell/Python code blocks were being treated as level-1 headings, prematurely truncating sections requested via `prismic docs view <path>#<anchor>`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d89c484. Configure here.
| } else if (fence) { | ||
| currentFence = fence; | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Fence closing check ignores trailing content on line
Medium Severity
The fence-closing check on line 79 only verifies the line starts with the same fence characters via startsWith, but doesn't verify the rest of the line is empty (or whitespace-only). Per CommonMark, closing code fences cannot have info strings — a line like ```python inside a ``` block is content, not a closing fence. The current regex /^(?<fence>\{3,}|~{3,})/matches the fence prefix, andstartsWithsucceeds, so the code incorrectly exits the fenced block. This causes subsequent lines still inside the code block to be scanned for headings, potentially producing wrong anchor matches or corrupting theGithubSlugger` state — likely in documentation about code that nests fenced examples.
Reviewed by Cursor Bugbot for commit d89c484. Configure here.


Resolves:
Description
Adds a
docscommand withlistandviewsubcommands so users can browse Prismic documentation directly from the CLI.docs listfetches a page index (optionally listing anchors within a page), anddocs viewrenders a documentation page as Markdown with optional anchor filtering.Checklist
Preview
How to QA 1
Note
Medium Risk
Adds a new top-level CLI command that performs network requests and parses Markdown anchors, which could introduce new failure modes (HTTP errors, output parsing) but does not touch auth or data mutation paths.
Overview
Adds a new
prismic docstop-level command withlistandviewsubcommands to browse Prismic documentation from the CLI.The command fetches a docs index and per-page anchor index, supports JSON output, and
docs viewcan optionally extract a single section via#anchorusing GitHub-compatible slug generation while ignoring headings inside code fences.Introduces a
PRISMIC_DOCS_HOSTenv override for the docs base URL and addsgithub-sluggeras a dev dependency; registersdocsin the main command router and excludes it from segment tracking.Reviewed by Cursor Bugbot for commit d89c484. Bugbot is set up for automated code reviews on this repo. Configure here.
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩