Skip to content

feat(cli): add browse bug to open a prefilled issue - #3510

Open
shrey150 wants to merge 4 commits into
mainfrom
cursor/browse-bug-command-c2c0
Open

shrey150 wants to merge 4 commits into
mainfrom
cursor/browse-bug-command-c2c0

Conversation

@shrey150

@shrey150 shrey150 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

why

Bug reports from humans and coding agents often arrive without the diagnostics we need to reproduce and fix issues. Prefilling an issue with environment info reduces friction for reporters and improves triage.

what changed

Add browse bug command that opens a GitHub issue page prefilled with:

  • Blank sections for the user to describe what happened and steps to reproduce
  • Auto-filled environment table: browse version, Node version, OS/arch, and detected agent

The command:

  • Uses the existing openUrl helper (same as browse discord)
  • Supports --no-open to print the URL instead of opening
  • Supports --title to prefill the issue title
  • Requires no new telemetry module (command telemetry already records command_path=bug)

Before (main):

$ browse bug --no-open
"browse bug" is not a browse command. Run browse --help for all commands.
 ›   Error: command bug not found

After (this branch):

$ browse bug --no-open
https://github.com/browserbase/stagehand/issues/new?body=%23%23+What+happened%0A%0A%3C%21--+Describe+the+issue+--%3E%0A%0A%23%23+Steps+to+reproduce%0A%0A1.+%0A2.+%0A3.+%0A%0A%23%23+Environment%0A%0A%7C+Key+%7C+Value+%7C%0A%7C-----%7C-------%7C%0A%7C+browse+%7C+0.12.0+%7C%0A%7C+node+%7C+v22.23.4+%7C%0A%7C+os+%7C+linux%2Fx64+%7C%0A%7C+agent+%7C+cursor-cli+%7C%0A
Please fill in the details to help us reproduce the issue.

Decoded body:

## What happened

<!-- Describe the issue -->

## Steps to reproduce

1. 
2. 
3. 

## Environment

| Key | Value |
|-----|-------|
| browse | 0.12.0 |
| node | v22.23.4 |
| os | linux/x64 |
| agent | cursor-cli |

test plan

  • pnpm --filter browse lint — passes
  • pnpm --filter browse test:cli — 702 tests pass including new tests for:
    • Help text visibility
    • URL contains version/OS/agent
    • --no-open prints URL instead of opening
    • --title sets title parameter
    • No driver/session interaction
  • Manual: browse bug --no-open prints valid prefilled GitHub issue URL
  • Manual: browse bug --no-open --title "Test" includes title parameter
Open in Web Open in Cursor 

Summary by cubic

Adds a browse bug command that opens a prefilled GitHub issue so bug reports include environment diagnostics from the reporter.

  • Prefills the issue body with blank report sections and an auto-filled environment table (browse version, Node version, OS/arch, and detected agent) using the existing bug_report.md template.
  • Supports --no-open to print the URL instead of opening a browser, and --title to prefill the issue title.

Written for commit 1b698c0. Summary will update on new commits.

View guided diff Turn on auto-fix

Co-authored-by: Shrey Pandya <shrey150@yahoo.com>
@changeset-bot

changeset-bot Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1b698c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
browse Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files

Architecture diagram
sequenceDiagram
    participant User as CLI User
    participant BugCmd as Browse Bug Command
    participant Env as Environment Detector
    participant Redact as Redaction Service
    participant URLBuilder as Bug Report URL Builder
    participant OpenUrl as URL Opener
    participant GitHub as GitHub Issues

    Note over User,GitHub: Browse Bug command flow

    User->>BugCmd: browse bug [--no-open] [--title "..."]

    BugCmd->>Env: detectAgent()
    Env-->>BugCmd: agent (e.g., cursor-cli)

    BugCmd->>BugCmd: collect env (version, node, os/arch)

    BugCmd->>Redact: redactSensitive(values)
    Redact->>Redact: redact API keys, tokens, URL params
    Redact->>Redact: redact home directory paths
    Redact-->>BugCmd: cleaned values

    BugCmd->>URLBuilder: buildBugReportUrl({title, env})
    URLBuilder->>URLBuilder: build markdown body
    URLBuilder->>URLBuilder: encode as URL params (template, title, body)
    URLBuilder->>GitHub: validate target URL

    alt URL exceeds 8000 chars
        URLBuilder->>URLBuilder: truncate body and append marker
    end

    URLBuilder-->>BugCmd: complete URL

    alt --no-open provided OR non-TTY OR CI mode
        BugCmd-->>User: print URL and help message
    else browser available
        BugCmd->>OpenUrl: openUrl(url)
        OpenUrl-->>BugCmd: success status
        alt open succeeded
            BugCmd-->>User: "Opening URL..."
        else open failed
            BugCmd-->>User: print URL as fallback
        end
    end

    User-->>GitHub: manual submission
    GitHub-->>User: issue creation page (prefilled)
Loading

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/cli/src/lib/bug-report.ts Resolved
Comment thread packages/cli/tests/bug.test.ts Resolved
cursoragent and others added 2 commits November 20, 2026 18:40
Co-authored-by: Shrey Pandya <shrey150@yahoo.com>
Co-authored-by: Shrey Pandya <shrey150@yahoo.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/cli/tests/bug.test.ts Resolved
Comment thread packages/cli/src/commands/bug.ts Resolved
Co-authored-by: Shrey Pandya <shrey150@yahoo.com>

This branch has not been deployed

No deployments
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.

2 participants