@docyrus/docyrus 0.0.15 → 0.0.17

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 (41) hide show
  1. package/README.md +25 -2
  2. package/main.js +1028 -540
  3. package/main.js.map +4 -4
  4. package/package.json +2 -1
  5. package/resources/pi-agent/prompts/agent-system.md +25 -0
  6. package/resources/pi-agent/prompts/coder-append-system.md +19 -0
  7. package/resources/pi-agent/skills/docyrus-ai/SKILL.md +28 -0
  8. package/resources/pi-agent/skills/docyrus-api-dev/SKILL.md +161 -0
  9. package/resources/pi-agent/skills/docyrus-api-dev/references/api-client.md +349 -0
  10. package/resources/pi-agent/skills/docyrus-api-dev/references/authentication.md +238 -0
  11. package/resources/pi-agent/skills/docyrus-api-dev/references/data-source-query-guide.md +2059 -0
  12. package/resources/pi-agent/skills/docyrus-api-dev/references/formula-design-guide-llm.md +320 -0
  13. package/resources/pi-agent/skills/docyrus-api-dev/references/query-and-formulas.md +592 -0
  14. package/resources/pi-agent/skills/docyrus-api-doctor/SKILL.md +70 -0
  15. package/resources/pi-agent/skills/docyrus-api-doctor/references/checklist-details.md +588 -0
  16. package/resources/pi-agent/skills/docyrus-app-dev/SKILL.md +159 -0
  17. package/resources/pi-agent/skills/docyrus-app-dev/references/api-client-and-auth.md +275 -0
  18. package/resources/pi-agent/skills/docyrus-app-dev/references/collections-and-patterns.md +352 -0
  19. package/resources/pi-agent/skills/docyrus-app-dev/references/data-source-query-guide.md +2059 -0
  20. package/resources/pi-agent/skills/docyrus-app-dev/references/formula-design-guide-llm.md +320 -0
  21. package/resources/pi-agent/skills/docyrus-app-dev/references/query-guide.md +525 -0
  22. package/resources/pi-agent/skills/docyrus-app-ui-design/SKILL.md +466 -0
  23. package/resources/pi-agent/skills/docyrus-app-ui-design/references/component-selection-guide.md +602 -0
  24. package/resources/pi-agent/skills/docyrus-app-ui-design/references/icon-usage-guide.md +463 -0
  25. package/resources/pi-agent/skills/docyrus-app-ui-design/references/preferred-components-catalog.md +242 -0
  26. package/resources/pi-agent/skills/docyrus-apps/SKILL.md +54 -0
  27. package/resources/pi-agent/skills/docyrus-architect/SKILL.md +174 -0
  28. package/resources/pi-agent/skills/docyrus-architect/references/custom-query-guide.md +410 -0
  29. package/resources/pi-agent/skills/docyrus-architect/references/data-source-query-guide.md +2059 -0
  30. package/resources/pi-agent/skills/docyrus-architect/references/formula-design-guide-llm.md +320 -0
  31. package/resources/pi-agent/skills/docyrus-architect/references/formula-reference.md +145 -0
  32. package/resources/pi-agent/skills/docyrus-auth/SKILL.md +100 -0
  33. package/resources/pi-agent/skills/docyrus-cli-app/SKILL.md +279 -0
  34. package/resources/pi-agent/skills/docyrus-cli-app/references/cli-manifest.md +532 -0
  35. package/resources/pi-agent/skills/docyrus-cli-app/references/list-query-examples.md +248 -0
  36. package/resources/pi-agent/skills/docyrus-curl/SKILL.md +32 -0
  37. package/resources/pi-agent/skills/docyrus-discover/SKILL.md +63 -0
  38. package/resources/pi-agent/skills/docyrus-ds/SKILL.md +95 -0
  39. package/resources/pi-agent/skills/docyrus-env/SKILL.md +21 -0
  40. package/resources/pi-agent/skills/docyrus-studio/SKILL.md +369 -0
  41. package/resources/pi-agent/skills/docyrus-tui/SKILL.md +15 -0
