@docyrus/docyrus 0.0.68 → 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.
@@ -30,7 +30,6 @@ Mobile-first form → container="drawer" side="bottom"
30
30
  ```
31
31
 
32
32
  **AwesomeDialog** props reference:
33
-
34
33
  - `container`: `'modal'` | `'sheet'` | `'drawer'` — determines the dialog presentation
35
34
  - `side`: `'left'` | `'right'` | `'top'` | `'bottom'` — positioning for sheet/drawer
36
35
  - `size`: `'sm'` | `'default'` | `'lg'` | `'xl'` | `'full'` — size preset
@@ -44,7 +43,6 @@ Mobile-first form → container="drawer" side="bottom"
44
43
  **Sub-components**: `AwesomeDialogHeader`, `AwesomeDialogBody`, `AwesomeDialogFooter`, `AwesomeDialogToolbar`
45
44
 
46
45
  **Example — Small create form (task):**
47
-
48
46
  ```tsx
49
47
  <AwesomeDialog open={open} onOpenChange={setOpen} container="sheet" side="right">
50
48
  <AwesomeDialogHeader title="Create Task" icon="far-plus" />
@@ -57,7 +55,6 @@ Mobile-first form → container="drawer" side="bottom"
57
55
  ```
58
56
 
59
57
  **Example — Large create form (project):**
60
-
61
58
  ```tsx
62
59
  <AwesomeDialog open={open} onOpenChange={setOpen} container="modal" size="lg" fullscreenable>
63
60
  <AwesomeDialogHeader title="Create Project" icon="far-folder-plus" />
@@ -81,7 +78,6 @@ Small items (tasks, contacts, comments) → AwesomeDialog with container="s
81
78
  ```
82
79
 
83
80
  **Decision tree:**
84
-
85
81
  ```
86
82
  Does the item have:
87
83
  - Multiple tabs/sections?
@@ -96,7 +92,6 @@ Does the item have:
96
92
  ```
97
93
 
98
94
  **Example — Task detail in AwesomeDialog:**
99
-
100
95
  ```tsx
101
96
  <AwesomeDialog open={open} onOpenChange={setOpen} container="sheet" side="right" size="lg" fullscreenable>
102
97
  <AwesomeDialogHeader
@@ -122,13 +117,11 @@ Does the item have:
122
117
  **All forms must use** TanStack Form with the Docyrus form field system. Never use plain HTML forms or React Hook Form directly.
123
118
 
124
119
  **Key components:**
125
-
126
120
  - `DynamicFormField` — Auto-dispatches to the correct field type based on `IField.type`
127
121
  - 47+ field types: text, number, email, url, phone, date, dateTime, time, select, multiSelect, status, relation, file, image, code, docEditor, and more
128
122
  - Each field type has a dedicated `*FormField` component (e.g., `TextFormField`, `SelectFormField`, `DateFormField`)
129
123
 
130
124
  **Form field pattern:**
131
-
132
125
  ```tsx
133
126
  import { useForm } from '@tanstack/react-form'
134
127
  import { TextFormField, SelectFormField, DateFormField } from '@docyrus/ui/components/form-fields'
@@ -148,14 +141,12 @@ const form = useForm({ defaultValues: { title: '', status: '', dueDate: '' } })
148
141
  Use `EditableRecordDetail` for detail views where users can edit individual fields inline without opening a full form page. **Always enable `trackChanges`** to highlight changed fields and show a floating ActionBar. Always include an **"Edit All"** button in the header to switch to a full form editing experience.
149
142
 
150
143
  **Key components:**
151
-
152
144
  - `EditableRecordDetail` — Provider/wrapper that manages field state, change tracking, and save/cancel
153
145
  - `EditableRecordDetailField` — Individual field that reads config from context, renders label + inline-editable value
154
146
  - `EditableValue` — Lower-level single-field inline editor (used internally by EditableRecordDetailField)
155
147
  - `useEditableRecordDetail()` — Hook to access form, values, changes, and save/cancel from within the provider
156
148
 
157
149
  **How it works (with `trackChanges` enabled):**
158
-
159
150
  1. Fields render as read-only `DynamicValue` display
160
151
  2. Click a field → switches to `DynamicFormField` editor inline
161
152
  3. Changed fields get highlighted with amber background
@@ -165,7 +156,6 @@ Use `EditableRecordDetail` for detail views where users can edit individual fiel
165
156
  **Important:** Always pass `trackChanges` prop when using `EditableRecordDetail` or `DataGrid` with cell editing. Without it, users have no visual feedback about which fields they've modified and no centralized Save/Cancel flow.
166
157
 
167
158
  **Field change tracking types:**
168
-
169
159
  ```tsx
