kasetto

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

HostExample URL
GitHubhttps://github.com/org/repo
GitHub Enterprisehttps://ghe.example.com/org/repo
GitLabhttps://gitlab.com/group/project
GitLab self-hostedhttps://gitlab.example.com/group/subgroup/project
Bitbucket Cloudhttps://bitbucket.org/workspace/repo
Codeberghttps://codeberg.org/owner/repo
Giteahttps://gitea.com/owner/repo
Forgejohttps://forgejo.org/owner/repo

Host Detection Rules

Kasetto identifies the git host from the URL hostname:

  • GitLab - gitlab.com, any subdomain of gitlab.com (e.g., sub.gitlab.com), or any hostname starting with gitlab. (e.g., gitlab.example.com)
  • Bitbucket - bitbucket.org or www.bitbucket.org
  • Codeberg / Gitea / Forgejo - codeberg.org, gitea.com, forgejo.org (and their www. variants), plus hostnames starting with gitea. or forgejo. (e.g., gitea.example.org), unless they already match the GitLab rule
  • GitHub - github.com and any other hostname not matching the rules above

Environment Variables

GitHub

VariableDescription
GITHUB_TOKENPersonal access token or fine-grained token
GH_TOKENFallback if GITHUB_TOKEN is not set

Works for github.com and GitHub Enterprise Server alike.

export GITHUB_TOKEN=ghp_...
kst sync --config kasetto.yaml

GitLab

VariableDescription
GITLAB_TOKENPersonal or project access token
CI_JOB_TOKENFallback - automatically set in GitLab CI/CD pipelines

Works for gitlab.com and any self-hosted instance whose hostname starts with gitlab..

export GITLAB_TOKEN=glpat-...
kst sync --config kasetto.yaml

Bitbucket Cloud

Bitbucket has two options:

Method 1 - API token:

VariableDescription
BITBUCKET_EMAILAccount email address
BITBUCKET_TOKENAtlassian API token

Method 2 - App password:

VariableDescription
BITBUCKET_USERNAMEBitbucket username
BITBUCKET_APP_PASSWORDApp 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

VariableDescription
GITEA_TOKENPersonal access token
CODEBERG_TOKENFallback if GITEA_TOKEN is not set
FORGEJO_TOKENFallback 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.

export GITHUB_TOKEN=ghp_...
kst sync --config https://github.com/org/private-repo/blob/main/kasetto.yaml

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.

On this page