Skip to content

Add issue CLI command to open GitHub new-issue page - #147

Open
bernoussama with Copilot wants to merge 7 commits into
mainfrom
copilot/add-issue-command
Open

Add issue CLI command to open GitHub new-issue page#147
bernoussama with Copilot wants to merge 7 commits into
mainfrom
copilot/add-issue-command

Conversation

Copilot AI commented May 17, 2026

Copy link
Copy Markdown

This PR adds a first-class issue command so users can open the repository’s GitHub issue creation page directly from LazyShell. It addresses the missing workflow for quickly reporting problems without manually navigating to GitHub.

  • CLI: new issue subcommand

    • Adds lazyshell issue to the command registry.
    • Opens https://github.com/bernoussama/lazyshell/issues/new in the default browser.
  • Platform-aware browser launch

    • Uses OS-specific commands via execFile:
      • macOS: open
      • Windows: cmd /c start
      • Linux: xdg-open
    • Avoids shell interpolation for safer process invocation.
  • User-facing behavior

    • Prints a clear success message when launch is triggered.
    • Surfaces a contextual error message if the browser command fails.
  • Docs update

    • Adds lazyshell issue to README command examples.
program
  .command('issue')
  .description('Open browser to create a new GitHub issue')
  .action(async () => {
    await openIssuePage();
  });

Copilot AI linked an issue May 17, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add issue command to open browser for new issue Add issue CLI command to open GitHub new-issue page May 17, 2026
Copilot AI requested a review from bernoussama May 17, 2026 21:22
@bernoussama
bernoussama marked this pull request as ready for review May 17, 2026 21:45
Copilot AI review requested due to automatic review settings May 17, 2026 21:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new lazyshell issue CLI subcommand that opens the project’s GitHub “new issue” page in the user’s default browser, with a small README update to document the command.

Changes:

  • Added issue subcommand to the Commander CLI registry in src/index.ts.
  • Implemented OS-specific browser launching via execFile (macOS open, Windows cmd /c start, Linux xdg-open).
  • Documented the new command in README.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/index.ts Adds openIssuePage() and registers the new issue CLI subcommand.
README.md Documents lazyshell issue in the command examples section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.ts
Comment on lines +58 to +63
const [command, args] =
process.platform === 'darwin'
? ['open', [issueUrl]]
: process.platform === 'win32'
? ['cmd', ['/c', 'start', '', issueUrl]]
: ['xdg-open', [issueUrl]];
Comment thread src/index.ts
Comment on lines +66 to +70
execFile(command, args, (error, _stdout, stderr) => {
if (error) {
const details = stderr?.trim() || error.message;
reject(new Error(`Failed to execute browser command: ${details}`));
return;

@bernoussama bernoussama left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Nightly review — lazyshell#147 (Add issue CLI command)

Verdict: LGTM with a nit. execFile + platform switch is the right way (no shell interpolation; URL is a constant so the cmd /c start "" empty-title quirk is handled correctly).

Nit: on headless boxes / WSL without wslu, xdg-open doesn't exist and the command hard-fails with exit 1. Print the URL as a fallback so the user can still copy it:

console.log(chalk.blue('Open manually:'), issueUrl);

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.

Add issue command

3 participants