170
160
  interface RecordDetailField {
171
161
  field: IField // Field configuration (name, slug, type)
@@ -184,7 +174,6 @@ interface FieldChange {
184
174
  ```
185
175
 
186
176
  **Example — Detail view with inline editing and "Edit All" button:**
187
-
188
177
  ```tsx
189
178
  <AwesomeDialogHeader
190
179
  title="Task Detail"
@@ -379,11 +368,9 @@ When using **Data Grid View Select**, back its `views`, `onViewCreate`, `onViewS
379
368
  ## Library-Specific Strengths
380
369
 
381
370
  ### shadcn (43 components)
382
-
383
371
  **Best for**: Core UI primitives, forms, basic layout
384
372
 
385
373
  **Strengths**:
386
-
387
374
  - Well-tested, accessible components
388
375
  - Great documentation
389
376
  - Broad browser support
@@ -392,11 +379,9 @@ When using **Data Grid View Select**, back its `views`, `onViewCreate`, `onViewS
392
379
  **Use when**: You need a standard, reliable component without special features
393
380
 
394
381
  ### diceui (42 components)
395
-
396
382
  **Best for**: Advanced interactions, specialized data components
397
383
 
398
384
  **Strengths**:
399
-
400
385
  - Rich feature sets (filtering, sorting, virtualization)
401
386
  - Advanced input types (phone, color, mask)
402
387
  - Drag-drop capabilities
@@ -405,11 +390,9 @@ When using **Data Grid View Select**, back its `views`, `onViewCreate`, `onViewS
405
390
  **Use when**: You need advanced functionality beyond basic components
406
391
 
407
392
  ### animate-ui (21 components)
408
-
409
393
  **Best for**: Animated transitions, polished UX
410
394
 
411
395
  **Strengths**:
412
-
413
396
  - Smooth, professional animations
414
397
  - Enhanced visual feedback
415
398
  - Composable animated patterns
@@ -417,11 +400,9 @@ When using **Data Grid View Select**, back its `views`, `onViewCreate`, `onViewS
417
400
  **Use when**: Animation/transitions are important to the UX
418
401
 
419
402
  ### docyrus (51 components)
420
-
421
403
  **Best for**: Docyrus-specific data handling, forms, dialogs, inline editing, scheduling, chat, AI agents, and business logic
422
404
 
423
405
  **Strengths**:
424
-
425
406
  - Deep Docyrus platform integration
426
407
  - AwesomeDialog system for item creation and detail views
427
408
  - EditableRecordDetail for inline field editing with change tracking
@@ -438,11 +419,9 @@ When using **Data Grid View Select**, back its `views`, `onViewCreate`, `onViewS
438
419
  **Use when**: Working with Docyrus data sources, building item create/detail flows, forms, scheduling, chat, AI features, or queries
439
420
 
440
421
  ### reui (2 components)
441
-
442
422
  **Best for**: Specific utility needs
443
423
 
444
424
  **Strengths**:
445
-
446
425
  - Focused implementations
447
426
  - Lightweight alternatives
448
427
 
@@ -487,29 +466,25 @@ These are the **recommended defaults** unless the user specifies otherwise:
487
466
 
488
467
  ## When to Use Each Library
489
468
 
490
- ### Use shadcn when
491
-
469
+ ### Use shadcn when:
492
470
  - Building basic forms with standard inputs
493
471
  - Creating simple layouts with cards, buttons, badges
494
472
  - Need reliable, accessible primitives
495
473
  - No special animation or advanced features required
496
474
 
497
- ### Use diceui when
498
-
475
+ ### Use diceui when:
499
476
  - Building complex data tables with sorting/filtering
500
477
  - Need advanced input types (phone, color, tags)
501
478
  - Implementing drag-drop (kanban, sortable lists)
502
479
  - Creating rich data visualizations (gauges, timelines)
503
480
 
504
- ### Use animate-ui when
505
-
481
+ ### Use animate-ui when:
506
482
  - Animation/transitions are important to the design
507
483
  - Building navigation with smooth interactions
508
484
  - Creating polished dialog/overlay experiences
509
485
  - Need animated feedback for user actions
510
486
 
511
- ### Use docyrus when
512
-
487
+ ### Use docyrus when:
513
488
  - Building item create forms (AwesomeDialog, Create Record Dialog)
514
489
  - Building item detail views (AwesomeDialog + EditableRecordDetail)
515
490
  - Working directly with Docyrus data sources
@@ -524,8 +499,7 @@ These are the **recommended defaults** unless the user specifies otherwise:
524
499
  - Need rich item selectors (Mega Select, Kanban)
525
500
  - Need Docyrus-specific components (query builder, activity panel, notifications)
526
501
 
527
- ### Use reui when
528
-
502
+ ### Use reui when:
529
503
  - The specific component (file upload or sortable) matches your exact need
530
504
  - Want a lightweight alternative to diceui versions
531
505
 
@@ -550,7 +524,6 @@ These are the **recommended defaults** unless the user specifies otherwise:
550
524
  - Use for: Fallback when neither hugeicons nor fontawesome have the icon
551
525
 
552
526
  **Example**:
553
-
554
527
  ```tsx
555
528
  import { HugeIconDollarCircle } from '@/components/icons/hugeicons'
556
529
  import { FaLightChartLine } from '@/components/icons/fontawesome'
@@ -571,7 +544,6 @@ import { LucideActivity } from 'lucide-react'
571
544
  ## Quick Reference: Component Categories
572
545
 
573
546
  ### Dialogs & Item Flows
574
-
575
547
  - Item create forms: **docyrus AwesomeDialog** (sheet for small, modal for large)
576
548
  - Quick record create: **docyrus Create Record Dialog** (popover with subject/mentions)
577
549
  - Item detail (small): **docyrus AwesomeDialog** (sheet right)
@@ -581,7 +553,6 @@ import { LucideActivity } from 'lucide-react'
581
553
  - Responsive: diceui Responsive Dialog
582
554
 
583
555
  ### Data & Display
584
-
585
556
  - Tables: docyrus Data Grid, diceui Data Table, shadcn Table
586
557
  - Pivot table: docyrus PivotGrid (hierarchies, subtotals, drilldown, export)
587
558
  - Grid saved views: docyrus Data Grid View Select + `DataViews` from `@docyrus/app-utils`
@@ -593,7 +564,6 @@ import { LucideActivity } from 'lucide-react'
593
564
  - Tree: docyrus TreeView
594
565
 
595
566
  ### Forms & Input
596
-
597
567
  - Dynamic forms: **docyrus Form Fields + TanStack Form** (always use)
598
568
  - Inline editing: docyrus EditableRecordDetail, EditableValue
599
569
  - Text: shadcn Input, Textarea
@@ -606,20 +576,17 @@ import { LucideActivity } from 'lucide-react'
606
576
  - Special: diceui Phone Input, Color Picker, Tags Input
607
577
 
608
578
  ### Navigation
609
-
610
579
  - Sidebar: animate-ui Sidebar
611
580
  - Menus: animate-ui Dropdown Menu, shadcn Menubar
612
581
  - Breadcrumbs: shadcn Breadcrumb
613
582
  - Tabs: animate-ui Tabs
614
583
 
615
584
  ### Overlays
616
-
617
585
  - Item forms/details: **docyrus AwesomeDialog** (preferred)
618
586
  - Popovers: animate-ui Popover, Tooltip, Hover Card
619
587
  - Drawers: shadcn Drawer, animate-ui Sheet
620
588
 
621
589
  ### Communication
622
-
623
590
  - Team chat: docyrus Team Chat Channel (threads, reactions, mentions)
624
591
  - Email composing: docyrus Email Composer (To/Cc/Bcc, toolbar, attachments)
625
592
  - Comments: docyrus Comments Panel (threaded conversations)
@@ -627,25 +594,21 @@ import { LucideActivity } from 'lucide-react'
627
594
  - Activity logging: docyrus Log Activity Form (calls, emails, meetings, tasks, statuses)
628
595
 
629
596
  ### Scheduling
630
-
631
597
  - Project timelines: docyrus Gantt
632
598
  - Resource scheduling: docyrus Resource Scheduler Panel (horizontal timeline)
633
599
  - Appointment booking: docyrus Time Slot Scheduler (columns/month views)
634
600
  - Calendar events: docyrus Calendar (month/week/day views)
635
601
 
636
602
  ### AI & Agents
637
-
638
603
  - AI chat: docyrus Docyrus Agent (chat mode)
639
604
  - AI actions: docyrus Docyrus Agent (action-panel mode)
640
605
  - AI trigger: docyrus Docyrus Agent (floating trigger button)
641
606
 
642
607
  ### Business Logic
643
-
644
608
  - Pricing/quoting: docyrus Pricing Engine Panel (line items, VAT, discounts)
645
609
  - Record sharing: docyrus Record Sharing (permissions, users/teams/roles)
646
610
 
647
611
  ### Specialized
648
-
649
612
  - Kanban: docyrus Kanban (drag-drop columns)
650
613
  - Timeline: diceui Timeline
651
614
  - Stepper / wizard: docyrus Stepper (6 variants, horizontal/vertical, animated)
@@ -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.