Authentication
b supports authentication tokens for accessing private repositories and increasing API rate limits. Tokens are read from environment variables.
Provider Tokens
| Provider | Environment Variable | Header Format |
|---|---|---|
| GitHub | GITHUB_TOKEN | Authorization: Bearer <token> |
| GitLab | GITLAB_TOKEN | PRIVATE-TOKEN: <token> |
| Gitea / Codeberg | GITEA_TOKEN | Authorization: token <token> |
Usage
Export the appropriate variable before running b:
GitHub
A GitHub token increases the API rate limit from 60 to 5,000 requests per hour and allows access to private repositories.
Without a token, b will show a warning when rate-limited:
GitHub API rate limited (set GITHUB_TOKEN for higher limits)
GitLab
A GitLab token is required for private repositories on gitlab.com or self-hosted instances.
Gitea / Codeberg
A Gitea token is required for private repositories on Gitea or Forgejo instances like Codeberg.
CI/CD
In CI/CD pipelines, use secrets or environment variables provided by your CI system:
Was this section helpful?