CLI Install Fails with GitHub Rate Limit

View as Markdown

This guide helps you resolve Brev CLI installations that fail because the install script’s request to the GitHub API was rate limited.

Platform: Any platform that installs the CLI with the install-latest.sh script, including Linux and Windows (WSL). Homebrew installs on macOS are unaffected.

Problem

The install command exits immediately with:

Error: Failed to fetch release info from GitHub API.
This is often caused by rate limiting when many requests come from the same IP.
If you are using a VPN, try turning it off and running this script again.
You can also set GITHUB_TOKEN to avoid rate limits.
For more details, see: https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting

No binary is installed, and brev --version reports that the command is not found.

Why This Happens

Before downloading anything, the install script queries the GitHub releases API to find the correct binary for your operating system and architecture:

https://api.github.com/repos/brevdev/brev-cli/releases/latest

GitHub allows 60 unauthenticated requests per hour, and that budget is counted per source IP address, not per user. When your outbound traffic shares an egress IP, such as a corporate NAT gateway, a VPN exit node, a cloud NAT, or a pool of CI runners, everyone behind that address draws from the same 60 requests. Colleagues installing the CLI around the same time, or unrelated traffic leaving through the same exit node, can exhaust the quota before you run the command.

Prerequisites

  • A GitHub account (any plan, including free)
  • curl installed and available in $PATH
  • Outbound network access to api.github.com and github.com

Solution

Do not run the installer with sudo. It resets the environment, so GITHUB_TOKEN and your gh credentials are not passed through to the script. The installer writes to ~/.local/bin and does not require root.

Change your outbound network route

Your traffic leaves through a shared exit IP whose 60-request budget is frequently already spent. Moving to a different source IP gives you a fresh allowance:

  • If you are connected to a VPN, turn it off and re-run the installer. A VPN exit node is shared with every other user on that server.
  • Change the VPN location to a different country, region, or server if you must stay connected. Each location has its own exit IP and its own separate quota.
  • Remove any configuration that forces traffic through a shared egress IP address, such as a proxy, a corporate network policy, or a custom route.

Export a GitHub token

This applies to any environment, including minimal container images and CI runners where the GitHub CLI is unavailable.

1

Create a personal access token

Go to GitHub personal access token settings and create either a classic token or a fine-grained token.

The token is used only to identify you, so that the request counts against your account’s limit of 5,000 requests per hour instead of the shared IP address. It does not need access to your account or your repositories, because the installer reads nothing but public release metadata. Keep it as narrow as GitHub allows:

  • Classic token: leave every scope unchecked.
  • Fine-grained token: set Repository access to Public repositories (read-only). No repository permissions need to be selected, and GitHub includes read-only Metadata access automatically.
2

Export the token

export GITHUB_TOKEN="<TOKEN>"
3

Re-run the installer

bash -c "$(curl -fsSL https://raw.githubusercontent.com/brevdev/brev-cli/main/bin/install-latest.sh)"

export applies only to the current shell session. Add the line to ~/.bashrc or ~/.zshrc to persist it across sessions, and never commit a token to a repository.

Authenticate with the GitHub CLI

If gh is installed, the install script calls gh auth token and uses the result automatically, so no further configuration is required.

1

Log in with gh

gh auth login

Follow the prompts to authenticate through your browser or with an existing token.

2

Verify that a token was generated

gh auth token

This prints the token the installer will use. If it prints nothing, the login did not complete.

3

Re-run the installer

bash -c "$(curl -fsSL https://raw.githubusercontent.com/brevdev/brev-cli/main/bin/install-latest.sh)"

Authenticating the request raises the limit to 5,000 requests per hour and charges it to your GitHub account instead of the shared IP.

Rate limits reset on a rolling hourly window. If none of these solutions are available, waiting up to an hour and retrying also works.

Verification

Check your remaining budget with the /rate_limit endpoint, which does not count against your quota:

# Limit for your current IP address
curl -s https://api.github.com/rate_limit
# Limit for the token you exported
curl -s -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/rate_limit

Under resources.core, a limit of 60 means the request is still unauthenticated and 5000 means authentication is working. The remaining field shows how many requests are left in the current window.

Then confirm the CLI installed:

brev --version