@dboio/cli 0.6.13 → 0.7.2
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/README.md +201 -4
- package/package.json +1 -1
- package/src/commands/clone.js +664 -27
- package/src/commands/content.js +1 -1
- package/src/commands/deploy.js +1 -1
- package/src/commands/init.js +67 -3
- package/src/commands/login.js +4 -9
- package/src/commands/output.js +56 -3
- package/src/commands/pull.js +3 -3
- package/src/commands/push.js +9 -9
- package/src/commands/status.js +0 -1
- package/src/lib/config.js +74 -8
- package/src/lib/diff.js +5 -1
- package/src/lib/domain-guard.js +95 -0
- package/src/lib/input-parser.js +87 -38
- package/src/lib/scaffold.js +62 -0
- package/src/lib/structure.js +16 -0
package/README.md
CHANGED
|
@@ -158,6 +158,7 @@ All configuration is **directory-scoped**. Each project folder maintains its own
|
|
|
158
158
|
| `AppShortName` | string | App short name (used for `dbo clone --app`) |
|
|
159
159
|
| `AppModifyKey` | string | ModifyKey for locked/production apps (set by `dbo clone`, used for submission guards) |
|
|
160
160
|
| `TransactionKeyPreset` | `RowUID` \| `RowID` | Row key type for auto-assembled expressions (set during `dbo init`/`dbo clone`, default `RowUID`) |
|
|
161
|
+
| `TicketSuggestionOutput` | string | Output UID for fetching ticket suggestions during error recovery (set during `dbo init`, default `ojaie9t3o0kfvliahnuuda`) |
|
|
161
162
|
| `ContentPlacement` | `bin` \| `path` \| `ask` | Where to place content files during clone |
|
|
162
163
|
| `MediaPlacement` | `bin` \| `fullpath` \| `ask` | Where to place media files during clone |
|
|
163
164
|
| `<Entity>FilenameCol` | column name | Filename column for entity-dir records (e.g., `ExtensionFilenameCol`) |
|
|
@@ -169,6 +170,10 @@ All configuration is **directory-scoped**. Each project folder maintains its own
|
|
|
169
170
|
|
|
170
171
|
These are set interactively on first clone and saved for future use. Pre-set them in `config.json` to skip the prompt entirely.
|
|
171
172
|
|
|
173
|
+
#### `app.json._domain`
|
|
174
|
+
|
|
175
|
+
The `_domain` field in `app.json` stores the project's reference domain (set during `dbo clone`). This is committed to git and used for domain-change detection when running `dbo init --force` or `dbo clone --domain`. It provides a stable cross-user baseline — all collaborators share the same reference domain.
|
|
176
|
+
|
|
172
177
|
### Legacy migration
|
|
173
178
|
|
|
174
179
|
If your project uses the older `.domain`, `.username`, `.password`, `.cookies` files, `dbo init` will detect them and offer to migrate automatically.
|
|
@@ -196,17 +201,20 @@ dbo init --domain my-domain.com --username me@co.io # with credentials
|
|
|
196
201
|
dbo init --force # overwrite existing config
|
|
197
202
|
dbo init --domain my-domain.com --app myapp --clone # init + clone an app
|
|
198
203
|
dbo init --domain my-domain.com -y # skip all prompts
|
|
204
|
+
dbo init --scaffold # scaffold dirs (prompts for domain)
|
|
205
|
+
dbo init --scaffold --yes # scaffold dirs non-interactively
|
|
199
206
|
```
|
|
200
207
|
|
|
201
208
|
| Flag | Description |
|
|
202
209
|
|------|-------------|
|
|
203
210
|
| `--domain <host>` | DBO instance domain |
|
|
204
211
|
| `--username <user>` | DBO username (stored for login default) |
|
|
205
|
-
| `--force` | Overwrite existing configuration |
|
|
212
|
+
| `--force` | Overwrite existing configuration. Triggers a domain-change confirmation prompt when the new domain differs from the project reference domain |
|
|
206
213
|
| `--app <shortName>` | App short name (triggers clone after init) |
|
|
207
214
|
| `--clone` | Clone the app after initialization |
|
|
208
215
|
| `-g, --global` | Install Claude commands globally (`~/.claude/commands/`) |
|
|
209
216
|
| `--local` | Install Claude commands to project (`.claude/commands/`) |
|
|
217
|
+
| `--scaffold` | Pre-create standard project directories (`App Versions`, `Automations`, `Bins`, `Data Sources`, `Documentation`, `Extensions`, `Groups`, `Integrations`, `Sites`) |
|
|
210
218
|
| `-y, --yes` | Skip all interactive prompts (legacy migration, Claude Code setup) |
|
|
211
219
|
| `--non-interactive` | Alias for `--yes` |
|
|
212
220
|
|
|
@@ -234,10 +242,16 @@ dbo init --domain my-domain.com --app myapp --clone
|
|
|
234
242
|
|------|-------------|
|
|
235
243
|
| `<source>` | Local JSON file path (optional positional argument) |
|
|
236
244
|
| `--app <name>` | App short name to fetch from server |
|
|
237
|
-
| `--domain <host>` | Override domain |
|
|
245
|
+
| `--domain <host>` | Override domain. Triggers a domain-change confirmation prompt when it differs from the project reference domain |
|
|
238
246
|
| `-y, --yes` | Auto-accept all prompts |
|
|
239
247
|
| `-v, --verbose` | Show HTTP request details |
|
|
240
248
|
|
|
249
|
+
#### Domain change detection
|
|
250
|
+
|
|
251
|
+
When cloning with a different domain than the project's reference domain (`app.json._domain` or `config.json.domain`), the CLI warns before proceeding. When `TransactionKeyPreset=RowID`, this escalates to a critical error because numeric IDs are not unique across domains — pushing to the wrong domain can corrupt records. In non-interactive mode (`-y`), RowUID domain changes proceed with a warning, but RowID domain changes throw a hard error.
|
|
252
|
+
|
|
253
|
+
The project's reference domain is stored in `app.json._domain` (committed to git) during clone, giving the CLI a stable cross-user baseline.
|
|
254
|
+
|
|
241
255
|
#### What clone does
|
|
242
256
|
|
|
243
257
|
1. **Loads app JSON** — from a local file, server API, or interactive prompt
|
|
@@ -438,7 +452,6 @@ Output:
|
|
|
438
452
|
Domain: my-domain.com
|
|
439
453
|
Username: user@example.com
|
|
440
454
|
User ID: 10296
|
|
441
|
-
User UID: albain3dwkofbhnd1qtd1q
|
|
442
455
|
Directory: /Users/me/projects/operator
|
|
443
456
|
Session: Active (expires: 2026-03-15T10:30:00.000Z)
|
|
444
457
|
Cookies: /Users/me/projects/operator/.dbo/cookies.txt
|
|
@@ -447,7 +460,7 @@ Output:
|
|
|
447
460
|
dbo: ✓ global (~/.claude/commands/dbo.md)
|
|
448
461
|
```
|
|
449
462
|
|
|
450
|
-
User ID
|
|
463
|
+
User ID is populated by `dbo login`. If it shows "(not set)", run `dbo login` to fetch it.
|
|
451
464
|
|
|
452
465
|
Plugin scopes (project or global) are displayed when plugins have been installed. Scopes are stored in `.dbo/config.local.json`.
|
|
453
466
|
|
|
@@ -559,8 +572,24 @@ dbo output myOutputUID --debug-sql
|
|
|
559
572
|
| `--maxrows <n>` | Maximum rows |
|
|
560
573
|
| `--rows <range>` | Row range, e.g., `1-10` |
|
|
561
574
|
| `--template <value>` | Custom template |
|
|
575
|
+
| `--limit <n>` | Maximum rows to return (preferred over `--maxrows`) |
|
|
576
|
+
| `--rowcount <bool>` | Include row count: `true` (default) or `false` for performance |
|
|
577
|
+
| `--display <expr>` | Show/hide template tags (repeatable), e.g., `sidebar=hide` |
|
|
578
|
+
| `--format-values` | Enable value formatting in `json_raw` output |
|
|
579
|
+
| `--empty-response-code <code>` | HTTP status code when output returns no results |
|
|
580
|
+
| `--fallback-content <expr>` | Fallback content UID for error codes, e.g., `404=contentUID` |
|
|
581
|
+
| `--escape-html <bool>` | Control HTML escaping: `true` or `false` |
|
|
582
|
+
| `--mime <type>` | Override MIME/content type |
|
|
583
|
+
| `--strict` | Strict error mode |
|
|
584
|
+
| `--confirm` | Confirmation flag |
|
|
585
|
+
| `--include <expr>` | Include token |
|
|
586
|
+
| `--no-transaction` | Disable transaction wrapping |
|
|
587
|
+
| `--skip <phase>` | Skip execution phases (repeatable, admin-only) |
|
|
588
|
+
| `--profile` | Enable MiniProfiler output |
|
|
562
589
|
| `--debug` | Include debug info |
|
|
563
590
|
| `--debug-sql` | Include SQL debug info |
|
|
591
|
+
| `--debug-verbose` | Verbose debug output |
|
|
592
|
+
| `--debug-analysis` | Analysis debug output |
|
|
564
593
|
| `--meta` | Use meta output endpoint |
|
|
565
594
|
| `--meta-column <uid>` | Column metadata |
|
|
566
595
|
| `--save` | Interactive save-to-disk mode |
|
|
@@ -1144,6 +1173,22 @@ When the server returns a `ticket_error` (record update requires a Ticket ID), t
|
|
|
1144
1173
|
Skip all updates that require a Ticket ID
|
|
1145
1174
|
```
|
|
1146
1175
|
|
|
1176
|
+
#### Ticket suggestions
|
|
1177
|
+
|
|
1178
|
+
When `TicketSuggestionOutput` is configured in `.dbo/config.json` (set during `dbo init`), the CLI automatically fetches relevant ticket suggestions from the server and presents them as selectable choices:
|
|
1179
|
+
|
|
1180
|
+
```
|
|
1181
|
+
? Select a Ticket ID:
|
|
1182
|
+
❯ 1 (TKT-001): Fix login page [login-fix]
|
|
1183
|
+
2 (TKT-002): Update dashboard [dashboard-v2]
|
|
1184
|
+
3 (TKT-003): Refactor auth [auth-refactor]
|
|
1185
|
+
Enter a Ticket ID manually…
|
|
1186
|
+
```
|
|
1187
|
+
|
|
1188
|
+
The suggestions are fetched from the configured output endpoint, filtered by the current record's UID. Users can arrow-key through the list to select a ticket, or choose "Enter a Ticket ID manually" for custom input.
|
|
1189
|
+
|
|
1190
|
+
If `TicketSuggestionOutput` is not configured or the fetch fails, the CLI falls back to a plain text input prompt.
|
|
1191
|
+
|
|
1147
1192
|
When the server returns a `repo_mismatch` (Ticket ID belongs to a different repository), the CLI prompts:
|
|
1148
1193
|
|
|
1149
1194
|
```
|
|
@@ -1496,6 +1541,158 @@ Both `--json` and `--jq` output use syntax highlighting:
|
|
|
1496
1541
|
|
|
1497
1542
|
---
|
|
1498
1543
|
|
|
1544
|
+
## DBO API Parameter Reference
|
|
1545
|
+
|
|
1546
|
+
The DBO.io API uses a token architecture for dynamic parameters. All parameters are passed as URL query string key-value pairs.
|
|
1547
|
+
|
|
1548
|
+
### Token Syntax
|
|
1549
|
+
|
|
1550
|
+
Parameters follow the token delimiter system:
|
|
1551
|
+
|
|
1552
|
+
```
|
|
1553
|
+
_tokenType@reference$target!defaultValue:modifier=value
|
|
1554
|
+
```
|
|
1555
|
+
|
|
1556
|
+
| Delimiter | Purpose | Example |
|
|
1557
|
+
|-----------|---------|---------|
|
|
1558
|
+
| `_` | Prefix for token type | `_filter`, `_sort`, `_limit` |
|
|
1559
|
+
| `@` | Reference (column, field, key) | `_filter@FirstName=John` |
|
|
1560
|
+
| `$` | Target (scope to a specific output/entity) | `_limit$outputUid=100` |
|
|
1561
|
+
| `!` | Default value (fallback) | `_filter@Status!active=value` |
|
|
1562
|
+
| `:` | Modifier(s) | `_filter@Name:Contains=john` |
|
|
1563
|
+
|
|
1564
|
+
### Output Parameters
|
|
1565
|
+
|
|
1566
|
+
These parameters control the output endpoint behavior (`/api/output/{uid}` and `/api/output/entity/{entityUid}`):
|
|
1567
|
+
|
|
1568
|
+
#### Filtering
|
|
1569
|
+
|
|
1570
|
+
```
|
|
1571
|
+
_filter@ColumnName=value # exact match (default)
|
|
1572
|
+
_filter@ColumnName:Contains=value # LIKE %value%
|
|
1573
|
+
_filter@ColumnName:StartsWith=value # LIKE value%
|
|
1574
|
+
_filter@ColumnName:EndsWith=value # LIKE %value
|
|
1575
|
+
_filter@ColumnName:LessThan=value # < comparison
|
|
1576
|
+
_filter@ColumnName:LessThanOrEqualTo=value # <= comparison
|
|
1577
|
+
_filter@ColumnName:GreaterThan=value # > comparison
|
|
1578
|
+
_filter@ColumnName:GreaterThanOrEqualTo=value # >= comparison
|
|
1579
|
+
_filter@ColumnName:Contains,And=value # AND logic (default is OR)
|
|
1580
|
+
_filter@ColumnName:Contains,Exclude=value # NOT LIKE
|
|
1581
|
+
_filter$outputTarget@ColumnName=value # scoped to specific output
|
|
1582
|
+
```
|
|
1583
|
+
|
|
1584
|
+
#### Sorting
|
|
1585
|
+
|
|
1586
|
+
```
|
|
1587
|
+
_sort=ColumnName # ascending (default)
|
|
1588
|
+
_sort=ColumnName:ASC # explicit ascending
|
|
1589
|
+
_sort=ColumnName:DESC # descending
|
|
1590
|
+
_sort=Column1:ASC,Column2:DESC # multiple sorts (comma-separated)
|
|
1591
|
+
_sort=ColumnName ASC # space-separated also works
|
|
1592
|
+
```
|
|
1593
|
+
|
|
1594
|
+
Multiple `_sort` parameters can be specified; earlier sorts take precedence.
|
|
1595
|
+
|
|
1596
|
+
#### Pagination
|
|
1597
|
+
|
|
1598
|
+
```
|
|
1599
|
+
_limit=30 # max 30 rows
|
|
1600
|
+
_limit=10-30 # rows 10 through 30 (range)
|
|
1601
|
+
_limit=10&_page=3 # 10 rows per page, page 3
|
|
1602
|
+
_rowcount=false # disable row count for performance
|
|
1603
|
+
```
|
|
1604
|
+
|
|
1605
|
+
Deprecated (still accepted): `_maxrows`, `_rows`, `_rowsperpage`
|
|
1606
|
+
|
|
1607
|
+
#### Search
|
|
1608
|
+
|
|
1609
|
+
```
|
|
1610
|
+
_search=keyword # full-text search across searchable columns
|
|
1611
|
+
_search@ColumnName=keyword # search specific column
|
|
1612
|
+
```
|
|
1613
|
+
|
|
1614
|
+
#### Template & Format
|
|
1615
|
+
|
|
1616
|
+
```
|
|
1617
|
+
_template=json_raw # format name: json_raw, html, json, json_indented, csv, xml, txt, pdf
|
|
1618
|
+
_template=3iX9fHFTL064Shgol8Bktw # content UID (custom template)
|
|
1619
|
+
_format_values=true # enable value formatting in json_raw
|
|
1620
|
+
_format=json # legacy format specifier
|
|
1621
|
+
_mime=application/json # override MIME/content type
|
|
1622
|
+
_escape_html=false # disable HTML escaping of data values
|
|
1623
|
+
```
|
|
1624
|
+
|
|
1625
|
+
#### Display Control
|
|
1626
|
+
|
|
1627
|
+
```
|
|
1628
|
+
_display@tagName=show # show a template content tag
|
|
1629
|
+
_display@tagName=hide # hide a template content tag
|
|
1630
|
+
_empty_response_code=404 # HTTP status when results are empty
|
|
1631
|
+
_fallback_content:404=contentUID # render a different content on 404
|
|
1632
|
+
```
|
|
1633
|
+
|
|
1634
|
+
#### Debug & Profiling
|
|
1635
|
+
|
|
1636
|
+
```
|
|
1637
|
+
_debug=true # general debug output
|
|
1638
|
+
_debug:sql=true # return SQL without executing
|
|
1639
|
+
_debug:verbose=true # verbose debug
|
|
1640
|
+
_debug:analysis=true # analysis debug
|
|
1641
|
+
_profile=true # MiniProfiler output
|
|
1642
|
+
```
|
|
1643
|
+
|
|
1644
|
+
Other debug sub-keys: `http_modules`, `instance`, `rewrites`, `cache`, `executable_contents`, `security`, `controllers`, `embeds`, `includes`, `contents`, `template_render`, `tokens`, `messages`, `media`, `request_stack`, `query_execution`, `query_building`
|
|
1645
|
+
|
|
1646
|
+
#### Control Flags
|
|
1647
|
+
|
|
1648
|
+
```
|
|
1649
|
+
_strict=true # strict error mode
|
|
1650
|
+
_confirm=true # confirmation flag for operations
|
|
1651
|
+
_no_transaction=true # disable transaction wrapping
|
|
1652
|
+
_skip=all # skip execution phases (admin-only)
|
|
1653
|
+
_include=value # include token
|
|
1654
|
+
_security=value # security filter enforcement
|
|
1655
|
+
```
|
|
1656
|
+
|
|
1657
|
+
### Data Tokens (used in templates)
|
|
1658
|
+
|
|
1659
|
+
| Token | Description |
|
|
1660
|
+
|-------|-------------|
|
|
1661
|
+
| `#{value@ColumnName}` | Column value from output row |
|
|
1662
|
+
| `#{id}` | Row primary key |
|
|
1663
|
+
| `#{uid}` | Row UID |
|
|
1664
|
+
| `#{CurrentUser@field}` | Current user field (e.g., `FirstName`, `Email`) |
|
|
1665
|
+
| `#{request@key}` | URL parameter value |
|
|
1666
|
+
| `#{session@variable}` | Session variable |
|
|
1667
|
+
| `#{site@field}` | Site field |
|
|
1668
|
+
| `#{date:format}` | Current date/time |
|
|
1669
|
+
| `#{unique:uid}` | Generate unique UID |
|
|
1670
|
+
| `#{count}` | Row count |
|
|
1671
|
+
| `#{page}` | Current page number |
|
|
1672
|
+
|
|
1673
|
+
### Template Tags
|
|
1674
|
+
|
|
1675
|
+
System tags (used in output templates):
|
|
1676
|
+
|
|
1677
|
+
| Tag | Purpose |
|
|
1678
|
+
|-----|---------|
|
|
1679
|
+
| `<#_row>` | Row template |
|
|
1680
|
+
| `<#_header>` | Header template |
|
|
1681
|
+
| `<#_footer>` | Footer template |
|
|
1682
|
+
| `<#_cell>` | Cell template |
|
|
1683
|
+
| `<#_empty>` | Empty result template |
|
|
1684
|
+
| `<#_noresult>` | No result template |
|
|
1685
|
+
| `<#_prompt>` | Prompt template |
|
|
1686
|
+
| `<#_shared>` | Shared template |
|
|
1687
|
+
| `<#_rowdelimiter>` | Row delimiter |
|
|
1688
|
+
| `<#_celldelimiter>` | Cell delimiter |
|
|
1689
|
+
| `<#_value>` | Value template |
|
|
1690
|
+
| `<#_embed url="...">` | Embed nested content/output |
|
|
1691
|
+
|
|
1692
|
+
User-defined tags use `<#reference>` (no underscore prefix).
|
|
1693
|
+
|
|
1694
|
+
---
|
|
1695
|
+
|
|
1499
1696
|
## Migration from curl
|
|
1500
1697
|
|
|
1501
1698
|
The `dbo` CLI is a drop-in replacement for the curl-based workflow. Here's how common operations translate:
|