@docyrus/docyrus 0.0.67 → 0.0.69

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.
Files changed (22) hide show
  1. package/main.js +136 -136
  2. package/main.js.map +3 -3
  3. package/package.json +3 -3
  4. package/resources/pi-agent/extensions/pi-bash-live-view/widget.ts +2 -17
  5. package/resources/pi-agent/skills/docyrus-api-dev/SKILL.md +36 -1
  6. package/resources/pi-agent/skills/docyrus-api-doctor/SKILL.md +70 -0
  7. package/resources/pi-agent/skills/docyrus-api-doctor/references/checklist-details.md +588 -0
  8. package/resources/pi-agent/skills/docyrus-app-dev-react/SKILL.md +1 -1
  9. package/resources/pi-agent/skills/docyrus-app-dev-react/references/collections-and-patterns.md +0 -22
  10. package/resources/pi-agent/skills/docyrus-cli-app/SKILL.md +360 -0
  11. package/resources/pi-agent/skills/docyrus-cli-app/references/cli-manifest.md +627 -0
  12. package/resources/pi-agent/skills/docyrus-cli-app/references/list-query-examples.md +248 -0
  13. package/resources/pi-agent/skills/docyrus-data-grid-page-design/SKILL.md +61 -0
  14. package/resources/pi-agent/skills/docyrus-data-grid-page-design/references/advanced-saved-view-query-patterns.md +158 -0
  15. package/resources/pi-agent/skills/docyrus-data-grid-page-design/references/hook-pages.md +227 -0
  16. package/resources/pi-agent/skills/docyrus-data-grid-page-design/references/manual-pages.md +145 -0
  17. package/resources/pi-agent/skills/docyrus-data-grid-page-design/references/tenant-and-users-providers.md +290 -0
  18. package/resources/pi-agent/skills/docyrus-record-detail-form-design/SKILL.md +54 -0
  19. package/resources/pi-agent/skills/docyrus-record-detail-form-design/references/advanced-inline-edit-and-renderers.md +140 -0
  20. package/resources/pi-agent/skills/docyrus-record-detail-form-design/references/field-type-mapping-and-fallbacks.md +150 -0
  21. package/resources/pi-agent/skills/docyrus-record-detail-form-design/references/hook-form-view.md +127 -0
  22. package/resources/pi-agent/skills/docyrus-record-detail-form-design/references/manual-form-detail-patterns.md +125 -0
