Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ To use Good First Issue, you'll need to have a few things installed:

This module is an interactive CLI. If you're looking for a module to use in an application, check out [libgfi](https://www.npmjs.com/package/libgfi).

### Avoiding GitHub Rate Limits

By default, the GitHub API allows only **10 unauthenticated search requests per minute**.
If you use the CLI often, you may see:


### Installation

The suggested usage is via npx:
Expand Down
16 changes: 14 additions & 2 deletions bin/good-first-issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,20 @@ cli
opn(issues[key].url)
process.exitCode = 0
}
} catch (err) {
console.error(err)
} catch (err) {
// Handle GitHub rate limit errors gracefully
if (err.status === 403 && err.response?.data?.message?.includes("API rate limit exceeded")) {
console.error(
chalk.red("\n❌ GitHub API rate limit exceeded!\n") +
chalk.yellow("GitHub allows only 10 unauthenticated search requests per minute.\n") +
chalk.yellow("Tip: Authenticate with a personal access token for higher limits.\n\n") +
chalk.cyan(" good-first-issue <project> --auth YOUR_GITHUB_TOKEN\n\n") +
"Learn more: https://docs.github.com/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token\n"
)
} else {
// Show a cleaner error message
console.error(chalk.red(`\nError: ${err.message || err}\n`))
}
process.exitCode = 1
}
})
Expand Down