npm package: @qubicrab/cli
Description: Qubicrab CLI — manage, version, and share AI prompts from the terminal
Author: EnQube SMPC
Latest version: 1.0.4

# @qubicrab/cli

**Manage, version, and share AI prompts from the terminal.**

Qubicrab CLI is the command-line interface for [Qubicrab](https://qubicrab.com) — an AI prompt management platform with version control, sharing, analytics, and team workspaces.

## Installation

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

## Quick Start

```bash
# Log in (opens browser for authentication)
qubicrab login

# Save a prompt
qubicrab save "My Prompt" --file prompt.txt --model GPT-4 --tags "writing,creative"

# Save from stdin
echo "Write a story about..." | qubicrab save "Story Prompt"

# List your prompts
qubicrab list

# View version history
qubicrab version "My Prompt"

# Share a prompt
qubicrab share "My Prompt"
```

## Authentication

The CLI supports three authentication methods:

```bash
# Browser-based login (default, recommended)
qubicrab login

# Personal Access Token (prompts securely for the key)
qubicrab login --token

# Email + password
qubicrab login --password
```

Credentials are stored securely in `~/.qubicrabrc` with `0600` file permissions.

## Commands

### Auth
| Command | Description |
|---------|-------------|
| `qubicrab login` | Log in (browser, token, or password) |
| `qubicrab logout` | Log out and clear credentials |
| `qubicrab whoami` | Show current user |

### Prompts
| Command | Description |
|---------|-------------|
| `qubicrab list` | List your prompts |
| `qubicrab save <title>` | Create or update a prompt |
| `qubicrab version <title>` | Show version history |
| `qubicrab share <title>` | Create a share link |

### Sync
| Command | Description |
|---------|-------------|
| `qubicrab init` | Initialize a folder for prompt syncing |
| `qubicrab pull` | Download prompts as `.md` files |
| `qubicrab push` | Upload new and changed `.md` files |
| `qubicrab status` | Show sync status of local files |

### API Keys
| Command | Description |
|---------|-------------|
| `qubicrab token create <name>` | Create a new API key |
| `qubicrab token list` | List your API keys |
| `qubicrab token revoke <id>` | Revoke an API key |

### Explore
| Command | Description |
|---------|-------------|
| `qubicrab search <query>` | Search public prompts |

### Utilities
| Command | Description |
|---------|-------------|
| `qubicrab config` | Show CLI configuration |

## Options

### `qubicrab save`
```
-f, --file <path>           Read content from file
-m, --model <model>         AI model (e.g., GPT-4, Claude)
--tags <tags>               Comma-separated tags
--visibility <vis>          PUBLIC, PRIVATE, or UNLISTED
--message <msg>             Version commit message
--description <desc>        Prompt description
```

### `qubicrab list`
```
-t, --tag <tag>             Filter by tag
-m, --model <model>         Filter by model
-v, --visibility <vis>      Filter by visibility
-s, --search <query>        Search by title
-p, --page <page>           Page number
```

### `qubicrab share`
```
--password                  Password-protect the link (prompts interactively)
--ref <code>                Tracking referral code
```

### `qubicrab pull`
```
-c, --collection <name>    Pull only a specific collection
```

### `qubicrab push`
```
-m, --message <msg>         Version commit message
-y, --yes                   Skip confirmation prompt
```

### `qubicrab token create`
```
-e, --expires <days>        Expiration in days (default: never)
```

### `qubicrab search`
```
-t, --tag <tag>             Filter by tag
-m, --model <model>         Filter by model
-s, --sort <sort>           Sort by: relevance, recent, or popular
-p, --page <page>           Page number
```

### `qubicrab config`
```
--set <key=value>           Set a config value
```

## Requirements

- Node.js 18 or later

## Links

- **Website:** [qubicrab.com](https://qubicrab.com)
- **App:** [app.qubicrab.com](https://app.qubicrab.com)

## License

MIT © [EnQube SMPC](https://qubicrab.com)