CLI Reference

The skhub CLI is your tool for installing, managing, and syncing AI agent skills.

Installation

npm install -g skhub

Or use with npx:

npx skhub <command>

Commands Overview

CommandDescription
addInstall a skill or skillset
listList installed skills
removeRemove an installed skill
syncSync installed skills with the platform
loginAuthenticate with the platform
logoutRemove authentication
whoamiShow current user

skhub add

Install a skill from the platform, a specific version, a skillset, or a GitHub repository.

skhub add <slug>[@version]
skhub add --skillset <username>/<slug>
skhub add <github-repo-url>

Arguments

  • <slug> — Skill identifier in format username/skill-name
  • <version> — Specific version to install (optional)
  • <github-repo-url> — GitHub repository URL to import from

Options

OptionAliasDescription
--skillset-sTreat argument as a skillset slug
--target-tTarget directory: agents, claude, or both (default: both)
--global-gInstall to global directory (~/.agents/ or ~/.claude/)
--force-fOverwrite existing files

Examples

# Install a skill
skhub add my-org/data-analysis

# Install specific version
skhub add my-org/[email protected]

# Install a skillset
skhub add --skillset team/devops-toolkit

# Install to .agents/ only
skhub add my-org/api-client --target agents

# Install globally
skhub add my-org/data-analysis --global

# Import from GitHub
skhub add https://github.com/user/skills-repo

# Force reinstall
skhub add my-org/data-analysis --force

How Installation Works

  1. Fetches skill metadata from the platform
  2. Downloads skill files
  3. Writes to target directory:
    • .agents/ — Main installation directory
    • .claude/ — Symlink to .agents/ (when --target both)
  4. Updates skills.json manifest

skhub list

List all installed skills in the current project or globally.

skhub list [options]

Options

OptionAliasDescription
--global-gList globally installed skills

Output

Installed Skills:
  my-org/data-analysis    v1.2.0   .agents/
  my-org/api-client       v1.0.3   .agents/
  team/devops-toolkit     latest   .agents/ (skillset)

skhub remove

Remove an installed skill.

skhub remove <slug> [options]

Arguments

  • <slug> — Skill identifier to remove

Options

OptionAliasDescription
--global-gRemove from global installation

Examples

# Remove a local skill
skhub remove my-org/data-analysis

# Remove a global skill
skhub remove my-org/data-analysis --global

skhub sync

Reinstall all skills from skills.json. Useful when:

  • Files are missing or corrupted
  • Updating to latest versions
  • Setting up a new machine
skhub sync [options]

Options

OptionAliasDescription
--global-gSync global installation

Examples

# Sync local project
skhub sync

# Sync global installation
skhub sync --global

skhub login

Authenticate with the Agent Skill Hub platform. Opens a browser for OAuth authentication.

skhub login

How It Works

  1. CLI generates a session ID
  2. Opens browser to platform login page
  3. User authenticates via GitHub
  4. CLI polls for approval
  5. API token is stored locally

Token Storage

Authentication tokens are stored at:

~/.skhub/auth.json

skhub logout

Remove stored authentication credentials.

skhub logout

This revokes the API token on the server and deletes local credentials.

skhub whoami

Display the currently authenticated user.

skhub whoami

Output

Logged in as: username
API URL: https://agentskillhub.dev
Token: sk-***... (expires: 2024-12-31)

Configuration

Environment Variables

VariableDescriptionDefault
SKHUB_API_URLPlatform API URLhttps://agentskillhub.dev

Project Root Detection

The CLI detects your project root by looking for (in order):

  1. skills.json file
  2. .git directory

skills.json

The manifest file tracking installed skills:

{
  "skills": [
    {
      "slug": "my-org/data-analysis",
      "version": "1.2.0",
      "target": "both",
      "installedAt": "2024-01-15T10:30:00Z"
    }
  ]
}

Locations:

  • Local: ./skills.json (project root)
  • Global: ~/.skhub/skills.json

Target Directories

TargetLocal PathGlobal Path
.agents/./.agents/~/.agents/
.claude/./.claude/~/.claude/

When --target both is used, .claude/ contains symlinks to .agents/.

Exit Codes

CodeMeaning
0Success
1General error
2Authentication required
3Skill not found
4Network error