@uidu/skills 0.2.0 → 0.3.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/package.json +1 -1
- package/skills/uidu/SKILL.md +67 -3
- package/skills/uidu/metadata.json +1 -1
package/package.json
CHANGED
package/skills/uidu/SKILL.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: uidu
|
|
3
|
-
description: Use when building uidu
|
|
3
|
+
description: Use when building on the uidu platform — reading CMS pages, events, stories, donations, help center, forms; rendering WYSIWYG content; scaffolding projects; OR provisioning/authoring uidu content (create/update/delete) from the terminal via the @uidu/cli (`uidu`). Triggers on any task involving uidu, the @uidu/client SDK, @uidu/react bindings, or the uidu CLI.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: uidu
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.3.0"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# uidu SDK
|
|
@@ -25,7 +25,8 @@ Use this skill when the user is:
|
|
|
25
25
|
- Rendering uidu blocks with `<PageBlocks>` and a component map
|
|
26
26
|
- Rendering WYSIWYG body fields with `<RichText>`
|
|
27
27
|
- Bootstrapping a new project with `create-uidu-app`
|
|
28
|
-
-
|
|
28
|
+
- **Reading or provisioning a uidu workspace from the terminal** — the `uidu` CLI (`@uidu/cli`): `uidu login`, `uidu <entity> list|get|create|update|delete`, `uidu workspace create`
|
|
29
|
+
- Asking about `@uidu/client`, `@uidu/react`, the `uidu` CLI, or the uidu GraphQL API
|
|
29
30
|
|
|
30
31
|
## Package Map
|
|
31
32
|
|
|
@@ -41,6 +42,69 @@ Install:
|
|
|
41
42
|
npm install @uidu/client @uidu/react
|
|
42
43
|
```
|
|
43
44
|
|
|
45
|
+
## The `uidu` CLI (`@uidu/cli`)
|
|
46
|
+
|
|
47
|
+
For **reading a workspace or provisioning content from the terminal** — and for driving
|
|
48
|
+
uidu as an AI agent — use the `uidu` CLI. It wraps `@uidu/client`, so it shares the same
|
|
49
|
+
engine and auth model. Every command supports `--json` (machine-readable — parse this).
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx @uidu/cli --help # or: npm i -g @uidu/cli
|
|
53
|
+
uidu login # browser OAuth (PKCE); --password-grant + UIDU_PASSWORD for CI/agents
|
|
54
|
+
uidu whoami --json
|
|
55
|
+
|
|
56
|
+
# entities — uniform verbs
|
|
57
|
+
uidu <entity> list [--first 50] --json
|
|
58
|
+
uidu <entity> get <id> --json
|
|
59
|
+
uidu <entity> create --attributes '<json>' # or --name / --slug
|
|
60
|
+
uidu <entity> update <id> --attributes '<json>'
|
|
61
|
+
uidu <entity> delete <id>
|
|
62
|
+
|
|
63
|
+
# CMS (project-scoped — pass --project or set UIDU_PROJECT_ID)
|
|
64
|
+
uidu pages list --project <id> --json
|
|
65
|
+
uidu page create --name Home --slug home --attributes '{"projectId":"<id>"}'
|
|
66
|
+
|
|
67
|
+
# provisioning + scaffold
|
|
68
|
+
uidu workspace create --name "Acme"
|
|
69
|
+
uidu workspace credentials --json # api key + secret
|
|
70
|
+
uidu create my-app -t events # delegates to create-uidu-app
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Entities: `events, stories, donations, courses, forms, contacts, deals, employees,
|
|
74
|
+
bookings, calls, campaigns, kb-collections, kb-articles, channel` (read) and
|
|
75
|
+
`tasks, notes, spaces` (write-only). Not every verb exists for every entity — the CLI
|
|
76
|
+
reports `does not support <verb>` when it doesn't. Config resolves **flags → env
|
|
77
|
+
(`UIDU_*`) → `~/.uidu/config.json`** (written by `uidu login`).
|
|
78
|
+
|
|
79
|
+
## Reading vs writing — one rule
|
|
80
|
+
|
|
81
|
+
| Operation | Auth | Where it runs |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| **Reads** (`get*` / `list*`, `<entity> list/get`) | `publicToken` | anywhere — server, CLI, **and the browser** |
|
|
84
|
+
| **Writes** (`create*` / `update*` / `delete*`, `<entity> create/update/delete`) | account **Bearer** (`apiKey`) | CLI and **server-side** only |
|
|
85
|
+
|
|
86
|
+
The write functions live in `@uidu/client`, so anything the CLI provisions you can also do
|
|
87
|
+
from a Next.js server action / route handler / RSC. **Never put the account Bearer token in a
|
|
88
|
+
browser client component.** Authoring mutations return a payload with an `errors` array —
|
|
89
|
+
always check it (non-empty = validation failure).
|
|
90
|
+
|
|
91
|
+
## Working transparently
|
|
92
|
+
|
|
93
|
+
The user often can't tell what you're doing when you drive the CLI. Stay legible:
|
|
94
|
+
|
|
95
|
+
- **Orient first.** Before a multi-step task (especially scaffolding), say in plain words what the
|
|
96
|
+
end result is — e.g. "this creates a Next.js 16 + Tailwind project folder on your machine, wired
|
|
97
|
+
to your workspace, that you'll run at http://localhost:3000" — plus what they need (Node 20+;
|
|
98
|
+
the CLI runs via `npx`, nothing to install globally).
|
|
99
|
+
- **Show which account is active first.** Run `uidu whoami --json` and state the account/workspace
|
|
100
|
+
before anything else, so it's obvious you're touching their real (prod) workspace.
|
|
101
|
+
- **Echo commands.** Print the actual `uidu … --json` command before you run it, and one line on
|
|
102
|
+
why.
|
|
103
|
+
- **Never write without confirming.** Reads (`* list`, `* get`, `whoami`, `credentials`) run
|
|
104
|
+
freely. Any `create` / `update` / `delete` or provisioning hits the live workspace — ask first.
|
|
105
|
+
- **Summarize results.** Parse the `--json` and report what came back or what changed in plain
|
|
106
|
+
words; always surface a non-empty `errors` array instead of moving on.
|
|
107
|
+
|
|
44
108
|
## API Shape
|
|
45
109
|
|
|
46
110
|
All SDK functions are **standalone functions** that take the client as the first argument. They are never namespaced as methods on the client object:
|