> ## Documentation Index
> Fetch the complete documentation index at: https://docs.masterskills.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI overview

> The open-source masterskills CLI — two commands for humans, the rest for your agent.

The `masterskills` CLI ships on npm as [`@masterskills/cli`](https://www.npmjs.com/package/@masterskills/cli) (MIT, Node ≥ 20). Humans normally run only [`install`](/cli/install) and [`login`](/cli/login); everything else is what your agent runs on your behalf — but every command works fine by hand.

```bash theme={"dark"}
npm install -g @masterskills/cli   # one-time global install
masterskills <command>
```

The CLI checks for new versions once a day and prints a notice on stderr when one is available; update by re-running the install command above.

## Commands

| Command                               | What it does                                        |
| ------------------------------------- | --------------------------------------------------- |
| [`install`](/cli/install)             | Set up MasterSkills for every detected coding agent |
| [`login`](/cli/login)                 | Authorize this device (one browser round-trip)      |
| [`logout`](/cli/logout)               | Remove this device's credentials                    |
| [`whoami`](/cli/whoami)               | Show the signed-in user, organizations and plan     |
| [`list` / `search`](/cli/list)        | The skill catalog across your organizations         |
| [`add`](/cli/add)                     | Install skills or kits into your agents             |
| [`update`](/cli/update)               | Check for and apply skill updates                   |
| [`remove`](/cli/remove)               | Uninstall skills from this machine                  |
| [`sync`](/cli/sync)                   | Report installed skills, fetch pending changes      |
| [`agents`](/cli/agents)               | Supported agents, detection status, linked skills   |
| [`link`](/cli/link)                   | (Re)link installed skills into agent directories    |
| [`publish`](/cli/publish)             | Publish a skill folder, interactively               |
| [`prepare`](/cli/prepare)             | Build a publish draft without uploading             |
| [`publish-draft`](/cli/publish-draft) | Upload and publish an approved draft                |
| [`unpublish`](/cli/unpublish)         | Archive a skill for the whole organization          |
| [`kit …`](/cli/kit)                   | Create and manage kits                              |

## Conventions

* **Full names.** Skills and kits are always addressed as `@org/slug`.
* **`--json` everywhere it matters.** `list`, `search`, `update --check`, `prepare`, `agents`, and the `kit` read commands emit machine-readable output — that's what agents parse.
* **Non-zero exit on failure** — safe to script against.
* A `401` from the registry means the device token is missing or revoked; the fix is always `masterskills login`.

## Files on disk

| Path                                                             | Contents                                                       |
| ---------------------------------------------------------------- | -------------------------------------------------------------- |
| `~/.masterskills/config.json`                                    | API URL, device token, device/user/org identity                |
| `~/.masterskills/skills/<org>/<slug>`                            | The central store — the only real copy of each installed skill |
| Agent skill dirs (e.g. `~/.claude/skills/acme--api-conventions`) | Links into the store, flattened to `org--slug`                 |

## Environment variables

| Variable                      | Effect                                                                     |
| ----------------------------- | -------------------------------------------------------------------------- |
| `MASTERSKILLS_TOKEN`          | Device token override — CI and service use; beats the stored token         |
| `MASTERSKILLS_API_URL`        | Registry base URL (self-hosted or dev); default `https://masterskills.dev` |
| `MASTERSKILLS_HOME`           | Redirect all CLI state (config, store, drafts) away from `~/.masterskills` |
| `MASTERSKILLS_AGENTS`         | Restrict the agent registry to a comma-separated id list                   |
| `MASTERSKILLS_AGENT_DIR_<ID>` | Redirect one agent's base directory                                        |
