Add issue CLI command to open GitHub new-issue page - #147
Add issue CLI command to open GitHub new-issue page#147bernoussama with Copilot wants to merge 7 commits into
issue CLI command to open GitHub new-issue page#147Conversation
issue CLI command to open GitHub new-issue page
There was a problem hiding this comment.
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
issuesubcommand to the Commander CLI registry insrc/index.ts. - Implemented OS-specific browser launching via
execFile(macOSopen, Windowscmd /c start, Linuxxdg-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.
| const [command, args] = | ||
| process.platform === 'darwin' | ||
| ? ['open', [issueUrl]] | ||
| : process.platform === 'win32' | ||
| ? ['cmd', ['/c', 'start', '', issueUrl]] | ||
| : ['xdg-open', [issueUrl]]; |
| 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
left a comment
There was a problem hiding this comment.
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);
This PR adds a first-class
issuecommand 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
issuesubcommandlazyshell issueto the command registry.https://github.com/bernoussama/lazyshell/issues/newin the default browser.Platform-aware browser launch
execFile:opencmd /c startxdg-openUser-facing behavior
Docs update
lazyshell issueto README command examples.