npm package: @openbooklet/cli
Description: CLI tool for the OpenBooklet skill marketplace
Author: OpenBooklet
Latest version: 0.2.0

# @openbooklet/cli

The official CLI for the [OpenBooklet](https://openbooklet.com) marketplace. Browse, install, and publish AI agent skills, workflows, and memory packs from your terminal.

## Installation

```bash
npm install -g @openbooklet/cli
```

Requires Node.js 18 or later.

## Quick Start

```bash
# Search for skills
ob search "react testing"

# Pull a skill into your project
ob pull react-testing-pro

# Pull a workflow
ob pull w/content-pipeline

# Pull a memory pack
ob pull mp/aws-architect

# Install a workflow with all dependencies
ob install w/content-pipeline

# Search for workflows only
ob search "pipeline" --type=workflow

# See what's trending
ob trending

# Trending memory packs
ob trending --type=memory-pack
```

## Commands

### `ob pull <asset>`

Downloads a skill, workflow, or memory pack. Supports type prefixes and version pinning.

```bash
# Skills (default)
ob pull my-skill                    # Latest version
ob pull my-skill@1.0.0              # Pinned version
ob pull s/my-skill                  # Explicit skill prefix

# Workflows
ob pull w/content-pipeline          # Pull workflow instructions
ob pull w/content-pipeline --bundle # Pull workflow + all locked dependencies

# Memory Packs
ob pull mp/aws-architect            # Pull memory pack

# Directories
ob pull d/username/my-dir           # Pull directory as bundle
ob pull d/username/my-dir --list    # List contents without pulling

# Options
ob pull my-skill --out ./path       # Custom output path
ob pull my-skill --target cursor    # Install for specific agent
ob pull my-skill --key sk_abc123    # Pass API key directly
```

**Options:**

| Flag | Description |
|------|-------------|
| `-o, --out <path>` | Custom output path (overrides --target) |
| `-t, --target <agent>` | Target agent: `claude`, `cursor`, `windsurf`, `copilot`, `codex` (auto-detected if omitted) |
| `-b, --bundle` | For workflows: pull entire bundle with all dependencies |
| `--list` | For directories: list contents without pulling |
| `-k, --key <key>` | API key for authentication |

### `ob install <asset>`

Install a workflow or directory bundle with all dependencies. Parses the bundle and writes each asset to the correct local path for the target agent.

```bash
ob install w/content-pipeline                  # Install for auto-detected agent
ob install w/content-pipeline --target cursor  # Install for Cursor
ob install d/username/web-dev-stack            # Install directory bundle
```

**Options:**

| Flag | Description |
|------|-------------|
| `-t, --target <target>` | Target agent: `claude`, `cursor`, `windsurf`, or a custom path |

### `ob search <query>`

Search for skills, workflows, or memory packs on the marketplace.

```bash
ob search "typescript"
ob search "testing" --category development
ob search "aws" --type=memory-pack
ob search "pipeline" --type=workflow --limit 20
```

**Options:**

| Flag | Description |
|------|-------------|
| `--type <type>` | Filter by type: `skill`, `workflow`, `memory-pack` |
| `-c, --category <category>` | Filter by category |
| `-l, --limit <number>` | Number of results (default: 10) |
| `-k, --key <key>` | API key |

### `ob info <asset>`

Show detailed information about a skill, workflow, or memory pack. Supports type prefixes.

```bash
ob info react-testing-pro        # Skill info
ob info w/content-pipeline       # Workflow info (shows dep tree + lock status)
ob info mp/aws-architect         # Memory pack info (shows subtype + works-with)
```

### `ob trending`

Show trending assets on the marketplace.

```bash
ob trending                          # All types
ob trending --type=workflow          # Workflows only
ob trending --type=memory-pack       # Memory packs only
ob trending --category development   # Filter by category
ob trending --limit 20
```

**Options:**

| Flag | Description |
|------|-------------|
| `--type <type>` | Filter by type: `skill`, `workflow`, `memory-pack` |
| `-c, --category <category>` | Filter by category |
| `-l, --limit <number>` | Number of results (default: 10) |
| `-k, --key <key>` | API key |

### `ob publish`

Publish a skill to the marketplace. Reads `SKILL.md` from the current directory by default. The asset type is detected from `ob:type` in the YAML frontmatter.

```bash
ob publish                    # Reads SKILL.md from current directory
ob publish --file ./path.md   # Custom file path
ob publish --key sk_abc123    # Pass API key directly
```

### `ob login`

Save your API key for authentication. Get your key at [openbooklet.com/settings/api](https://openbooklet.com/settings/api).

```bash
ob login                      # Prompts for API key
ob login --key sk_abc123      # Pass key directly
```

### `ob whoami`

Show your current authentication status.

```bash
ob whoami
```

## Authentication

The CLI looks for an API key in this order:

1. `--key` flag on any command
2. `OB_API_KEY` environment variable
3. Stored key in `~/.obrc` (set via `ob login`)

## Configuration

The CLI stores its config in `~/.obrc` as JSON:

```json
{
  "apiKey": "your-api-key"
}
```

### Environment Variables

| Variable | Description |
|----------|-------------|
| `OB_API_KEY` | API key for authentication |
| `OB_API_URL` | Custom API base URL (default: `https://openbooklet.com/api/v1`) |

## Development

```bash
git clone https://github.com/openbooklet/cli.git
cd cli
npm install
npm run build
node dist/index.js --help
```

## License

MIT