<div align="center">

# `@prave/cli`

**The Prave CLI — discover, install, author, version, test, and ship Skills to any AI agent from your terminal.**

[![npm version](https://img.shields.io/npm/v/@prave/cli?color=06B6D4&label=npm&style=flat-square)](https://www.npmjs.com/package/@prave/cli)
[![npm downloads](https://img.shields.io/npm/dm/@prave/cli?color=06B6D4&label=downloads&style=flat-square)](https://www.npmjs.com/package/@prave/cli)
[![node](https://img.shields.io/node/v/@prave/cli?color=06B6D4&label=node&style=flat-square)](https://nodejs.org)
[![license](https://img.shields.io/npm/l/@prave/cli?color=06B6D4&style=flat-square)](https://github.com/eppstudio/prave/blob/main/LICENSE)
[![docs](https://img.shields.io/badge/docs-prave.app-06B6D4?style=flat-square)](https://prave.app/docs)
[![status](https://img.shields.io/badge/status-status.prave.app-22c55e?style=flat-square)](https://status.prave.app)

[**Website**](https://prave.app) · [**Documentation**](https://prave.app/docs) · [**CLI Cheat Sheet**](https://prave.app/docs/cli/cheat-sheet) · [**Status**](https://status.prave.app)

</div>

---

## What is Prave?

[Prave](https://prave.app) is the developer platform for the **complete lifecycle of AI agent Skills** — a registry to discover them, an editor to write them, an intelligence layer to keep your library lean, a tester to verify them, and this CLI to wire it all into your agent's skills directory on every machine you work from.

The Skill format originated with [Claude Code](https://docs.claude.com/en/docs/claude-code/skills) (a folder with a `SKILL.md` and frontmatter). The same format works **out of the box** with any agent that auto-loads instruction files from a folder — Prave is agent-aware: each Skill is tagged with which agents understand it, and `prave deploy` mirrors a Skill across **Claude Code · OpenAI Codex · Cursor · Gemini CLI · Cline · Amp**, with more added as the ecosystem grows.

This package is the **command-line surface**. The web app, the public registry, billing, and the API live at [prave.app](https://prave.app).

## Install

```bash
npm install -g @prave/cli
# or
pnpm add -g @prave/cli
# or
yarn global add @prave/cli
```

Requires **Node.js 18+**.

## Quick start

```bash
prave login              # device-code auth in your browser
prave search "review pull requests"
prave install pr-reviewer    # writes into your agent's skills folder
prave deploy pr-reviewer     # mirror it to every agent you use
prave list                   # what's now installed locally
```

That's enough to be useful. The full vocabulary is below.

> **Multi-agent by default.** `prave install` writes to your primary agent's skills folder (Claude Code by default; configurable via `prave settings`). `prave deploy` then mirrors the Skill to every other agent you've enabled — Cursor, Codex, Gemini, Cline, Amp — converting between their respective rule-file formats automatically.

### `prave sync` in practice

`prave sync` shows you when you last ran it and confirms before doing any work — under 30 minutes ago and the default flips to `n`. Skills then install in parallel (concurrency 4) with a per-Skill progress counter:

```bash
$ prave sync
Last sync: 2 hours ago — sync again? [Y/n] y
Syncing 12 Skills — this takes about 15 seconds.
✓ 12 / 12 — pr-reviewer
Synced 12 · failed 0
```

The `last_sync_at` watermark persists at `~/.prave/state.json`.

## Commands

### Auth & account

| Command        | What it does                                                                      |
| -------------- | --------------------------------------------------------------------------------- |
| `prave login`  | Browser device-code auth. Tokens stored chmod-600 at `~/.prave/credentials.json`. |
| `prave logout` | Forget local credentials.                                                         |
| `prave whoami` | Show signed-in user, plan, and credentials path.                                  |

### Discover & install

| Command                                                  | What it does                                  |
| -------------------------------------------------------- | --------------------------------------------- |
| `prave search <query>`                                   | Search the public Skill registry.             |
| `prave install <slug>` `[--no-deps]`                     | Install into your agent's skills folder.      |
| `prave uninstall <slug>`                                 | Remove a locally installed Skill.             |
| `prave list` `[--remote] [--verbose]`                    | What's installed locally (or remote).         |
| `prave export <slug>` `-o file.md`                       | Dump a Skill's `SKILL.md` without installing. |

### Authoring & sync

| Command                                         | What it does                                                                           |
| ----------------------------------------------- | -------------------------------------------------------------------------------------- |
| `prave import` `[--upload --public\|--private]` | Scan your agent's skills folder, optionally publish to Prave.                          |
| `prave deploy <slug>` `[--agent <name>]`        | Mirror a Skill across enabled agents (Claude / Cursor / Codex / Gemini / Cline / Amp). |
| `prave sync`                                    | Pull updates for every locally installed Skill.                                        |
| `prave update [<slug>]` `[--dry-run]`           | Diff installed Skills against the registry, pull what's outdated.                      |
| `prave diff <slug>`                             | Local vs registry side-by-side diff.                                                   |

### Intelligence

| Command                              | What it does                                          |
| ------------------------------------ | ----------------------------------------------------- |
| `prave overview` `[--json]`          | Summary of token cost, conflicts, and library health. |
| `prave whatdoes <slug>`              | Triggers, tokens, conflicts for a Skill.              |
| `prave conflicts`                    | Cross-Skill collision check.                          |
| `prave optimize` `[--remove-unused]` | Recommendations: heavy / underused / mergeable.       |

### Usage tracking _(Pro+)_

| Command                           | What it does                                              |
| --------------------------------- | --------------------------------------------------------- |
| `prave usage hook install`        | Real-time invocation tracking for agents that support it. |
| `prave usage hook uninstall`      | Remove the real-time hook.                                |
| `prave usage scan` `[--since 7d]` | Transcript scanner — backfill recent invocations.         |
| `prave usage status`              | Hook health, recent counts, and top Skills.               |

> **Coverage today:** Real-time tracking lives natively on Claude Code via its plugin contract. For every other agent, the **transcript scanner** auto-runs at the tail of `prave sync` and reads the agent's local conversation history to extract Skill invocations — so Intelligence and the optimiser stay accurate everywhere. Real-time hooks for Cursor / Codex / Gemini / Cline / Amp ship as soon as those agents expose an equivalent contract.

### Settings

| Command          | What it does                                                |
| ---------------- | ----------------------------------------------------------- |
| `prave settings` | Configure agents, providers, and credits from the terminal. |
| `prave cheat`    | Print the full one-page command reference.                  |

## Auto-update

`prave login` retries on `401` once with a fresh access token swapped via your stored `refresh_token`. You won't see "expired token" mid-install — re-authenticating is only required when the **refresh token itself** is rejected (you signed out everywhere or were idle for 30+ days).

## Privacy & telemetry

The CLI sends a **fire-and-forget event per command** (e.g. `cli_install`, `cli_sync`, `cli_login_started`) to PostHog EU Cloud so we can see which commands matter to users. Events carry your Supabase user-id once you've logged in (or a stable per-machine UUID at `~/.prave/anon-id` if you haven't), plus OS family, OS release, Node.js version, and the CLI version — no command arguments, no Skill content, no file paths.

**Opt out** by setting:

```bash
PRAVE_TELEMETRY=0
```

(also accepts `false`, `off`, `no`). When set, no event ever leaves your machine.

Full data-protection details: [Privacy Policy](https://prave.app/legal/privacy).

## Where things live

The exact Skill location depends on the agent — `prave settings` lets you reconfigure per-agent paths, and `prave list` always reflects what is actually on disk. The defaults:

```
Claude Code   ~/.claude/skills/<slug>/SKILL.md
Cursor        ~/.cursor/rules/<slug>.mdc
Codex         ~/.codex/skills/<slug>/SKILL.md
Gemini CLI    ~/.gemini/skills/<slug>/SKILL.md
Cline         ~/.cline/rules/<slug>.md
Amp           ~/.amp/skills/<slug>/SKILL.md
```

Local Prave state:

```
~/.prave/credentials.json          # access + refresh tokens (chmod 600)
~/.prave/anon-id                   # anonymous telemetry id (pre-login)
~/.prave/usage-cursor.json         # transcript scanner watermark
```

## Status

API health and uptime: [status.prave.app](https://status.prave.app) — auto-refreshes every 30 seconds, shows the live build version + commit SHA, and surfaces incidents from the last 30 days.

## Links

- 🌐 [**prave.app**](https://prave.app) — the platform
- 📚 [**prave.app/docs**](https://prave.app/docs) — full documentation
- 📖 [**CLI Cheat Sheet**](https://prave.app/docs/cli/cheat-sheet) — every command on one page
- 💚 [**status.prave.app**](https://status.prave.app) — real-time health
- 🐛 [**GitHub Issues**](https://github.com/eppstudio/prave/issues) — bug reports & feature requests
- ✉️ [hello@epplab-studio.de](mailto:hello@epplab-studio.de) — direct contact

## License

[MIT](https://github.com/eppstudio/prave/blob/main/LICENSE) © [EppLab Studio](https://epplab-studio.de)