@@ -0,0 +1,360 @@
1
+ ---
2
+ name: docyrus-cli-app
3
+ description: Use the Docyrus CLI (`docyrus`) to interact with the Docyrus platform from the terminal. Use when the user asks to authenticate, list apps, query or manage data records (`ds`), manage dev app data source schema objects (`studio`), send API requests, switch environments, tenants, or accounts, discover tenant OpenAPI specs, or use the Bun-powered terminal UI via `docyrus tui`. Triggers on tasks involving docyrus CLI commands, terminal-based Docyrus operations, `docyrus ds list`, `docyrus studio`, `docyrus discover`, `docyrus auth`, `docyrus env`, `docyrus tui`, or shell-based Docyrus workflows.
4
+ ---
5
+
6
+ # Docyrus CLI
7
+
8
+ Guide for using the `docyrus` CLI to interact with the Docyrus platform from the terminal.
9
+
10
+ ## Command Overview
11
+
12
+ | Command | Description |
13
+ |---------|-------------|
14
+ | `docyrus` | Show active environment, current auth context, and help summary |
15
+ | `docyrus env list` / `env use` | Manage named environments |
16
+ | `docyrus auth login` | Authenticate via OAuth2 device flow or manual tokens |
17
+ | `docyrus auth logout` | Logout the active account for the current environment |
18
+ | `docyrus auth who` | Show the active user and tenant |
19
+ | `docyrus auth accounts list` / `use` | Manage saved user accounts |
20
+ | `docyrus auth tenants list` / `use` | Manage saved tenants for a user |
21
+ | `docyrus apps list` | List apps from `/v1/apps` |
22
+ | `docyrus ds get` | Get data source metadata |
23
+ | `docyrus ds list` | Query records with filters, sorting, pagination |
24
+ | `docyrus ds create` / `update` / `delete` | Mutate records, including bulk create/update |
25
+ | `docyrus studio ...` | CRUD for dev app data sources, fields, and enums |
26
+ | `docyrus discover api` | Download tenant OpenAPI spec |
27
+ | `docyrus discover namespaces` / `path` / `endpoint` / `entity` / `search` | Explore the downloaded tenant OpenAPI spec |
28
+ | `docyrus connect list-connectors` | List integration connectors with optional keyword search |
29
+ | `docyrus connect get-connector <slug>` | Get connector details including data sources and actions |
30
+ | `docyrus connect get-action <slug> <actionKey>` | Get action details with input/output JSON schemas |
31
+ | `docyrus connect list-connections <slug>` | Get tenant and user connections for a connector |
32
+ | `docyrus connect curl <slug> <endpoint>` | Send HTTP request through a connector's provider auth |
33
+ | `docyrus connect run-action <appSlug> <actionKey>` | Run a connector or app action |
34
+ | `docyrus curl` | Send arbitrary API requests |
35
+ | `docyrus tui` | Launch the OpenTUI terminal UI (requires Bun) |
36
+
37
+ **See [references/cli-manifest.md](references/cli-manifest.md) for complete command reference with flags and arguments.**
38
+
39
+ ## Common Workflows
40
+
41
+ ### Settings Scope
42
+
43
+ By default, `docyrus` stores settings in a project-local `.docyrus/` folder in the current working directory.
44
+
45
+ - Local default: `./.docyrus/`
46
+ - Global override: `~/.docyrus/` via `-g` or `--global`
47
+ - Tenant OpenAPI cache: `<settings-root>/tenans/<tenantId>/openapi.json`
48
+
49
+ Examples:
50
+
51
+ ```bash
52
+ # Local project settings (default)
53
+ docyrus auth login --clientId "83a8df32-3738-4b5a-a0c7-87976adb1631"
54
+
55
+ # Force global settings for this run
56
+ docyrus -g auth login --clientId "83a8df32-3738-4b5a-a0c7-87976adb1631"
57
+ ```
58
+
59
+ ### Environments
60
+
61
+ The CLI does not use `API_BASE_URL`. It uses saved named environments:
62
+
63
+ - `live` (`prod` alias) -> `https://api.docyrus.com`
64
+ - `beta` -> `https://beta-api.docyrus.com`
65
+ - `alpha` -> `https://alpha-api.docyrus.com`
66
+ - `dev` -> `https://localhost:3366`
67
+
68
+ Examples:
69
+
70
+ ```bash
71
+ docyrus
72
+ docyrus env list --json
73
+ docyrus env use beta --json
74
+ ```
75
+
76
+ Running `docyrus` without a subcommand returns the active environment, help summary, and current auth `context`.
77
+
78
+ ### Authentication
79
+
80
+ Device flow login:
81
+
82
+ ```bash
83
+ docyrus auth login --clientId "83a8df32-3738-4b5a-a0c7-87976adb1631" --json
84
+ ```
85
+
86
+ Manual token login:
87
+
88
+ ```bash
89
+ docyrus auth login \
90
+ --accessToken "<access-token>" \
91
+ --refreshToken "<optional-refresh-token>" \
92
+ --clientId "<optional-client-id>" \
93
+ --json
94
+ ```
95
+
96
+ Rules:
97
+
98
+ - `--refreshToken` requires `--accessToken`
99
+ - if local login omits `--clientId`, the CLI falls back to the saved global client ID when available
100
+ - explicit or previously resolved client IDs are saved to config for reuse
101
+ - default scopes are hardcoded in the CLI and include `openid`, `email`, `profile`, `offline_access`, `ReadWrite.All`, `User.ReadWrite`, `Users.Read.All`, `Tenant.Read`, `Teams.Read.All`, `DS.ReadWrite.All`, `Docs.ReadWrite.All`, and `Architect.ReadWrite.All`
102
+
103
+ Multi-account and multi-tenant workflows:
104
+
105
+ ```bash
106
+ docyrus auth accounts list --json
107
+ docyrus auth accounts use --userId "<user-id>" --json
108
+ docyrus auth tenants list --userId "<user-id>" --json
109
+ docyrus auth tenants use 1002 --json
110
+ docyrus auth tenants use "8d130f7a-4bc4-4be6-a05b-0f8f1b2d93e9" --userId "<user-id>" --json
111
+ docyrus auth who --json
112
+ ```
113
+
114
+ `auth tenants use` takes a positional tenant selector. If it is numeric, the CLI treats it as `tenantNo`; otherwise it must be a UUID tenant ID.
115
+
116
+ ### Successful Result Shape
117
+
118
+ Every successful command injects a top-level `context` field:
119
+
120
+ ```json
121
+ {
122
+ "data": {},
123
+ "context": {
124
+ "email": "user@example.com",
125
+ "tenantName": "Acme",
126
+ "tenantNo": 1002,
127
+ "tenantDisplay": "Acme (1002)"
128
+ }
129
+ }
130
+ ```
131
+
132
+ If there is no active session, `context` is `null`.
133
+
134
+ ### Discover API and Entities
135
+
136
+ Discover commands require an active session. Commands other than `discover api` auto-download the OpenAPI spec if it is missing locally.
137
+
138
+ ```bash
139
+ docyrus discover api --json
140
+ docyrus discover namespaces --json
141
+ docyrus discover path /v1/users --json
142
+ docyrus discover endpoint /v1/users/me --json
143
+ docyrus discover endpoint [PUT]/v1/users/me/photo --json
144
+ docyrus discover entity UserEntity --json
145
+ docyrus discover search users,UserEntity --json
146
+ ```
147
+
148
+ ### Discover Data Sources
149
+
150
+ ```bash
151
+ docyrus apps list --json
152
+ docyrus ds get crm contacts --json
153
+ ```
154
+
155
+ ### Query Records (`ds list`)
156
+
157
+ Basic listing:
158
+
159
+ ```bash
160
+ docyrus ds list crm contacts --columns "name, email, phone" --limit 20
161
+ ```
162
+
163
+ With filters:
164
+
165
+ ```bash
166
+ docyrus ds list crm contacts \
167
+ --columns "name, email" \
168
+ --filters '{"rules":[{"field":"status","operator":"=","value":"active"}]}'
169
+ ```
170
+
171
+ With relation expansion:
172
+
173
+ ```bash
174
+ docyrus ds list crm contacts \
175
+ --columns "name, ...related_account(account_name, account_phone)"
176
+ ```
177
+
178
+ Date shortcut filter:
179
+
180
+ ```bash
181
+ docyrus ds list crm tasks --filters '{"rules":[{"field":"created_on","operator":"this_month"}]}'
182
+ ```
183
+
184
+ **See [references/list-query-examples.md](references/list-query-examples.md) for more filter, sort, pagination, and combined query examples.**
185
+
186
+ ### Record Mutations
187
+
188
+ Create:
189
+
190
+ ```bash
191
+ docyrus ds create crm contacts --data '{"name":"Jane Doe","email":"jane@example.com"}'
192
+ ```
193
+
194
+ Update:
195
+
196
+ ```bash
197
+ docyrus ds update crm contacts <recordId> --data '{"phone":"+1234567890"}'
198
+ ```
199
+
200
+ Delete:
201
+
202
+ ```bash
203
+ docyrus ds delete crm contacts <recordId>
204
+ ```
205
+
206
+ Batch and file input:
207
+
208
+ ```bash
209
+ docyrus ds create crm contacts --data '[{"name":"A"},{"name":"B"}]' --json
210
+ docyrus ds update crm contacts --data '[{"id":"1","phone":"+111"},{"id":"2","phone":"+222"}]' --json
211
+ docyrus ds create crm contacts --from-file ./contacts-create.csv --json
212
+ docyrus ds update crm contacts <recordId> --from-file ./contact-update.json --json
213
+ ```
214
+
215
+ Array payloads route to bulk endpoints and are limited to 50 items per request.
216
+
217
+ ### Studio Schema CRUD (`studio`)
218
+
219
+ Use `studio` for developer-facing schema operations under `/v1/dev/apps/:app_id/data-sources`.
220
+
221
+ ```bash
222
+ # Data sources
223
+ docyrus studio list-data-sources --appSlug crm --expand fields --json
224
+ docyrus studio get-data-source --appSlug crm --dataSourceSlug contacts --json
225
+ docyrus studio create-data-source --appSlug crm --title "Contacts" --name "contacts" --slug "contacts" --json
226
+ docyrus studio update-data-source --appId <appId> --dataSourceId <dataSourceId> --data '{"title":"Contacts v2"}' --json
227
+ docyrus studio delete-data-source --appId <appId> --dataSourceSlug contacts --json
228
+ docyrus studio bulk-create-data-sources --appId <appId> --from-file ./data-sources.json --json
229
+
230
+ # Fields
231
+ docyrus studio list-fields --appSlug crm --dataSourceSlug contacts --json
232
+ docyrus studio get-field --appSlug crm --dataSourceSlug contacts --fieldSlug email --json
233
+ docyrus studio create-field --appId <appId> --dataSourceId <dataSourceId> --name "Email" --slug "email" --type "text" --json
234
+ docyrus studio update-field --appId <appId> --dataSourceId <dataSourceId> --fieldId <fieldId> --data '{"name":"Primary Email"}' --json
235
+ docyrus studio delete-field --appId <appId> --dataSourceId <dataSourceId> --fieldSlug email --json
236
+ docyrus studio create-fields-batch --appId <appId> --dataSourceId <dataSourceId> --data '[{"name":"Status","slug":"status","type":"text"}]' --json
237
+ docyrus studio update-fields-batch --appId <appId> --dataSourceId <dataSourceId> --from-file ./fields-update.json --json
238
+ docyrus studio delete-fields-batch --appId <appId> --dataSourceId <dataSourceId> --data '["field-1","field-2"]' --json
239
+
240
+ # Enums
241
+ docyrus studio list-enums --appId <appId> --dataSourceId <dataSourceId> --fieldId <fieldId> --json
242
+ docyrus studio create-enums --appId <appId> --dataSourceId <dataSourceId> --fieldId <fieldId> --data '[{"name":"Open","sortOrder":1}]' --json
243
+ docyrus studio update-enums --appId <appId> --dataSourceId <dataSourceId> --fieldId <fieldId> --from-file ./enums-update.json --json
244
+ docyrus studio delete-enums --appId <appId> --dataSourceId <dataSourceId> --fieldId <fieldId> --data '["enum-1","enum-2"]' --json
245
+ ```
246
+
247
+ ### Connectors and Actions (`connect`)
248
+
249
+ Connectors are external integration providers (e.g. Meta WhatsApp, Microsoft Graph, Salesforce). Use the `connect` subcommands to find connectors, inspect their data sources and actions, check connection status, send requests through their auth configuration, and run actions.
250
+
251
+ **Discovery workflow:**
252
+
253
+ ```bash
254
+ # 1. Search for connectors by keyword
255
+ docyrus connect list-connectors --q whatsapp --json
256
+
257
+ # 2. Get connector details (data sources + actions)
258
+ docyrus connect get-connector meta-whatsapp --json
259
+
260
+ # 3. Get full action details with input/output schemas
261
+ docyrus connect get-action meta-whatsapp sendWhatsappMessage --json
262
+
263
+ # 4. Check if tenant/user has active connections
264
+ docyrus connect list-connections meta-whatsapp --json
265
+ ```
266
+
267
+ **Send requests through connector auth (`curl`):**
268
+
269
+ The `connect curl` command sends HTTP requests to external providers using the connector's stored auth credentials (OAuth tokens, API keys, base URL).
270
+
271
+ ```bash
272
+ # GET request with query params
273
+ docyrus connect curl meta-whatsapp \
274
+ "433457363182570/phone_numbers" \
275
+ -d '{"fields":"id,display_phone_number,verified_name"}' --json
276
+
277
+ # POST request (send WhatsApp message)
278
+ docyrus connect curl meta-whatsapp \
279
+ "418088118057836/messages" \
280
+ -X POST \
281
+ -d '{"messaging_product":"whatsapp","to":"905551234567","type":"template","template":{"name":"sample_template","language":{"code":"en_US"}}}' \
282
+ --contentType "application/json" --json
283
+
284
+ # With explicit auth header override
285
+ docyrus connect curl meta-whatsapp \
286
+ "me/businesses" \
287
+ --headers '{"Authorization":"Bearer <token>"}' \
288
+ -d '{"fields":"id,name"}' --json
289
+
290
+ # With connection ID override
291
+ docyrus connect curl meta-whatsapp \
292
+ "some/endpoint" \
293
+ -c <connection-uuid> --json
294
+ ```
295
+
296
+ Aliases: `-X` (method), `-d` (data), `-c` (connectionId).
297
+
298
+ **Run actions:**
299
+
300
+ The `connect run-action` command runs predefined connector or app actions via `POST /v1/apps/:appSlug/actions/:actionKey/run`.
301
+
302
+ ```bash
303
+ # Run an action with parameters
304
+ docyrus connect run-action base sendWhatsappMessage \
305
+ --params '{"to":"905551234567","templateName":"hello_world"}' --json
306
+
307
+ # Dry run — preview request without executing
308
+ docyrus connect run-action base sendWhatsappMessage \
309
+ --params '{"to":"905551234567"}' --dryRun --json
310
+
311
+ # With connection override
312
+ docyrus connect run-action base sendWhatsappMessage \
313
+ -p '{"to":"905551234567"}' -c <connection-uuid> --json
314
+ ```
315
+
316
+ Aliases: `-p` (params), `-c` (connectionId), `-n` (dryRun).
317
+
318
+ ### Arbitrary API Calls
319
+
320
+ ```bash
321
+ docyrus curl /v1/users/me
322
+ docyrus curl /v1/apps -X GET --format json
323
+ docyrus curl /v1/some/endpoint -X POST -d '{"key":"value"}'
324
+ ```
325
+
326
+ ### Terminal UI
327
+
328
+ Launch the OpenTUI interface:
329
+
330
+ ```bash
331
+ docyrus tui
332
+ ```
333
+
334
+ It requires Bun installed locally. The TUI reuses the existing CLI command graph.
335
+
336
+ ## Key Rules
337
+
338
+ - Settings are project-local by default in `./.docyrus/`; use `-g` or `--global` for `~/.docyrus/`
339
+ - The CLI uses named environments, not `API_BASE_URL`
340
+ - `apps list` uses `/v1/apps`
341
+ - `ds` commands use `appSlug` and `dataSourceSlug`
342
+ - `ds create` and `ds update` accept `--data` JSON or `--from-file` (`.json` or `.csv`), but not both
343
+ - Array payloads use bulk endpoints with a maximum of 50 items
344
+ - Bulk update requires `id` in every item and must not include positional `<recordId>`
345
+ - `--filters` accepts a JSON filter group such as `{"combinator":"and","rules":[...]}`
346
+ - Related-field filters use `rel_<relation_slug>/<field_slug>`
347
+ - `--columns` supports relation expansion `()`, spread `...`, aliasing `:`, and functions `@`
348
+ - `--format` supports `toon`, `json`, `yaml`, `md`, and `jsonl`
349
+ - Successful responses inject `context` with `email`, `tenantName`, `tenantNo`, and `tenantDisplay`
350
+ - Studio selectors are exclusive pairs: exactly one of `--appId|--appSlug`, `--dataSourceId|--dataSourceSlug`, and `--fieldId|--fieldSlug` as required
351
+ - Studio write commands accept `--data` or `--from-file` (JSON only), and explicit flags override overlapping JSON keys
352
+ - `connect` subcommands use the `/v1/connectors` API endpoints, not the OpenAPI spec
353
+ - `connect curl` sends requests through the connector's provider auth (OAuth tokens, base URL); the `--headers` option can override the Authorization header
354
+ - `connect curl` data is sent as body for POST/PUT/PATCH and as query params for GET
355
+ - `connect run-action` runs actions via `/v1/apps/:appSlug/actions/:actionKey/run` with `--params` as the JSON body
356
+
357
+ ## References
358
+
359
+ - **[CLI Manifest](references/cli-manifest.md)** — Complete command reference with flags, arguments, and command notes.
360
+ - **[List Query Examples](references/list-query-examples.md)** — Practical `ds list` examples covering columns, filters, sorting, pagination, and combined queries.