Skip to main content

Recipe: Private Enterprise Skills

Install skills from private repositories using token authentication.

Scenario

Your organization hosts internal skills in a private GitHub/GitLab repository. You need to install and update these skills without exposing credentials in config files.

Solution

Step 1: Set up authentication

skillshare detects tokens from environment variables, with platform-specific vars taking priority over the generic fallback:

PlatformEnvironment Variable
GitHub / GitHub EnterpriseGITHUB_TOKEN
GitLab / Self-hosted GitLabGITLAB_TOKEN
BitbucketBITBUCKET_TOKEN (+ optional BITBUCKET_USERNAME)
Azure DevOpsAZURE_DEVOPS_TOKEN
Any platform (fallback)SKILLSHARE_GIT_TOKEN
# Option A: Git credential helper (recommended for GitHub)
gh auth login # sets up git credential helper for HTTPS

# Option B: Platform-specific environment variable
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxx # GitHub
export GITLAB_TOKEN=glpat-xxxxxxxxxxxxx # GitLab
export AZURE_DEVOPS_TOKEN=your-pat-here # Azure DevOps

# Option C: Generic fallback (works with any HTTPS host)
export SKILLSHARE_GIT_TOKEN=your-token-here

Step 2: Install from private repo

skillshare install your-org/internal-skills --track

skillshare detects the token automatically from the environment variables listed above.

Step 3: Verify tracking

skillshare list

The installed repo appears with the _ prefix (tracked repository):

_your-org-internal-skills/
├── code-review/
├── testing-standards/
└── deployment-checklist/

Step 4: Update cycle

skillshare check    # Detect upstream changes
skillshare update # Pull latest
skillshare sync # Push to targets

Verification

  • skillshare list shows the tracked repo
  • skillshare check can reach the remote and compare hashes
  • skillshare sync creates symlinks in all targets

Variations

  • Selective install: skillshare install your-org/internal-skills --track --skill code-review installs only one skill
  • CI/CD token: In pipelines, set the platform-specific env var (e.g., GITHUB_TOKEN) from CI secrets
  • Self-hosted GitLab: Set GITLAB_TOKEN and use HTTPS URL: skillshare install https://gitlab.internal.com/team/skills.git --track
  • Gitee / AtomGit: Supported via HTTPS URLs with SKILLSHARE_GIT_TOKEN