@@ -0,0 +1,532 @@
1
+ # Docyrus CLI Manifest
2
+
3
+ LLM-ready reference for the `docyrus` CLI tool.
4
+
5
+ ---
6
+
7
+ ## Global Options
8
+
9
+ | Flag | Type | Description |
10
+ |------|------|-------------|
11
+ | `-g`, `--global` | boolean | Force global `~/.docyrus/` settings instead of local `./.docyrus/` |
12
+ | `--format <toon\|json\|yaml\|md\|jsonl>` | string | Output format |
13
+ | `--help` | boolean | Show help |
14
+ | `--llms` | boolean | Print LLM-readable manifest |
15
+ | `--mcp` | boolean | Start as MCP stdio server |
16
+ | `--verbose` | boolean | Show full output envelope |
17
+ | `--version` | boolean | Show version |
18
+
19
+ ## Environment Variables
20
+
21
+ | Name | Description |
22
+ |------|-------------|
23
+ | `DOCYRUS_API_CLIENT_ID` | Default Docyrus OAuth2 client id |
24
+
25
+ ## Settings Scope
26
+
27
+ - Default scope is local: `./.docyrus/`
28
+ - Use `-g` or `--global` to force global scope: `~/.docyrus/`
29
+ - OpenAPI cache path is `<settings-root>/tenans/<tenantId>/openapi.json`
30
+ - `docyrus` without a subcommand returns active environment, help commands, and auth `context`
31
+
32
+ ---
33
+
34
+ ## docyrus env
35
+
36
+ Environment commands.
37
+
38
+ ### docyrus env list
39
+
40
+ List available environments.
41
+
42
+ ### docyrus env use
43
+
44
+ Switch active environment by id or name.
45
+
46
+ ```
47
+ docyrus env use <selector>
48
+ ```
49
+
50
+ | Argument | Type | Required | Description |
51
+ |----------|------|----------|-------------|
52
+ | `selector` | string | yes | Environment id or name (`live`, `prod`, `beta`, `alpha`, `dev`) |
53
+
54
+ Built-in environments:
55
+ - `live` -> `https://api.docyrus.com`
56
+ - `beta` -> `https://beta-api.docyrus.com`
57
+ - `alpha` -> `https://alpha-api.docyrus.com`
58
+ - `dev` -> `https://localhost:3366`
59
+
60
+ ---
61
+
62
+ ## docyrus apps
63
+
64
+ App commands.
65
+
66
+ ### docyrus apps list
67
+
68
+ List apps (`/v1/apps`).
69
+
70
+ | Flag | Type | Description |
71
+ |------|------|-------------|
72
+ | `--appType` | string | Optional app type filter |
73
+
74
+ ---
75
+
76
+ ## docyrus auth
77
+
78
+ Authentication commands.
79
+
80
+ ### docyrus auth login
81
+
82
+ Authorize CLI using OAuth2 device flow, or provide tokens manually.
83
+
84
+ | Flag | Type | Description |
85
+ |------|------|-------------|
86
+ | `--clientId` | string | OAuth2 client id |
87
+ | `--scope` | string | OAuth2 scopes (default: `openid email profile offline_access ReadWrite.All User.ReadWrite Users.Read.All Tenant.Read Teams.Read.All DS.ReadWrite.All Docs.ReadWrite.All Architect.ReadWrite.All`) |
88
+ | `--accessToken` | string | Manual access token; skips device flow |
89
+ | `--refreshToken` | string | Manual refresh token; requires `--accessToken` |
90
+
91
+ Login notes:
92
+ - Resolution order for client ID is `--clientId` -> `DOCYRUS_API_CLIENT_ID` -> saved local config -> saved global config
93
+ - Manual token login falls back to `manual-token` only when no client ID can be resolved
94
+ - Local login can reuse the globally saved client ID when local config does not have one
95
+
96
+ ### docyrus auth logout
97
+
98
+ Revoke and clear all tenant sessions for the active account in the current environment.
99
+
100
+ ### docyrus auth who
101
+
102
+ Return the current authenticated user (`/v1/users/me`).
103
+
104
+ ### docyrus auth accounts list
105
+
106
+ List saved user accounts for the current API base URL.
107
+
108
+ ### docyrus auth accounts use
109
+
110
+ Switch active account by user ID.
111
+
112
+ | Flag | Type | Description |
113
+ |------|------|-------------|
114
+ | `--userId` | string | User ID to activate |
115
+
116
+ ### docyrus auth tenants list
117
+
118
+ List available tenants for an account.
119
+
120
+ | Flag | Type | Description |
121
+ |------|------|-------------|
122
+ | `--userId` | string | User ID; defaults to active account |
123
+
124
+ ### docyrus auth tenants use
125
+
126
+ Switch active tenant for an account.
127
+
128
+ ```
129
+ docyrus auth tenants use <tenantSelector> [options]
130
+ ```
131
+
132
+ | Argument | Type | Required | Description |
133
+ |----------|------|----------|-------------|
134
+ | `tenantSelector` | string | yes | Numeric tenant no or UUID tenant id |
135
+
136
+ | Flag | Type | Description |
137
+ |------|------|-------------|
138
+ | `--userId` | string | User ID; defaults to active account |
139
+ | `--scope` | string | Scope used only when tenant bootstrap login is required |
140
+
141
+ Selector rules:
142
+ - numeric selector -> match by `tenantNo`
143
+ - non-numeric selector must be a UUID tenant id
144
+
145
+ ---
146
+
147
+ ## docyrus curl
148
+
149
+ Send arbitrary requests to Docyrus API.
150
+
151
+ ```
152
+ docyrus curl <path> [options]
153
+ ```
154
+
155
+ | Argument | Type | Required | Description |
156
+ |----------|------|----------|-------------|
157
+ | `path` | string | yes | API path (no absolute URL) |
158
+
159
+ | Flag | Alias | Type | Description |
160
+ |------|-------|------|-------------|
161
+ | `--request` | `-X` | string | HTTP method |
162
+ | `--header` | `-H` | array | Request header (repeatable) |
163
+ | `--data` | `-d` | string | Request payload |
164
+ | `--get` | `-G` | boolean | Send data as query string |
165
+ | `--include` | `-i` | boolean | Include status and response headers |
166
+ | `--noAuth` | | boolean | Skip Authorization header |
167
+
168
+ ---
169
+
170
+ ## docyrus discover
171
+
172
+ Discovery commands for exploring the tenant OpenAPI spec. All discover commands require an active login session. Commands other than `discover api` auto-download the spec if it does not exist locally.
173
+
174
+ ### docyrus discover api
175
+
176
+ Download tenant OpenAPI spec for the active tenant.
177
+
178
+ ### docyrus discover namespaces
179
+
180
+ List API namespaces from the active tenant OpenAPI spec. Returns deduplicated namespace prefixes such as `/v1/users` and `/v1/apps`.
181
+
182
+ ### docyrus discover path
183
+
184
+ List endpoints with method and description for a matching path prefix.
185
+
186
+ ```
187
+ docyrus discover path <prefix>
188
+ ```
189
+
190
+ | Argument | Type | Required | Description |
191
+ |----------|------|----------|-------------|
192
+ | `prefix` | string | yes | Path prefix, for example `/v1/users` (the `/v1` prefix is optional) |
193
+
194
+ ### docyrus discover endpoint
195
+
196
+ Return the full OpenAPI endpoint object for a path and HTTP method.
197
+
198
+ ```
199
+ docyrus discover endpoint <selector>
200
+ ```
201
+
202
+ | Argument | Type | Required | Description |
203
+ |----------|------|----------|-------------|
204
+ | `selector` | string | yes | Endpoint selector such as `/v1/users/me` or `[PUT]/v1/users/me/photo` |
205
+
206
+ Selector format: `/path` defaults to GET; `[METHOD]/path` specifies an explicit HTTP method. The `/v1` prefix is optional.
207
+
208
+ ### docyrus discover entity
209
+
210
+ Return the full schema definition object for an entity by name.
211
+
212
+ ```
213
+ docyrus discover entity <name>
214
+ ```
215
+
216
+ | Argument | Type | Required | Description |
217
+ |----------|------|----------|-------------|
218
+ | `name` | string | yes | Entity name (case-sensitive), for example `UserEntity` |
219
+
220
+ ### docyrus discover search
221
+
222
+ Search endpoint paths and entity names by comma-separated terms.
223
+
224
+ ```
225
+ docyrus discover search <query>
226
+ ```
227
+
228
+ | Argument | Type | Required | Description |
229
+ |----------|------|----------|-------------|
230
+ | `query` | string | yes | One or more comma-separated search strings, for example `users,UserEntity` |
231
+
232
+ Endpoint results include method and description when available.
233
+
234
+ ---
235
+
236
+ ## docyrus ds
237
+
238
+ Data source commands for CRUD operations on records.
239
+
240
+ ### docyrus ds get
241
+
242
+ Get data source metadata (fields, types, relations).
243
+
244
+ ```
245
+ docyrus ds get <appSlug> <dataSourceSlug>
246
+ ```
247
+
248
+ ### docyrus ds list
249
+
250
+ List data source items with optional filtering, sorting, and pagination.
251
+
252
+ ```
253
+ docyrus ds list <appSlug> <dataSourceSlug> [options]
254
+ ```
255
+
256
+ | Flag | Type | Description |
257
+ |------|------|-------------|
258
+ | `--columns` | string | Comma-separated field slugs to select |
259
+ | `--filters` | string | JSON filter object |
260
+ | `--limit` | number | Max records to return |
261
+ | `--offset` | number | Skip N records |
262
+ | `--orderBy` | string | Sort expression |
263
+ | `--fullCount` | boolean | Include total count in response |
264
+
265
+ ### docyrus ds create
266
+
267
+ Create data source item(s). If payload is an array, CLI sends a bulk request to `POST /apps/:appSlug/data-sources/:dataSourceSlug/items/bulk`.
268
+
269
+ ```
270
+ docyrus ds create <appSlug> <dataSourceSlug> [options]
271
+ ```
272
+
273
+ | Flag | Type | Description |
274
+ |------|------|-------------|
275
+ | `--data` | string | JSON payload for record fields |
276
+ | `--from-file` | string | Path to `.json` or `.csv` payload file |
277
+
278
+ Batch rules:
279
+ - array payload triggers bulk create endpoint
280
+ - maximum 50 items per batch
281
+
282
+ ### docyrus ds update
283
+
284
+ Update data source item(s). If payload is an array, CLI sends a bulk request to `PATCH /apps/:appSlug/data-sources/:dataSourceSlug/items/bulk`.
285
+
286
+ ```
287
+ docyrus ds update <appSlug> <dataSourceSlug> [recordId] [options]
288
+ ```
289
+
290
+ | Flag | Type | Description |
291
+ |------|------|-------------|
292
+ | `--data` | string | JSON payload for record fields |
293
+ | `--from-file` | string | Path to `.json` or `.csv` payload file |
294
+
295
+ Update rules:
296
+ - object payload uses the single-item endpoint and requires `recordId`
297
+ - array payload uses the bulk update endpoint and requires `id` in each item
298
+ - do not provide positional `recordId` for batch update
299
+ - maximum 50 items per batch
300
+
301
+ ### docyrus ds delete
302
+
303
+ Delete a data source item.
304
+
305
+ ```
306
+ docyrus ds delete <appSlug> <dataSourceSlug> <recordId>
307
+ ```
308
+
309
+ Successful command responses include a top-level `context` object with:
310
+ - `email`
311
+ - `tenantName`
312
+ - `tenantNo`
313
+ - `tenantDisplay`
314
+
315
+ ---
316
+
317
+ ## docyrus studio
318
+
319
+ Dev app data source schema CRUD commands under `/v1/dev/apps/:app_id/data-sources`.
320
+
321
+ Selector rules:
322
+ - app selector: exactly one of `--appId` or `--appSlug`
323
+ - data source selector: exactly one of `--dataSourceId` or `--dataSourceSlug` when required
324
+ - field selector: exactly one of `--fieldId` or `--fieldSlug` when required
325
+
326
+ Write payload rules:
327
+ - use `--data '<json>'` or `--from-file ./payload.json` (JSON only), not both
328
+ - flags override conflicting keys from JSON payload
329
+ - batch commands accept either a root array or a root object containing the expected DTO key
330
+
331
+ ### Data source commands
332
+
333
+ #### docyrus studio list-data-sources
334
+
335
+ `GET /dev/apps/:app_id/data-sources`
336
+
337
+ | Flag | Type | Description |
338
+ |------|------|-------------|
339
+ | `--appId` | string | App ID |
340
+ | `--appSlug` | string | App slug |
341
+ | `--expand` | string | Optional comma-separated expansions such as `fields` |
342
+
343
+ #### docyrus studio get-data-source
344
+
345
+ `GET /dev/apps/:app_id/data-sources/:id`
346
+
347
+ | Flag | Type | Description |
348
+ |------|------|-------------|
349
+ | `--appId` | string | App ID |
350
+ | `--appSlug` | string | App slug |
351
+ | `--dataSourceId` | string | Data source ID |
352
+ | `--dataSourceSlug` | string | Data source slug |
353
+
354
+ #### docyrus studio create-data-source
355
+
356
+ `POST /dev/apps/:app_id/data-sources`
357
+
358
+ | Flag | Type | Description |
359
+ |------|------|-------------|
360
+ | `--appId` | string | App ID |
361
+ | `--appSlug` | string | App slug |
362
+ | `--data` | string | JSON payload |
363
+ | `--from-file` | string | Path to JSON payload file |
364
+ | `--title` | string | Data source title |
365
+ | `--name` | string | Data source name |
366
+ | `--slug` | string | Data source slug |
367
+ | `--type` | string | Data source type |
368
+ | `--icon` | string | Icon |
369
+ | `--dataSharing` | string | Data sharing value |
370
+ | `--meta` | string | JSON meta payload |
371
+
372
+ #### docyrus studio update-data-source
373
+
374
+ `PATCH /dev/apps/:app_id/data-sources/:id`
375
+
376
+ Same flags as `create-data-source`, plus selector flags:
377
+
378
+ | Flag | Type | Description |
379
+ |------|------|-------------|
380
+ | `--dataSourceId` | string | Data source ID |
381
+ | `--dataSourceSlug` | string | Data source slug |
382
+
383
+ #### docyrus studio delete-data-source
384
+
385
+ `DELETE /dev/apps/:app_id/data-sources/:id`
386
+
387
+ | Flag | Type | Description |
388
+ |------|------|-------------|
389
+ | `--appId` | string | App ID |
390
+ | `--appSlug` | string | App slug |
391
+ | `--dataSourceId` | string | Data source ID |
392
+ | `--dataSourceSlug` | string | Data source slug |
393
+
394
+ #### docyrus studio bulk-create-data-sources
395
+
396
+ `POST /dev/apps/:app_id/data-sources/bulk`
397
+
398
+ Expected DTO key: `dataSources`
399
+
400
+ | Flag | Type | Description |
401
+ |------|------|-------------|
402
+ | `--appId` | string | App ID |
403
+ | `--appSlug` | string | App slug |
404
+ | `--data` | string | JSON payload |
405
+ | `--from-file` | string | Path to JSON payload file |
406
+
407
+ ### Field commands
408
+
409
+ #### docyrus studio list-fields
410
+
411
+ `GET /dev/apps/:app_id/data-sources/:data_source_id/fields`
412
+
413
+ | Flag | Type | Description |
414
+ |------|------|-------------|
415
+ | `--appId` | string | App ID |
416
+ | `--appSlug` | string | App slug |
417
+ | `--dataSourceId` | string | Data source ID |
418
+ | `--dataSourceSlug` | string | Data source slug |
419
+
420
+ #### docyrus studio get-field
421
+
422
+ `GET /dev/apps/:app_id/data-sources/:data_source_id/fields/:field_id`
423
+
424
+ | Flag | Type | Description |
425
+ |------|------|-------------|
426
+ | `--appId` | string | App ID |
427
+ | `--appSlug` | string | App slug |
428
+ | `--dataSourceId` | string | Data source ID |
429
+ | `--dataSourceSlug` | string | Data source slug |
430
+ | `--fieldId` | string | Field ID |
431
+ | `--fieldSlug` | string | Field slug |
432
+
433
+ #### docyrus studio create-field
434
+
435
+ `POST /dev/apps/:app_id/data-sources/:data_source_id/fields`
436
+
437
+ | Flag | Type | Description |
438
+ |------|------|-------------|
439
+ | `--appId` | string | App ID |
440
+ | `--appSlug` | string | App slug |
441
+ | `--dataSourceId` | string | Data source ID |
442
+ | `--dataSourceSlug` | string | Data source slug |
443
+ | `--data` | string | JSON payload |
444
+ | `--from-file` | string | Path to JSON payload file |
445
+ | `--name` | string | Field name |
446
+ | `--slug` | string | Field slug |
447
+ | `--type` | string | Field type |
448
+ | `--readOnly` | boolean | Read-only flag |
449
+ | `--status` | string | Field status |
450
+ | `--defaultValue` | string | Default value |
451
+ | `--relationDataSourceId` | string | Related data source ID |
452
+ | `--sortOrder` | number | Sort order |
453
+ | `--tenantEnumSetId` | string | Tenant enum set ID |
454
+ | `--options` | string | JSON options payload |
455
+ | `--validations` | string | JSON validations payload |
456
+
457
+ #### docyrus studio update-field
458
+
459
+ `PATCH /dev/apps/:app_id/data-sources/:data_source_id/fields/:field_id`
460
+
461
+ Same flags as `create-field`, plus selector flags:
462
+
463
+ | Flag | Type | Description |
464
+ |------|------|-------------|
465
+ | `--fieldId` | string | Field ID |
466
+ | `--fieldSlug` | string | Field slug |
467
+
468
+ #### docyrus studio delete-field
469
+
470
+ `DELETE /dev/apps/:app_id/data-sources/:data_source_id/fields/:field_id`
471
+
472
+ | Flag | Type | Description |
473
+ |------|------|-------------|
474
+ | `--appId` | string | App ID |
475
+ | `--appSlug` | string | App slug |
476
+ | `--dataSourceId` | string | Data source ID |
477
+ | `--dataSourceSlug` | string | Data source slug |
478
+ | `--fieldId` | string | Field ID |
479
+ | `--fieldSlug` | string | Field slug |
480
+
481
+ #### docyrus studio create-fields-batch
482
+
483
+ `POST /dev/apps/:app_id/data-sources/:data_source_id/fields/batch`
484
+
485
+ Expected DTO key: `fields`
486
+
487
+ #### docyrus studio update-fields-batch
488
+
489
+ `PATCH /dev/apps/:app_id/data-sources/:data_source_id/fields/batch`
490
+
491
+ Expected DTO key: `fields`
492
+
493
+ #### docyrus studio delete-fields-batch
494
+
495
+ `DELETE /dev/apps/:app_id/data-sources/:data_source_id/fields/batch`
496
+
497
+ Expected DTO key: `fieldIds`
498
+
499
+ ### Enum commands
500
+
501
+ #### docyrus studio list-enums
502
+
503
+ `GET /dev/apps/:app_id/data-sources/:data_source_id/fields/:field_id/enums`
504
+
505
+ #### docyrus studio create-enums
506
+
507
+ `POST /dev/apps/:app_id/data-sources/:data_source_id/fields/:field_id/enums`
508
+
509
+ Expected DTO key: `enums`
510
+
511
+ #### docyrus studio update-enums
512
+
513
+ `PATCH /dev/apps/:app_id/data-sources/:data_source_id/fields/:field_id/enums`
514
+
515
+ Expected DTO key: `enums`
516
+
517
+ #### docyrus studio delete-enums
518
+
519
+ `DELETE /dev/apps/:app_id/data-sources/:data_source_id/fields/:field_id/enums`
520
+
521
+ Expected DTO key: `enumIds`
522
+
523
+ ---
524
+
525
+ ## docyrus tui
526
+
527
+ Launch the OpenTUI terminal UI.
528
+
529
+ Notes:
530
+ - requires Bun installed locally
531
+ - reuses the existing CLI command graph
532
+ - intended for interactive terminal usage rather than browser embedding