github-rest-cli uses Dynaconf for settings. Prefer environment variables; optional files are supported for local development.
For creating a GitHub token and required scopes, see Authentication.
| Variable | Setting | Required | Description |
|---|---|---|---|
GITHUB_AUTH_TOKEN |
AUTH_TOKEN |
Yes | GitHub personal access token |
GITHUB_API_URL |
API_URL |
No | GitHub REST API base URL (default: https://api.github.com) |
SET_ENV |
environment switcher | No | Active Dynaconf environment (development, testing, production, …) |
Example:
export GITHUB_AUTH_TOKEN="<github-auth-token>"
# optional:
export GITHUB_API_URL="https://api.github.com"Dynaconf uses the GITHUB_ prefix, so AUTH_TOKEN in a settings file maps to GITHUB_AUTH_TOKEN in the environment. Environment variables override file values.
When present in the current working directory, Dynaconf loads (in order):
settings.toml— non-secret defaults.secrets.toml— local secrets (gitignored via.secrets.*)
An installed package does not ship these files; env vars alone are enough for normal use. Repository clones may include a sample settings.toml with API_URL.
Put non-secret defaults in settings.toml:
# settings.toml
[default]
API_URL = "https://api.github.com"Put credentials in .secrets.toml (do not commit this file):
# .secrets.toml
[default]
AUTH_TOKEN = "ghp_your_token_here"Then run from that directory:
github-rest-cli repo listOptional environment selection:
export SET_ENV=development
github-rest-cli repo listMatching sections in the files (for example [development]) are used when SET_ENV is set.
- Prefer
.secrets.tomlorGITHUB_AUTH_TOKENfor tokens — never commit PATs. .secrets.*is listed in.gitignore.- Files are read from the process current working directory, not necessarily the package install location.
List defined parameters:
just dl
# equivalent: just dynaconf-listValidate parameters:
just dv
# equivalent: just dynaconf-validateValidation expects dynaconf_validators.toml at the project root.
Implementation lives in src/github_rest_cli/config.py.