Agent SkillsAgent Skills

Private Sources

Install from private Git repos, npm packages, and enterprise registries with automatic authentication

Overview#

Agent Skills CLI supports installing from private and enterprise sources beyond the public marketplace. This includes private Git repositories (GitHub, GitLab, Bitbucket, self-hosted), npm packages (public and private registries), and SSH-based installations.

Important

Important: Never hardcode tokens in your shell history. Use environment variables (GH_TOKEN, GITLAB_TOKEN) or .skillsrc config files instead.

Private Git Repositories#

SSH URLs#

SSH is the recommended method for private repos. The CLI automatically detects SSH keys from ssh-agent and ~/.ssh/.

# GitHub private repo via SSH
skills install git@github.com:team/private-skills.git

# GitLab private repo
skills install git@gitlab.com:company/internal-tools.git

# Self-hosted Git
skills install git@git.company.com:team/skills.git

HTTPS with Token#

Use --token or environment variables for HTTPS-based private clone.

# Explicit token
skills install https://gitlab.com/team/repo --token=glpat-xxxxxxxxxxxx

# Environment variable (recommended for CI/CD)
export GITLAB_TOKEN=glpat-xxxxxxxxxxxx
skills install https://gitlab.com/team/repo

Bitbucket#

# Public Bitbucket repo
skills install https://bitbucket.org/team/skills-repo

# Private Bitbucket (set token)
export BITBUCKET_TOKEN=xxxxxxxx
skills install https://bitbucket.org/team/private-skills

Self-Hosted Git Instances#

# Custom Git server
skills install https://git.company.com/team/skills --token=$COMPANY_TOKEN

# With port
skills install https://git.company.com:8443/team/skills --token=$COMPANY_TOKEN

Authentication Resolution#

The CLI resolves credentials in this priority order:

PriorityMethodHow
1--token flagskills install <url> --token=xxx
2Environment variablesGH_TOKEN, GITLAB_TOKEN, BITBUCKET_TOKEN, GIT_TOKEN
3SSH keysAuto-detected from ssh-agent or ~/.ssh/
4Git credential helperSystem git config credential.helper
5.netrc file~/.netrc machine entries
6NoneAttempt public access

Environment Variables#

VariableProvider
GH_TOKEN / GITHUB_TOKENGitHub
GITLAB_TOKEN / GL_TOKENGitLab
BITBUCKET_TOKEN / BB_TOKENBitbucket
GIT_TOKENAny Git host (fallback)

Security#

  • Tokens are never logged or displayed in error messages
  • URLs in logs are sanitized: https://oauth2:***@gitlab.com/...
  • GIT_TERMINAL_PROMPT=0 is set automatically to prevent interactive prompts in CI

npm Packages#

Install skills packaged as npm modules.

# Public npm package
skills install npm:chalk
skills install npm:@anthropic/skills

# With version or tag
skills install npm:@company/skills@1.1.1
skills install npm:@company/skills@latest

# Private registry
skills install npm:@company/skills --registry https://npm.company.com

The CLI uses npm pack to download the package tarball, extracts it, and searches for SKILL.md files inside.


.skillsrc Configuration#

Create a .skillsrc or .skillsrc.json file to pre-configure private sources and defaults for your project or globally.

File Locations#

LocationScope
./.skillsrcProject (highest priority)
./.skillsrc.jsonProject
~/.skillsrcUser-wide
~/.skillsrc.jsonUser-wide

Example Configuration#

{
  "sources": [
    {
      "name": "company-gitlab",
      "type": "git",
      "url": "https://gitlab.company.com",
      "auth_env": "COMPANY_GIT_TOKEN"
    },
    {
      "name": "internal-npm",
      "type": "npm",
      "registry": "https://npm.company.com",
      "scope": "@company"
    },
    {
      "name": "bitbucket-skills",
      "type": "git",
      "url": "https://bitbucket.org/team",
      "auth_env": "BB_TOKEN"
    }
  ],
  "defaults": {
    "agent": "cursor",
    "global": false
  }
}

Configuration Fields#

FieldTypeDescription
sources[].namestringDisplay name for the source
sources[].type"git" | "npm"Source type
sources[].urlstringGit host URL or npm registry URL
sources[].auth_envstringEnvironment variable name for auth token
sources[].registrystringnpm registry URL (for npm type)
sources[].scopestringnpm scope (e.g. @company)
defaults.agentstringDefault agent to install to
defaults.globalbooleanDefault to global install

CI/CD Integration#

GitHub Actions#

- name: Install private skills
  env:
    GH_TOKEN: ${{ secrets.GH_TOKEN }}
    GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
  run: |
    npm install -g agent-skills-cli
    skills install git@github.com:team/private-skills.git -a cursor -y
    skills install npm:@company/skills --registry https://npm.company.com -a cursor -y

GitLab CI#

install-skills:
  script:
    - npm install -g agent-skills-cli
    - skills install https://gitlab.com/team/skills -a cursor -y
  variables:
    GITLAB_TOKEN: $GITLAB_TOKEN
    GIT_TERMINAL_PROMPT: "0"

Docker#

ENV GIT_TOKEN=your-token
ENV GIT_TERMINAL_PROMPT=0
RUN npm install -g agent-skills-cli && \
    skills install git@github.com:team/skills.git -a cursor -y