Private Repository Authentication
Sync skills and commands from private GitHub, GitLab, Bitbucket, Codeberg, and Gitea repositories using environment tokens.
Kasetto can pull skills, commands, instructions, and MCP configs from private repositories. No login command or credentials file needed. Set an environment variable and it works.
Supported Git Hosts
| Host | Example URL |
|---|---|
| GitHub | https://github.com/org/repo |
| GitHub Enterprise | https://ghe.example.com/org/repo |
| GitLab | https://gitlab.com/group/project |
| GitLab self-hosted | https://gitlab.example.com/group/subgroup/project |
| Bitbucket Cloud | https://bitbucket.org/workspace/repo |
| Codeberg | https://codeberg.org/owner/repo |
| Gitea | https://gitea.com/owner/repo |
| Forgejo | https://forgejo.org/owner/repo |
Host Detection Rules
Kasetto identifies the git host from the URL hostname:
- GitLab -
gitlab.com, any subdomain ofgitlab.com(e.g.,sub.gitlab.com), or any hostname starting withgitlab.(e.g.,gitlab.example.com) - Bitbucket -
bitbucket.orgorwww.bitbucket.org - Codeberg / Gitea / Forgejo -
codeberg.org,gitea.com,forgejo.org(and theirwww.variants), plus hostnames starting withgitea.orforgejo.(e.g.,gitea.example.org), unless they already match the GitLab rule - GitHub -
github.comand any other hostname not matching the rules above
Environment Variables
GitHub
| Variable | Description |
|---|---|
GITHUB_TOKEN | Personal access token or fine-grained token |
GH_TOKEN | Fallback if GITHUB_TOKEN is not set |
Works for github.com and GitHub Enterprise Server alike.
GitLab
| Variable | Description |
|---|---|
GITLAB_TOKEN | Personal or project access token |
CI_JOB_TOKEN | Fallback - automatically set in GitLab CI/CD pipelines |
Works for gitlab.com and any self-hosted instance whose hostname starts with gitlab..
Bitbucket Cloud
Bitbucket has two options:
Method 1 - API token:
| Variable | Description |
|---|---|
BITBUCKET_EMAIL | Account email address |
BITBUCKET_TOKEN | Atlassian API token |
Method 2 - App password:
| Variable | Description |
|---|---|
BITBUCKET_USERNAME | Bitbucket username |
BITBUCKET_APP_PASSWORD | App password (create at Bitbucket Settings > App passwords) |
Method 1 is tried first; if those variables aren't set, Method 2 is used.
Codeberg / Gitea / Forgejo
| Variable | Description |
|---|---|
GITEA_TOKEN | Personal access token |
CODEBERG_TOKEN | Fallback if GITEA_TOKEN is not set |
FORGEJO_TOKEN | Fallback if neither of the above is set |
All three are checked in order. The first one found is used for any Gitea-family host,
including self-hosted instances whose hostnames start with gitea. or forgejo..
Remote Configs
Authentication also applies when you fetch a config via --config <url> or extends. The token is chosen based on the URL hostname, using the same detection rules above.
Browser URLs containing /src/branch/ on recognized Gitea-family hosts are rewritten
to /raw/branch/ before fetching the config.
If the URL points to a private resource and no matching token is set, Kasetto reports an HTTP error with a hint about which variable to set.