Enable GitHub search
Configure the token required by the GitHub Code Search provider.
GitHub Code Search requires authentication. Without a token, Moji keeps using GitHub's bounded unauthenticated repository, tree, and release search.
Use an existing GitHub CLI login
If GitHub CLI is installed and already authenticated, Moji automatically uses its token for GitHub.com:
gh auth login
moji "Futura" --provider githubMoji only reads an existing login with gh auth token. It never starts a login
flow, stores the CLI token in Moji's config, or prints the token. An explicit
GITHUB_TOKEN, github_token, or --token-stdin value takes precedence.
Use an environment variable
export GITHUB_TOKEN=github_pat_your_token
moji "Futura" --provider githubThe environment variable takes precedence over github_token in the config
file.
Read a token from standard input
Use --token-stdin when a secret manager or another process supplies the token:
printf '%s' "$TOKEN_FROM_SECRET_MANAGER" |
moji "Futura" --provider github --token-stdin --jsonMoji intentionally has no inline --token flag because command-line arguments
can be recorded in shell history and process listings.
Store a token in the config file
Open the config:
moji configSet:
github_token: github_pat_your_tokenMoji creates the config with mode 0600. moji config show always redacts the
stored value.
Recover from authentication failures
If Moji reports that GitHub search is not configured:
- run
gh auth statusif GitHub CLI should supply the token; - confirm that
GITHUB_TOKENis exported in the same shell when using the environment variable; - run
moji config showand confirm thatGitHubTokenis[redacted]when using the stored token; - confirm that the token can read public repositories; and
- retry with
--provider getfontsto keep working without GitHub.