npm package: @skill-hub/cli
Description: CLI for SkillHub - Create, publish, and manage your AI agent skills
Author: SkillHub
Latest version: 0.1.2

# @skill-hub/cli

> **One-command install for AI agent skills** - Install skills to Claude, Cursor, Codex, and 6+ more agents instantly

[![npm version](https://img.shields.io/npm/v/@skill-hub/cli.svg)](https://www.npmjs.com/package/@skill-hub/cli)
[![npm downloads](https://img.shields.io/npm/dm/@skill-hub/cli.svg)](https://www.npmjs.com/package/@skill-hub/cli)

## Core Features

### One-Command Install
Install any skill to your AI agent with a single command - just like `npx skills add`:

```bash
npx @skill-hub/cli install frontend-design --agent claude
```

**Supports 9+ Agent Platforms:**
- Claude Code, Cursor, Codex, Gemini, GitHub Copilot
- Windsurf, Cline, Roo Code, OpenCode

### Smart Discovery
Find the perfect skill with semantic search, trending lists, and AI-powered recommendations:

```bash
# Semantic search
npx @skill-hub/cli search "react best practices"

# Trending skills (24h)
npx @skill-hub/cli trending

# Latest additions
npx @skill-hub/cli latest

# Personalized recommendations
npx @skill-hub/cli recommend --task frontend
```

### Skill Management
Create, publish, and manage your own skills:

```bash
# Create a new skill
npx @skill-hub/cli init

# Publish to SkillHub
npx @skill-hub/cli publish

# Sync with remote
npx @skill-hub/cli push
```

## Installation

**Two ways to use:**

### Option 1: Using npx (Recommended) ⭐
No installation needed - always uses the latest version:

```bash
npx @skill-hub/cli install frontend-design
npx @skill-hub/cli search "react"
```

**Pros:**
- No installation required
- Always uses latest version
- No global package pollution
- Works immediately

### Option 2: Global Installation
Install once, use `skillhub` command directly:

```bash
npm install -g @skill-hub/cli

# Then use shorter command
skillhub install frontend-design
skillhub search "react"
```

**Pros:**
- Shorter command (`skillhub` vs `npx @skill-hub/cli`)
- Faster (no download on each run)
- Works offline after installation

**Note:** After global install, use `skillhub` instead of `npx @skill-hub/cli`

## Quick Start

### 1. Install a Skill

```bash
# Using npx (no install needed)
npx @skill-hub/cli install frontend-design --agent claude

# Or if globally installed, use shorter command
skillhub install frontend-design --agent claude

# Install to project directory
skillhub install frontend-design --project

# Interactive mode (choose agent & location)
skillhub install frontend-design
```

**Installation Locations:**
- **Personal (Global)**: `~/.claude/skills/` - Available for all projects
- **Project**: `./.claude/skills/` - Only for current project

### 2. Discover Skills

```bash
# Search with natural language
skillhub search "react component design"

# Browse trending (24h)
skillhub trending --limit 20

# See what's new
skillhub latest

# Get AI recommendations
skillhub recommend --task frontend --query "component library"
```

### 3. Create & Publish

```bash
# Login first
skillhub login

# Initialize a skill project
skillhub init

# Edit SKILL.md, then push
skillhub push

# Make it public
skillhub publish
```

## All Commands

### Discover & Install

| Command | Aliases | Description |
|---------|---------|-------------|
| `install <skill>` | `i`, `add` | **Install a skill to your agent** |
| `search <query>` | `s`, `find` | **Semantic search for skills** |
| `trending` | `hot`, `popular` | **Show trending skills (24h)** |
| `latest` | `new`, `recent` | **Show recently added skills** |
| `recommend` | `rec`, `suggest` | **Get personalized recommendations** |
| `top` | `leaderboard`, `rank` | **Show all-time leaderboard** |

### Create & Manage

| Command | Description |
|---------|-------------|
| `login` | Log in to SkillHub |
| `init` | Initialize a new skill project |
| `push` | Push local files to remote |
| `pull` | Pull remote files to local |
| `status` | Show local vs remote status |
| `publish` | Publish skill to public directory |
| `list` | List your skills |
| `whoami` | Show current logged in user |

## Install Command

### Basic Usage

```bash
# Using npx
npx @skill-hub/cli install <skill-slug> [options]

# Or if globally installed
skillhub install <skill-slug> [options]
```

### Options

```bash
Options:
  -a, --agent <agent>    Target agent (claude, cursor, codex, gemini, copilot, windsurf, cline, roo, opencode)
  -p, --project          Install to project directory (default: personal)
  -d, --dir <path>       Custom install directory
  -y, --yes              Skip confirmation prompts
  --list-agents          List all supported agents
```

### Supported Agents

| Agent | Command | Install Path |
|-------|---------|--------------|
| **Claude Code** | `claude` | `~/.claude/skills/` |
| **Cursor** | `cursor` | `~/.cursor/skills/` |
| **Codex CLI** | `codex` | `~/.codex/skills/` |
| **Gemini CLI** | `gemini` | `~/.gemini/skills/` |
| **GitHub Copilot** | `copilot` | `~/.copilot/skills/` |
| **Windsurf** | `windsurf` | `~/.windsurf/skills/` |
| **Cline** | `cline` | `~/.cline/skills/` |
| **Roo Code** | `roo` | `~/.roo/skills/` |
| **OpenCode** | `opencode` | `~/.config/opencode/skills/` |

## Examples

### Install Examples

```bash
# Quick install to Claude
skillhub install frontend-design --agent claude -y

# Install to Cursor project
skillhub install frontend-design --agent cursor --project

# Interactive install (choose agent & location)
skillhub install anthropics-skills-frontend-design
```

### Discovery Examples

```bash
# Search and install
skillhub search "react" --limit 5
skillhub install anthropics-skills-frontend-design

# Browse trending
skillhub trending --limit 20 --category development

# Get recommendations
skillhub recommend --task backend --query "API design"
```

### Management Examples

```bash
# Create and publish a skill
skillhub login
skillhub init
# Edit SKILL.md...
skillhub push
skillhub publish

# Check status
skillhub status
skillhub list
```

## Why SkillHub CLI?

### **One Command, Any Agent**
Unlike other tools, install skills to **9+ different AI agents** with the same command.

### **Smart Discovery**
Semantic search powered by embeddings - find skills by what they do, not just keywords.

### **Trending & Recommendations**
Discover what's popular and get personalized recommendations based on your needs.

### **Fast & Simple**
No complex setup - just `npx` and go. Works offline after installation.

### **Secure**
OAuth authentication, no API keys in code, credentials stored securely.

## Configuration

### User Config
Stored in `~/.skillhub/config.json`:
- API URL (default: `https://skillhub.club/api/v1`)
- Default visibility settings

### Auth Tokens
Stored securely in `~/.skillhub/auth.json` (mode 600):
- Access tokens
- Refresh tokens
- User info

### Local Project Config
Each skill project has `.skillhub.json`:
- Skill metadata
- Remote sync info
- Ignore patterns

## Development

```bash
# Clone
git clone https://github.com/skillhub-club/cli.git
cd cli

# Install
npm install

# Build
npm run build

# Dev mode (watch)
npm run dev

# Type check
npm run typecheck
```

## Links

- **Website**: https://skillhub.club
- **Documentation**: https://skillhub.club/docs
- **npm**: https://www.npmjs.com/package/@skill-hub/cli
- **GitHub**: https://github.com/skillhub-club/cli
- **Issues**: https://github.com/skillhub-club/cli/issues

## License

MIT © [SkillHub](https://skillhub.club)