@collectui/cli 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +204 -2
- package/package.json +37 -4
- package/src/args.mjs +90 -0
- package/src/catalog.mjs +386 -0
- package/src/changes.mjs +311 -0
- package/src/cli.mjs +174 -0
- package/src/commands/add.mjs +186 -0
- package/src/commands/common.mjs +125 -0
- package/src/commands/configure.mjs +5 -0
- package/src/commands/dash.mjs +92 -0
- package/src/commands/doctor.mjs +155 -0
- package/src/commands/init.mjs +5 -0
- package/src/commands/libs.mjs +49 -0
- package/src/commands/login.mjs +26 -0
- package/src/commands/mcp.mjs +190 -0
- package/src/commands/setup.mjs +221 -0
- package/src/commands/skill.mjs +26 -0
- package/src/commands/whoami.mjs +17 -0
- package/src/config.mjs +94 -0
- package/src/dash.mjs +111 -0
- package/src/errors.mjs +22 -0
- package/src/http.mjs +201 -0
- package/src/login.mjs +253 -0
- package/src/mcp.mjs +389 -0
- package/src/project.mjs +258 -0
- package/src/report.mjs +222 -0
- package/src/scaffold.mjs +459 -0
- package/src/skill/SKILL.md +120 -0
- package/src/version.mjs +5 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: collectui-cli
|
|
3
|
+
description: Use the CollectUI CLI to log in with a Dash PAT, list the shadcn libraries an account owns, configure registries + license keys + MCP in a project, scaffold a new project under /tmp, install components, and call the CollectUI Dash MCP. Use when a task mentions collectui, dash.collectui.pro, shadcn third-party registries, @reui/@uiarc/@shadcnblocks/etc., or asks to set up shadcn libraries for an agent.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CollectUI CLI
|
|
7
|
+
|
|
8
|
+
`collectui` is one CLI for every shadcn library on the user's CollectUI Dash
|
|
9
|
+
account. It always uses the user's own identity (Dash PAT, `dpat_...`) and
|
|
10
|
+
never stores upstream vendor accounts.
|
|
11
|
+
|
|
12
|
+
## Rules for agents
|
|
13
|
+
|
|
14
|
+
- Prefer `--json` for every command. It prints one JSON event per line and
|
|
15
|
+
never prompts; the final event is `{"event":"result", ...}`.
|
|
16
|
+
- Pass the PAT via `--token` or `COLLECTUI_TOKEN` in headless mode. Never echo
|
|
17
|
+
the token; the CLI redacts secrets in logs automatically.
|
|
18
|
+
- Use `--dry-run` first when changing an existing project.
|
|
19
|
+
- Do not overwrite custom registry/MCP configs. The CLI preserves custom
|
|
20
|
+
entries and only replaces official shadcn placeholders; `--force` is a
|
|
21
|
+
deliberate opt-in.
|
|
22
|
+
- If a command exits non-zero, read the `error` event / stderr; exit code 3 is
|
|
23
|
+
authentication, 2 is usage.
|
|
24
|
+
|
|
25
|
+
## Core workflows
|
|
26
|
+
|
|
27
|
+
### Inspect the account
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
collectui whoami --json
|
|
31
|
+
collectui libs --json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`libs` marks which libraries the account owns and whether CLI/MCP keys are
|
|
35
|
+
bound. Catalog slugs: `affectui arc beui efferd magic bits reui blocks space
|
|
36
|
+
studio uikit motion 21st`. Only shadcn-registry libraries are included;
|
|
37
|
+
ThreeUI, Aura and HeroUI ship their own installers and are out of scope.
|
|
38
|
+
|
|
39
|
+
### Configure an existing project
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
collectui configure /path/to/project --libs reui,arc --yes --json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This writes/merges:
|
|
46
|
+
- `components.json` → `registries` entries pointing at
|
|
47
|
+
`https://registry.collectui.pro/api/r/<source>/...` with `${ENV}` headers.
|
|
48
|
+
- `.env.local` → the license-key variables (mode 0600).
|
|
49
|
+
- MCP configs (`.mcp.json`, `.cursor/mcp.json`, `.vscode/mcp.json`; Codex with
|
|
50
|
+
`--clients codex`) → library MCP servers + `collectui-dash`.
|
|
51
|
+
- `.collectui/project.json` + `.collectui/environment.md` → machine-readable
|
|
52
|
+
setup record.
|
|
53
|
+
|
|
54
|
+
### Scaffold under /tmp
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
collectui init /tmp/my-app --libs all --yes --json --no-install
|
|
58
|
+
# or: collectui init --tmp --name my-app --libs reui
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Default template is Vite + React + TS + Tailwind v4 + a shadcn-compatible
|
|
62
|
+
`components.json`, with `git init`. `--no-install` skips `npm install`.
|
|
63
|
+
`--template none` configures an existing project only.
|
|
64
|
+
|
|
65
|
+
### Install components
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
collectui add reui data-grid
|
|
69
|
+
collectui add arc pro/dock
|
|
70
|
+
collectui add studio blocks/hero-01
|
|
71
|
+
collectui add 21st shugar/button-1
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Every library installs through `npx shadcn@latest add @scope/<component>
|
|
75
|
+
--yes`. Use `--print` to only print the command.
|
|
76
|
+
|
|
77
|
+
### Dash MCP
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
collectui mcp show --json
|
|
81
|
+
collectui mcp tools --json
|
|
82
|
+
collectui mcp call me --json
|
|
83
|
+
collectui mcp repos --json
|
|
84
|
+
collectui mcp download owner/repo --json
|
|
85
|
+
collectui mcp feedback "..." --site reui --json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Dash MCP endpoint: `https://dash.collectui.pro/api/mcp` (Bearer PAT). Tools:
|
|
89
|
+
`me`, `list_repos`, `download_repo`, `submit_feedback`. The CLI also writes
|
|
90
|
+
this server into the project's MCP config so agents can call it directly.
|
|
91
|
+
|
|
92
|
+
### Verify
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
collectui doctor --json
|
|
96
|
+
collectui doctor --deep --json # probe every owned registry (uses quota; sparingly)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Login
|
|
100
|
+
|
|
101
|
+
In an interactive terminal:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
collectui login
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
It opens `https://dash.collectui.pro/login` in the browser, waits for a
|
|
108
|
+
localhost callback, and otherwise asks for the PAT (hidden input). Headless:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
COLLECTUI_TOKEN=dpat_... collectui whoami --json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Security
|
|
115
|
+
|
|
116
|
+
- PAT, CLI keys and MCP keys are never printed. `reporter.redact` masks them.
|
|
117
|
+
- `.env.local`, `.mcp.json`, `.cursor/mcp.json`, `.vscode/mcp.json` contain
|
|
118
|
+
credentials; the scaffold gitignores them.
|
|
119
|
+
- The CLI never sends keys anywhere except the CollectUI registry/MCP hosts
|
|
120
|
+
(`registry.collectui.pro`, `dash.collectui.pro`) and the local project files.
|