Skip to content

feat: add docs command for browsing Prismic documentation#85

Draft
angeloashmore wants to merge 1 commit intomainfrom
aa/docs-command
Draft

feat: add docs command for browsing Prismic documentation#85
angeloashmore wants to merge 1 commit intomainfrom
aa/docs-command

Conversation

@angeloashmore
Copy link
Copy Markdown
Member

@angeloashmore angeloashmore commented Apr 2, 2026

Resolves:

Description

Adds a docs command with list and view subcommands so users can browse Prismic documentation directly from the CLI. docs list fetches a page index (optionally listing anchors within a page), and docs view renders a documentation page as Markdown with optional anchor filtering.

Checklist

  • A comprehensive Linear ticket, providing sufficient context and details to facilitate the review of the PR, is linked to the PR.
  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1


Note

Low Risk
Low risk: adds a new CLI command that performs read-only fetches from prismic.io and prints results, without affecting auth, repo state, or existing command behavior beyond wiring the new route.

Overview
Adds a new prismic docs command with list and view subcommands to browse Prismic documentation from the CLI.

docs list fetches the docs index (or a page’s anchors when given a path), supports --json, and sorts output for stable display; docs view fetches 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.ts and 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

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@angeloashmore angeloashmore marked this pull request as draft April 2, 2026 04:19
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant