Skip to content

Prerequisites

The only runtime prerequisite is a GitHub personal access token. The pre-compiled binary is self-contained and has no runtime dependency — you do not need Bun to run it.

Building from source?

If you want to build github-code-search from source, you will additionally need Bun ≥ 1.0. See the Installation guide.

GitHub token

A GitHub personal access token (PAT) is required to call the GitHub code search API.

Required scopes

ScopeWhen needed
repoSearching private repositories
public_repoSearching public repositories only
read:orgUsing --group-by-team-prefix to group results by team

Classic vs fine-grained tokens

Both token types work. Classic tokens are simpler to configure for org-wide searches. Fine-grained tokens require explicit repository access per repo, which is impractical for org-wide searches.

Set the token

bash
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx

Add this to your shell profile (~/.zshrc, ~/.bashrc, ~/.config/fish/config.fish, …) to make it permanent.

Token security

Never commit your token to version control. Use environment variables or a secrets manager.

Next step

Install github-code-search

Released under the MIT License.