feat: add docs command for browsing Prismic documentation#85
feat: add docs command for browsing Prismic documentation#85angeloashmore wants to merge 1 commit intomainfrom
docs command for browsing Prismic documentation#85Conversation
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.
| const match = lines[i].match(/^(#{1,6})\s+(.*)/); | ||
| if (!match) { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Section extraction ignores fenced code blocks
High Severity
extractSection treats every line matching the heading regex as a real heading, including lines inside fenced code blocks. Developer documentation very commonly contains # comment lines in bash/shell/Python code blocks. When extracting a section, a # comment inside a code block is misidentified as a level-1 heading, triggering the level <= headingLevel termination condition and truncating the section prematurely. The function needs to track fenced code block state (``` delimiters) and skip heading detection inside them.


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
Low Risk
Low risk: adds a new CLI command that performs read-only fetches from
prismic.ioand prints results, without affecting auth, repo state, or existing command behavior beyond wiring the new route.Overview
Adds a new
prismic docscommand withlistandviewsubcommands to browse Prismic documentation from the CLI.docs listfetches the docs index (or a page’s anchors when given a path), supports--json, and sorts output for stable display;docs viewfetches a docs page as Markdown, optionally extracts a single section via#anchor, and can emit either raw Markdown or JSON.Registers the new command in
src/index.tsand marks it as untracked for Segment analytics (UNTRACKED_COMMANDS).Written by Cursor Bugbot for commit 7736a3d. This will update automatically on new commits. 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. ↩