@dboio/cli 0.11.4 → 0.13.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 +126 -3
- package/bin/dbo.js +4 -0
- package/package.json +1 -1
- package/plugins/claude/dbo/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/dbo/commands/dbo.md +65 -244
- package/plugins/claude/dbo/docs/_audit_required/API/all.md +40 -0
- package/plugins/claude/dbo/docs/_audit_required/API/app.md +38 -0
- package/plugins/claude/dbo/docs/_audit_required/API/athenticate.md +26 -0
- package/plugins/claude/dbo/docs/_audit_required/API/cache.md +29 -0
- package/plugins/claude/dbo/docs/_audit_required/API/content.md +14 -0
- package/plugins/claude/dbo/docs/_audit_required/API/data_source.md +28 -0
- package/plugins/claude/dbo/docs/_audit_required/API/email.md +18 -0
- package/plugins/claude/dbo/docs/_audit_required/API/input.md +25 -0
- package/plugins/claude/dbo/docs/_audit_required/API/instance.md +28 -0
- package/plugins/claude/dbo/docs/_audit_required/API/log.md +8 -0
- package/plugins/claude/dbo/docs/_audit_required/API/media.md +12 -0
- package/plugins/claude/dbo/docs/_audit_required/API/output_by_entity.md +12 -0
- package/plugins/claude/dbo/docs/_audit_required/API/upload.md +7 -0
- package/plugins/claude/dbo/docs/_audit_required/dbo-api-syntax.md +1487 -0
- package/plugins/claude/dbo/docs/_audit_required/dbo-problems-code.md +111 -0
- package/plugins/claude/dbo/docs/_audit_required/dbo-problems-performance.md +109 -0
- package/plugins/claude/dbo/docs/_audit_required/dbo-problems-syntax.md +97 -0
- package/plugins/claude/dbo/docs/_audit_required/dbo-product-market.md +119 -0
- package/plugins/claude/dbo/docs/_audit_required/dbo-white-paper.md +125 -0
- package/plugins/claude/dbo/docs/dbo-cheat-sheet.md +323 -0
- package/plugins/claude/dbo/docs/dbo-cli-readme.md +2222 -0
- package/plugins/claude/dbo/docs/dbo-core-entities.md +878 -0
- package/plugins/claude/dbo/docs/dbo-output-customsql.md +677 -0
- package/plugins/claude/dbo/docs/dbo-output-query.md +967 -0
- package/plugins/claude/dbo/skills/cli/SKILL.md +62 -246
- package/src/commands/add.js +366 -62
- package/src/commands/build.js +102 -0
- package/src/commands/clone.js +602 -139
- package/src/commands/diff.js +4 -0
- package/src/commands/init.js +16 -2
- package/src/commands/input.js +3 -1
- package/src/commands/mv.js +12 -4
- package/src/commands/push.js +265 -70
- package/src/commands/rm.js +16 -3
- package/src/commands/run.js +81 -0
- package/src/lib/config.js +39 -0
- package/src/lib/delta.js +7 -1
- package/src/lib/diff.js +24 -2
- package/src/lib/filenames.js +120 -41
- package/src/lib/ignore.js +6 -0
- package/src/lib/input-parser.js +13 -4
- package/src/lib/scripts.js +232 -0
- package/src/migrations/006-remove-uid-companion-filenames.js +181 -0
package/README.md
CHANGED
|
@@ -181,8 +181,10 @@ All configuration is **directory-scoped**. Each project folder maintains its own
|
|
|
181
181
|
| `metadata_templates.json` | Column templates per entity/descriptor (auto-generated by `dbo clone`) | Committable (shared) |
|
|
182
182
|
| `synchronize.json` | Pending deletions and sync state (updated by `dbo rm` and `dbo push`) | Committable (shared) |
|
|
183
183
|
| `.app_baseline.json` | Server-state snapshot for delta detection — stores column values at last clone/push so `dbo push` can detect which columns changed locally. Read-only (chmod 444); auto-migrated from legacy root `.app.json`. | Committable (shared) |
|
|
184
|
+
| `scripts.json` | Build/push lifecycle hooks (see [Script Hooks](#script-hooks)) | Committable (shared) |
|
|
185
|
+
| `scripts.local.json` | Per-user hook overrides | Gitignored (per-user) |
|
|
184
186
|
|
|
185
|
-
`dbo init` automatically adds `.dbo/credentials.json`, `.dbo/cookies.txt`, `.dbo/config.local.json`, and `.dbo/
|
|
187
|
+
`dbo init` automatically adds `.dbo/credentials.json`, `.dbo/cookies.txt`, `.dbo/config.local.json`, `.dbo/ticketing.local.json`, and `.dbo/scripts.local.json` to `.gitignore` (creates the file if it doesn't exist).
|
|
186
188
|
|
|
187
189
|
> **Upgrading from pre-0.9.9**: The baseline file `.app.json` in the project root has moved to `.dbo/.app_baseline.json`. Running any `dbo` command will auto-migrate the file. You can also manually remove the `.app.json` entry from your `.gitignore`.
|
|
188
190
|
|
|
@@ -411,6 +413,7 @@ The project's reference domain is stored in `app.json._domain` (committed to git
|
|
|
411
413
|
8. **Processes entity-dir records** — entities matching project directories (`extension`, `app_version`, `data_source`, `site`, `group`, `integration`, `automation`) are saved as `.metadata.json` files in their corresponding directory (e.g., `extension/`, `data_source/`)
|
|
412
414
|
9. **Processes other entities** — remaining entities with a `BinID` are placed in the corresponding bin directory
|
|
413
415
|
10. **Saves `app.json`** — clone of the original JSON with processed entries replaced by `@path/to/*.metadata.json` references
|
|
416
|
+
11. **Orphan cleanup** — any local `.metadata.json` files whose UID is absent from the server response are automatically moved to `trash/` along with their companion content and media files. This prevents stale records (deleted server-side) from causing false positives in `dbo push`. Skipped during `--entity-filter` clones
|
|
414
417
|
|
|
415
418
|
#### Clone source tracking
|
|
416
419
|
|
|
@@ -1237,7 +1240,10 @@ The push command finds `assets/js/main.metadata.json`, reads the UID and entity,
|
|
|
1237
1240
|
#### Directory (recursive)
|
|
1238
1241
|
|
|
1239
1242
|
```bash
|
|
1240
|
-
# Push all records in
|
|
1243
|
+
# Push all changed records in the current directory
|
|
1244
|
+
dbo push
|
|
1245
|
+
|
|
1246
|
+
# Push all records in a specific directory
|
|
1241
1247
|
dbo push assets/
|
|
1242
1248
|
|
|
1243
1249
|
# Push with auto-accept for all prompts
|
|
@@ -1280,7 +1286,7 @@ The `@colors.css` reference tells push to read the content from that file. All o
|
|
|
1280
1286
|
|
|
1281
1287
|
| Flag | Description |
|
|
1282
1288
|
|------|-------------|
|
|
1283
|
-
|
|
|
1289
|
+
| `[path]` | File or directory to push (default: current directory) |
|
|
1284
1290
|
| `-C, --confirm <true\|false>` | Commit (default: `true`) |
|
|
1285
1291
|
| `--ticket <id>` | Override ticket ID |
|
|
1286
1292
|
| `--modify-key <key>` | Provide ModifyKey directly (skips interactive prompt) |
|
|
@@ -1289,6 +1295,8 @@ The `@colors.css` reference tells push to read the content from that file. All o
|
|
|
1289
1295
|
| `--content-only` | Only push file content, skip metadata |
|
|
1290
1296
|
| `-y, --yes` | Auto-accept all prompts |
|
|
1291
1297
|
| `--toe-stepping <true\|false>` | Check server for conflicts before pushing (default: `true`). Set to `false` to skip the check and push unconditionally |
|
|
1298
|
+
| `--no-scripts` | Bypass all script hooks; run default push pipeline |
|
|
1299
|
+
| `--no-build` | Skip the build phase; run push phase only |
|
|
1292
1300
|
| `--json` | Output raw JSON |
|
|
1293
1301
|
| `--jq <expr>` | Filter JSON response |
|
|
1294
1302
|
|
|
@@ -1794,6 +1802,121 @@ To set up for non-interactive use:
|
|
|
1794
1802
|
|
|
1795
1803
|
---
|
|
1796
1804
|
|
|
1805
|
+
## Script Hooks
|
|
1806
|
+
|
|
1807
|
+
Script hooks let you define build and push lifecycle commands in `.dbo/scripts.json`. Hooks run automatically during `dbo push` and can also be triggered independently with `dbo build` and `dbo run`.
|
|
1808
|
+
|
|
1809
|
+
### Configuration Files
|
|
1810
|
+
|
|
1811
|
+
| File | Tracked | Purpose |
|
|
1812
|
+
|------|---------|---------|
|
|
1813
|
+
| `.dbo/scripts.json` | Yes | Shared hook definitions (committed to git) |
|
|
1814
|
+
| `.dbo/scripts.local.json` | No | Per-user overrides (gitignored) |
|
|
1815
|
+
|
|
1816
|
+
### Top-level Keys
|
|
1817
|
+
|
|
1818
|
+
| Key | Description |
|
|
1819
|
+
|-----|-------------|
|
|
1820
|
+
| `scripts` | Global hooks and named scripts (apply to all targets) |
|
|
1821
|
+
| `targets` | Per-file or per-directory hooks (highest priority) |
|
|
1822
|
+
| `entities` | Per-entity-type hooks (e.g., `content`, `extension.control`) |
|
|
1823
|
+
|
|
1824
|
+
### Example `.dbo/scripts.json`
|
|
1825
|
+
|
|
1826
|
+
```json
|
|
1827
|
+
{
|
|
1828
|
+
"scripts": {
|
|
1829
|
+
"prepush": "echo pushing $DBO_TARGET"
|
|
1830
|
+
},
|
|
1831
|
+
"targets": {
|
|
1832
|
+
"lib/bins/app/assets/js/operator.js": {
|
|
1833
|
+
"build": "rollup -c src/rollup_config.mjs",
|
|
1834
|
+
"push": false
|
|
1835
|
+
}
|
|
1836
|
+
},
|
|
1837
|
+
"entities": {
|
|
1838
|
+
"extension.control": {
|
|
1839
|
+
"prebuild": "npm run compile-controls"
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
```
|
|
1844
|
+
|
|
1845
|
+
### Lifecycle Hooks
|
|
1846
|
+
|
|
1847
|
+
| Hook | Phase | Description |
|
|
1848
|
+
|------|-------|-------------|
|
|
1849
|
+
| `prebuild` | Build | Runs before build |
|
|
1850
|
+
| `build` | Build | Main build step |
|
|
1851
|
+
| `postbuild` | Build | Runs after build |
|
|
1852
|
+
| `prepush` | Push | Runs before push |
|
|
1853
|
+
| `push` | Push | Custom push (replaces default HTTP submit) |
|
|
1854
|
+
| `postpush` | Push | Runs after push |
|
|
1855
|
+
|
|
1856
|
+
### Resolution Order
|
|
1857
|
+
|
|
1858
|
+
Hooks resolve per-hook from lowest to highest priority:
|
|
1859
|
+
|
|
1860
|
+
1. **Global** (`scripts`) — applies to all targets
|
|
1861
|
+
2. **Entity** (`entities`) — applies to targets matching the entity type
|
|
1862
|
+
3. **Target** (`targets`) — applies to a specific file or directory
|
|
1863
|
+
|
|
1864
|
+
A target can override `build` while the global `prepush` still applies.
|
|
1865
|
+
|
|
1866
|
+
### Hook Value Types
|
|
1867
|
+
|
|
1868
|
+
| Value | Behavior |
|
|
1869
|
+
|-------|----------|
|
|
1870
|
+
| `"command"` | Run as shell command |
|
|
1871
|
+
| `["cmd1", "cmd2"]` | Run sequentially; fail-fast on first non-zero exit |
|
|
1872
|
+
| `false` | Skip (for `push`: skip HTTP submit) |
|
|
1873
|
+
| `true` / omitted | Use default behavior |
|
|
1874
|
+
|
|
1875
|
+
### Environment Variables
|
|
1876
|
+
|
|
1877
|
+
These env vars are injected into all hook processes:
|
|
1878
|
+
|
|
1879
|
+
| Variable | Description |
|
|
1880
|
+
|----------|-------------|
|
|
1881
|
+
| `DBO_TARGET` | Relative file path being processed |
|
|
1882
|
+
| `DBO_ENTITY` | Entity type (e.g., `content`, `extension`) |
|
|
1883
|
+
| `DBO_DOMAIN` | Configured domain |
|
|
1884
|
+
| `DBO_APP` | App short name |
|
|
1885
|
+
| `DBO_APP_UID` | App UID |
|
|
1886
|
+
|
|
1887
|
+
### Push Flags
|
|
1888
|
+
|
|
1889
|
+
| Flag | Description |
|
|
1890
|
+
|------|-------------|
|
|
1891
|
+
| `--no-scripts` | Bypass all script hooks; run default push pipeline |
|
|
1892
|
+
| `--no-build` | Skip build phase; run push phase only |
|
|
1893
|
+
|
|
1894
|
+
### `dbo build [path]`
|
|
1895
|
+
|
|
1896
|
+
Runs the build lifecycle (`prebuild` → `build` → `postbuild`) without pushing.
|
|
1897
|
+
|
|
1898
|
+
```bash
|
|
1899
|
+
# Build a specific target
|
|
1900
|
+
dbo build lib/bins/app/assets/js/operator.js
|
|
1901
|
+
|
|
1902
|
+
# Build all targets with a build hook
|
|
1903
|
+
dbo build
|
|
1904
|
+
```
|
|
1905
|
+
|
|
1906
|
+
### `dbo run [script-name]`
|
|
1907
|
+
|
|
1908
|
+
Runs a named global script from `.dbo/scripts.json` (like `npm run`). Automatically runs `pre<name>` and `post<name>` scripts if defined.
|
|
1909
|
+
|
|
1910
|
+
```bash
|
|
1911
|
+
# List all available scripts
|
|
1912
|
+
dbo run
|
|
1913
|
+
|
|
1914
|
+
# Run a specific script
|
|
1915
|
+
dbo run prepush
|
|
1916
|
+
```
|
|
1917
|
+
|
|
1918
|
+
---
|
|
1919
|
+
|
|
1797
1920
|
## Global Flags
|
|
1798
1921
|
|
|
1799
1922
|
These flags are available on most commands:
|
package/bin/dbo.js
CHANGED
|
@@ -31,6 +31,8 @@ import { diffCommand } from '../src/commands/diff.js';
|
|
|
31
31
|
import { rmCommand } from '../src/commands/rm.js';
|
|
32
32
|
import { mvCommand } from '../src/commands/mv.js';
|
|
33
33
|
import { syncCommand } from '../src/commands/sync.js';
|
|
34
|
+
import { buildCommand } from '../src/commands/build.js';
|
|
35
|
+
import { runCommand } from '../src/commands/run.js';
|
|
34
36
|
|
|
35
37
|
// First-run welcome message
|
|
36
38
|
function checkFirstRun() {
|
|
@@ -91,6 +93,8 @@ program.addCommand(diffCommand);
|
|
|
91
93
|
program.addCommand(rmCommand);
|
|
92
94
|
program.addCommand(mvCommand);
|
|
93
95
|
program.addCommand(syncCommand);
|
|
96
|
+
program.addCommand(buildCommand);
|
|
97
|
+
program.addCommand(runCommand);
|
|
94
98
|
|
|
95
99
|
// Show welcome message on first run
|
|
96
100
|
checkFirstRun();
|
package/package.json
CHANGED
|
@@ -1,44 +1,49 @@
|
|
|
1
1
|
# DBO CLI Command
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Run `dbo` CLI commands for file sync, project management, and deployment.
|
|
4
4
|
|
|
5
|
-
**
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
**Documentation split** — two concerns, two doc sources:
|
|
6
|
+
- **CLI workflow commands** (push, pull, clone, add, rm, diff, build, deploy, install) — see `docs/dbo-cli-readme.md` for full flags, options, and behavior
|
|
7
|
+
- **DBO.io REST API** (CRUD, queries, content, media, messages, cache) — see the API docs:
|
|
8
|
+
- `docs/dbo-cheat-sheet.md` — API reference, token syntax, embed system
|
|
9
|
+
- `docs/dbo-core-entities.md` — Schema catalog for all 38 core entities
|
|
10
|
+
- `docs/dbo-output-query.md` — Query output data model and parameters
|
|
11
|
+
- `docs/dbo-output-customsql.md` — CustomSQL output reference
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
These files are in the `docs/` subdirectory relative to this plugin. When working in the repo, the API docs are at the repo root `docs/` and the CLI README is at `tools/cli/README.md`. Do NOT use CLI commands like `dbo input`, `dbo output`, `dbo content`, `dbo media`, `dbo upload`, `dbo message`, or `dbo cache` as your reference for API operations — use the REST API directly as documented in the API docs.
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
**STEP 1: Check if `$ARGUMENTS` is empty or blank.**
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
If `$ARGUMENTS` is empty — meaning the user typed just `/dbo` with nothing after it — then you MUST NOT run any bash command. Instead, respond with this message:
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|-----------|--------------------------------------------------|
|
|
17
|
-
| init | Initialize .dbo/ configuration |
|
|
18
|
-
| login | Authenticate with a DBO.io instance |
|
|
19
|
-
| logout | Clear session |
|
|
20
|
-
| status | Show config, domain, and session info |
|
|
21
|
-
| input | Submit CRUD operations (add/edit/delete records) |
|
|
22
|
-
| output | Query data from outputs or entities |
|
|
23
|
-
| content | Get or deploy content |
|
|
24
|
-
| media | Get media files |
|
|
25
|
-
| upload | Upload a file |
|
|
26
|
-
| message | Send messages (email, SMS, chatbot) |
|
|
27
|
-
| pull | Pull records to local files |
|
|
28
|
-
| push | Push local files back to DBO.io |
|
|
29
|
-
| add | Add a new file to DBO.io |
|
|
30
|
-
| clone | Clone an app to local project structure |
|
|
31
|
-
| diff | Compare local files with server versions |
|
|
32
|
-
| rm | Remove a file and stage server deletion |
|
|
33
|
-
| deploy | Deploy via manifest |
|
|
34
|
-
| cache | Manage cache |
|
|
35
|
-
| install | Install or upgrade CLI, plugins, Claude commands (shorthand: `i`) |
|
|
19
|
+
---
|
|
36
20
|
|
|
37
|
-
|
|
21
|
+
Hi there! I can help you with running dbo commands.
|
|
22
|
+
|
|
23
|
+
| Command | Description |
|
|
24
|
+
|---------|-------------|
|
|
25
|
+
| init | Initialize .dbo/ configuration |
|
|
26
|
+
| login | Authenticate with a DBO.io instance |
|
|
27
|
+
| logout | Clear session |
|
|
28
|
+
| status | Show config, domain, and session info |
|
|
29
|
+
| clone | Clone an app to local project structure |
|
|
30
|
+
| pull | Pull records to local files |
|
|
31
|
+
| push | Push local files back to DBO.io (no args = current dir) |
|
|
32
|
+
| add | Add a new file to DBO.io |
|
|
33
|
+
| diff | Compare local files with server versions |
|
|
34
|
+
| rm | Remove a file and stage server deletion |
|
|
35
|
+
| deploy | Deploy via .dbo/deploy_config.json manifest |
|
|
36
|
+
| build | Run build hooks from .dbo/scripts.json |
|
|
37
|
+
| run | Run a named script from .dbo/scripts.json |
|
|
38
|
+
| install | Install or upgrade CLI, plugins (shorthand: `i`) |
|
|
39
|
+
|
|
40
|
+
For querying data or making direct API calls (CRUD, output, content, media, messages, cache), refer to the `docs/` directory for the REST API reference.
|
|
41
|
+
|
|
42
|
+
What would you like to do?
|
|
38
43
|
|
|
39
44
|
---
|
|
40
45
|
|
|
41
|
-
Then STOP
|
|
46
|
+
Then STOP and guide the user interactively.
|
|
42
47
|
|
|
43
48
|
**STEP 2: If `$ARGUMENTS` is NOT empty, run the command:**
|
|
44
49
|
|
|
@@ -46,229 +51,45 @@ Then STOP. Wait for the user to respond. Guide them step by step — asking abou
|
|
|
46
51
|
dbo $ARGUMENTS
|
|
47
52
|
```
|
|
48
53
|
|
|
49
|
-
##
|
|
50
|
-
|
|
51
|
-
Available subcommands:
|
|
52
|
-
- `init` — Initialize .dbo/ configuration for the current directory
|
|
53
|
-
- `login` — Authenticate with a DBO.io instance
|
|
54
|
-
- `logout` — Clear session
|
|
55
|
-
- `status` — Show config, domain, and session info
|
|
56
|
-
- `input -d '<expr>'` — CRUD operations (add/edit/delete records)
|
|
57
|
-
- `output -e <entity>` — Query data from entities
|
|
58
|
-
- `output <uid>` — Query custom outputs
|
|
59
|
-
- `content <uid>` — Get content, `content deploy <uid> <file>` to deploy
|
|
60
|
-
- `pull [uid]` — Pull records to local files (default: content entity)
|
|
61
|
-
- `pull -e <entity> [uid]` — Pull from any entity
|
|
62
|
-
- `push <path>` — Push local files back to DBO using metadata
|
|
63
|
-
- `add <path>` — Add a new file to DBO (creates record on server)
|
|
64
|
-
- `media <uid>` — Get media files
|
|
65
|
-
- `upload <file>` — Upload binary files
|
|
66
|
-
- `message <uid>` — Send messages (email, SMS, chatbot)
|
|
67
|
-
- `cache list|refresh` — Manage cache
|
|
68
|
-
- `clone [source]` — Clone an app to local project (from file or server)
|
|
69
|
-
- `clone --app <name>` — Clone by app short name from server
|
|
70
|
-
- `diff [path]` — Compare local files against server and selectively merge changes
|
|
71
|
-
- `diff -y` — Accept all server changes without prompting
|
|
72
|
-
- `diff --no-interactive` — Show diffs without prompting to accept
|
|
73
|
-
- `rm <file>` — Remove a file locally and stage server deletion for next push
|
|
74
|
-
- `rm <directory>` — Remove a directory, all files, and sub-directories recursively
|
|
75
|
-
- `rm -f <path>` — Remove without confirmation prompts
|
|
76
|
-
- `rm --keep-local <path>` — Stage server deletions without deleting local files/directories
|
|
77
|
-
- `deploy [name]` — Deploy via .dbo/deploy_config.json manifest
|
|
78
|
-
- `install` (alias: `i`) — Install or upgrade CLI, plugins, or Claude commands
|
|
79
|
-
- `i dbo` or `i dbo@latest` — Install/upgrade the CLI from npm
|
|
80
|
-
- `i dbo@0.4.1` — Install a specific CLI version
|
|
81
|
-
- `install /path/to/src` — Install CLI from local source
|
|
82
|
-
- `install plugins` — Install/upgrade Claude command plugins
|
|
83
|
-
- `install plugins --global` — Install plugins to `~/.claude/commands/` (shared across projects)
|
|
84
|
-
- `install plugins --local` — Install plugins to `.claude/commands/` (project only)
|
|
85
|
-
- `install claudecommands` — Install/upgrade Claude Code commands
|
|
86
|
-
- `install claudecode` — Install Claude Code CLI + commands
|
|
87
|
-
- `install --claudecommand dbo --global` — Install a specific command globally
|
|
88
|
-
|
|
89
|
-
## Change Detection (pull, clone, diff)
|
|
90
|
-
|
|
91
|
-
When pulling or cloning records that already exist locally, the CLI compares file modification times against the server's `_LastUpdated` timestamp. If the server has newer data, you'll be prompted with options:
|
|
92
|
-
|
|
93
|
-
1. **Overwrite** — Replace local files with server version
|
|
94
|
-
2. **Compare** — Show a line-by-line diff and selectively merge
|
|
95
|
-
3. **Skip** — Keep local files unchanged
|
|
96
|
-
4. **Overwrite all** — Accept all remaining server changes
|
|
97
|
-
5. **Skip all** — Skip all remaining files
|
|
98
|
-
|
|
99
|
-
Use `dbo diff [path]` to compare without pulling. Use `-y` to auto-accept all changes.
|
|
100
|
-
|
|
101
|
-
## Smart Command Building
|
|
102
|
-
|
|
103
|
-
When helping the user build a command interactively:
|
|
104
|
-
|
|
105
|
-
1. **Check readiness first**: Run `dbo status` to see if initialized and authenticated. If not, guide them through `dbo init` and `dbo login` first.
|
|
106
|
-
2. **Understand intent**: Ask what they want to do (query data, deploy a file, add a record, etc.)
|
|
107
|
-
3. **Gather parameters**: Ask for the specific values needed (entity name, UID, file path, filters, etc.)
|
|
108
|
-
4. **Build the command**: Construct the full `dbo` command with proper flags and syntax
|
|
109
|
-
5. **Execute**: Run it and explain the results
|
|
110
|
-
|
|
111
|
-
### Common workflows to suggest:
|
|
112
|
-
|
|
113
|
-
- **"I want to query data"** → Guide toward `dbo output -e <entity>` with filters
|
|
114
|
-
- **"I want to deploy/update a file"** → Check if `.metadata.json` exists → `dbo push` or `dbo content deploy`
|
|
115
|
-
- **"I want to add a new file"** → `dbo add <path>` (will create metadata interactively)
|
|
116
|
-
- **"I want to pull files from the server"** → `dbo pull` or `dbo pull -e <entity>`
|
|
117
|
-
- **"I want to delete/remove a file"** → `dbo rm <file>` (stages deletion for next `dbo push`)
|
|
118
|
-
- **"I want to delete a directory"** → `dbo rm <directory>` (removes all files + sub-dirs, stages bin deletions)
|
|
119
|
-
- **"I want to see what's on the server"** → `dbo output -e <entity> --format json`
|
|
120
|
-
- **"I need to set up this project"** → `dbo init` → `dbo login` → `dbo status`
|
|
121
|
-
- **"I want to clone an app"** → `dbo clone --app <name>` or `dbo clone <local.json>`
|
|
122
|
-
- **"I want to set up and clone"** → `dbo init --domain <host> --app <name> --clone`
|
|
123
|
-
|
|
124
|
-
## Add Command Details
|
|
125
|
-
|
|
126
|
-
`dbo add <path>` registers a new local file with the DBO server by creating an insert record.
|
|
54
|
+
## Quick Reference
|
|
127
55
|
|
|
56
|
+
### Project setup
|
|
128
57
|
```bash
|
|
129
|
-
|
|
130
|
-
dbo
|
|
131
|
-
|
|
132
|
-
#
|
|
133
|
-
dbo add assets/css/colors.css -y --ticket abc123
|
|
134
|
-
|
|
135
|
-
# Scan current directory for all un-added files
|
|
136
|
-
dbo add .
|
|
137
|
-
|
|
138
|
-
# Scan a specific directory
|
|
139
|
-
dbo add assets/
|
|
58
|
+
dbo init --domain <host> # initialize
|
|
59
|
+
dbo init --domain <host> --app <name> --clone # init + clone
|
|
60
|
+
dbo login # authenticate
|
|
61
|
+
dbo status # check session
|
|
140
62
|
```
|
|
141
63
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
### How add works
|
|
145
|
-
|
|
146
|
-
1. Checks for a companion `<basename>.metadata.json` next to the file
|
|
147
|
-
2. If metadata exists with `_CreatedOn` → already on server, skips (use `push` instead)
|
|
148
|
-
3. If metadata exists without `_CreatedOn` → uses it to insert the record
|
|
149
|
-
4. If no metadata → interactive wizard prompts for: entity, content column, AppID, BinID, SiteID, Path
|
|
150
|
-
5. Creates `.metadata.json`, submits insert to `/api/input/submit`
|
|
151
|
-
6. Writes returned UID back to metadata file
|
|
152
|
-
7. Suggests running `dbo pull -e <entity> <uid>` to populate all server columns
|
|
153
|
-
|
|
154
|
-
### Non-interactive add (for scripting)
|
|
155
|
-
|
|
156
|
-
To add without prompts, create the `.metadata.json` first, then run `dbo add <file> -y`:
|
|
157
|
-
|
|
158
|
-
```json
|
|
159
|
-
{
|
|
160
|
-
"Name": "colors",
|
|
161
|
-
"Path": "assets/css/colors.css",
|
|
162
|
-
"Content": "@colors.css",
|
|
163
|
-
"_entity": "content",
|
|
164
|
-
"_contentColumns": ["Content"]
|
|
165
|
-
}
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
Optional fields like `AppID`, `BinID`, `SiteID` are only included if the user provides values — they have no defaults and are omitted when left blank.
|
|
169
|
-
|
|
170
|
-
The `@colors.css` value means "read content from colors.css in the same directory".
|
|
171
|
-
|
|
172
|
-
### Directory scan (`dbo add .`)
|
|
173
|
-
|
|
174
|
-
Finds files that have no `.metadata.json` or whose metadata lacks `_CreatedOn`. Skips `.dbo/`, `.git/`, `node_modules/`, dotfiles, and `.metadata.json` files. When adding multiple files, defaults from the first file are reused.
|
|
175
|
-
|
|
176
|
-
## Push Command Details
|
|
177
|
-
|
|
178
|
-
`dbo push <path>` pushes local file changes back to existing DBO records using their `.metadata.json`.
|
|
179
|
-
|
|
64
|
+
### File sync workflow
|
|
180
65
|
```bash
|
|
181
|
-
dbo
|
|
182
|
-
dbo
|
|
183
|
-
dbo push
|
|
184
|
-
dbo push
|
|
185
|
-
dbo
|
|
66
|
+
dbo clone --app <name> # clone app to local
|
|
67
|
+
dbo pull -e <entity> [uid] # pull records
|
|
68
|
+
dbo push # push all changes (current dir)
|
|
69
|
+
dbo push <path> # push specific file/dir
|
|
70
|
+
dbo add <path> # add new file to server
|
|
71
|
+
dbo diff [path] # compare local vs server
|
|
72
|
+
dbo rm <path> # stage deletion
|
|
186
73
|
```
|
|
187
74
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
## Column Filtering (add & push)
|
|
191
|
-
|
|
192
|
-
These columns are **never submitted** in add or push payloads:
|
|
193
|
-
- `_CreatedOn`, `_LastUpdated` — server-managed timestamps
|
|
194
|
-
- `_LastUpdatedUserID`, `_LastUpdatedTicketID` — session-provided values
|
|
195
|
-
- `UID` — server-assigned on insert; used as identifier on push (not as column value)
|
|
196
|
-
- `_id`, `_entity`, `_contentColumns`, `_mediaFile` — internal/metadata fields
|
|
197
|
-
|
|
198
|
-
## Pull → Edit → Push/Add Workflow
|
|
199
|
-
|
|
75
|
+
### Build & deploy
|
|
200
76
|
```bash
|
|
201
|
-
#
|
|
202
|
-
dbo
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
dbo
|
|
206
|
-
|
|
207
|
-
# Or add a brand new file
|
|
208
|
-
dbo add assets/css/newstyle.css
|
|
77
|
+
dbo build # run build hooks
|
|
78
|
+
dbo build <path> # build specific target
|
|
79
|
+
dbo run [script-name] # run named script
|
|
80
|
+
dbo deploy [name] # deploy via manifest
|
|
81
|
+
dbo deploy --all # deploy all manifest entries
|
|
209
82
|
```
|
|
210
83
|
|
|
211
|
-
##
|
|
212
|
-
|
|
213
|
-
`dbo clone` scaffolds a local project from a DBO.io app export JSON, creating directories, files, metadata, and config.
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
# Clone from a local JSON export file
|
|
217
|
-
dbo clone /path/to/app_export.json
|
|
218
|
-
|
|
219
|
-
# Clone from server by app short name (requires login)
|
|
220
|
-
dbo clone --app myapp
|
|
221
|
-
|
|
222
|
-
# Clone using AppShortName already in config
|
|
223
|
-
dbo clone
|
|
224
|
-
|
|
225
|
-
# Init + clone in one step
|
|
226
|
-
dbo init --domain my-domain.com --app myapp --clone
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
Flags: `--app <name>`, `--domain <host>`, `-y/--yes`, `-v/--verbose`
|
|
230
|
-
|
|
231
|
-
### What clone does
|
|
232
|
-
|
|
233
|
-
1. Loads app JSON (local file, server API, or prompt)
|
|
234
|
-
2. Updates `.dbo/config.json` with `AppID`, `AppUID`, `AppName`, `AppShortName`
|
|
235
|
-
3. Updates `package.json` with `name`, `productName`, `description`, `homepage`, and `deploy` script
|
|
236
|
-
4. Creates directory structure from `children.bin` hierarchy → saves `.dbo/structure.json`
|
|
237
|
-
5. Writes content files (decodes base64) with `*.metadata.json` into bin directories
|
|
238
|
-
6. Downloads media files from server using fallback chain: FullPath (`/media/{app}/{path}`) → `/dir/` route → `/api/media/{uid}`, with `*.metadata.json`. Errors logged to `.dbo/errors.log`
|
|
239
|
-
7. Processes entity-dir records (`extension`, `app_version`, `data_source`, `site`, `group`, `integration`, `automation`) into `lib/` project directories as `.metadata.json` files with optional companion content files
|
|
240
|
-
8. Processes remaining entities with BinID into corresponding bin directories
|
|
241
|
-
9. Saves `app.json` to project root with `@path/to/*.metadata.json` references
|
|
242
|
-
|
|
243
|
-
### Placement preferences
|
|
244
|
-
|
|
245
|
-
When a record has both `Path`/`FullPath` and `BinID`, clone prompts the user to choose placement. Preferences are saved to `.dbo/config.json` and reused on future clones:
|
|
246
|
-
|
|
247
|
-
- `ContentPlacement`: `bin` | `path` | `ask` — for content and other entities
|
|
248
|
-
- `MediaPlacement`: `bin` | `fullpath` | `ask` — for media files
|
|
249
|
-
|
|
250
|
-
Pre-set these in config.json to skip prompts. `.dbo/config.json` and `.dbo/structure.json` are shared via git; `.dbo/credentials.json` and `.dbo/cookies.txt` are gitignored (per-user).
|
|
251
|
-
|
|
252
|
-
### AppID awareness (add & input)
|
|
253
|
-
|
|
254
|
-
After cloning, the config has an `AppID`. When running `dbo add` or `dbo input` without an AppID in the data, the CLI prompts:
|
|
255
|
-
1. Yes, use AppID from config
|
|
256
|
-
2. No
|
|
257
|
-
3. Enter custom AppID
|
|
258
|
-
|
|
259
|
-
### Init flags for clone
|
|
260
|
-
|
|
261
|
-
`dbo init` now supports `--app <shortName>` and `--clone` flags to combine initialization with app cloning.
|
|
262
|
-
|
|
263
|
-
## Error Handling
|
|
264
|
-
|
|
265
|
-
- If the command fails with a session/authentication error, suggest: `dbo login`
|
|
266
|
-
- If it fails with "No domain configured", suggest: `dbo init`
|
|
267
|
-
- If a command is not found, suggest: `dbo --help`
|
|
84
|
+
## Interactive Guidance
|
|
268
85
|
|
|
269
|
-
|
|
86
|
+
When helping the user build a command:
|
|
87
|
+
1. Run `dbo status` to check if initialized and authenticated
|
|
88
|
+
2. Ask what they want to do
|
|
89
|
+
3. Gather needed parameters (entity, UID, file path, etc.)
|
|
90
|
+
4. Build and execute the command
|
|
270
91
|
|
|
271
|
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
92
|
+
## Error Recovery
|
|
93
|
+
- Session/auth error: suggest `dbo login`
|
|
94
|
+
- No domain configured: suggest `dbo init`
|
|
95
|
+
- Command not found: suggest `dbo --help`
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# All
|
|
2
|
+
|
|
3
|
+
These parameters work on all endpoints
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Impersonation | |
|
|
8
|
+
| ------------- | ------------------------------------------------------------ |
|
|
9
|
+
| _as | The request key that is used to indicate that a request should be run as another user |
|
|
10
|
+
| _as_cookie | The request key that is used to indicate that a cookie should be set for the _as user that is being used |
|
|
11
|
+
| _security_log | The request key that is used to request a full security log to be included in the response headers |
|
|
12
|
+
|
|
13
|
+
| Debug | |
|
|
14
|
+
| -------------------------- | ----------------------------------------------------------- |
|
|
15
|
+
| _debug | Nuclear debug option |
|
|
16
|
+
| _debug_sql | The (legacy) request key that will trigger debug output sql |
|
|
17
|
+
| _debug:sql | Debugging only SQL key |
|
|
18
|
+
| _debug:http_modules | Debugging only HTTP modules |
|
|
19
|
+
| _debug:instance | Debugging only instance |
|
|
20
|
+
| _debug:rewrites | Debugging only rewrites |
|
|
21
|
+
| _debug:cache | Debugging only cache |
|
|
22
|
+
| _debug:com | Debugging only COM |
|
|
23
|
+
| _debug:executable_contents | Debugging only executable contents |
|
|
24
|
+
| _debug:request_log | Debugging only request logs |
|
|
25
|
+
| _debug:security | Debugging only security |
|
|
26
|
+
| _debug:controllers | Debugging only controllers |
|
|
27
|
+
| _debug:embeds | Debugging only embeds |
|
|
28
|
+
| _debug:includes | Debugging only includes |
|
|
29
|
+
| _debug:contents | Debugging only contents |
|
|
30
|
+
| _debug:template_render | Debugging only template render |
|
|
31
|
+
| _debug:result_set_access | Debugging only result set access |
|
|
32
|
+
| _debug:template_parsing | Debugging only template parsing |
|
|
33
|
+
| _debug:entity_internals | Debugging only entity internal operations/save |
|
|
34
|
+
| _debug:query_execution | Debugging only query execution |
|
|
35
|
+
| _debug:query_building | Debugging only query building |
|
|
36
|
+
| _debug:tokens | Debugging only tokens |
|
|
37
|
+
| _debug:messages | Debugging only messages |
|
|
38
|
+
| _debug:request_stack | Debugging only request stack |
|
|
39
|
+
| _debug:skip | |
|
|
40
|
+
| _really_cmon_doit | The really-cmon-doit request key |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# App
|
|
2
|
+
|
|
3
|
+
## URL Endpoints
|
|
4
|
+
|
|
5
|
+
- api/app/delete/{appUid}
|
|
6
|
+
- api/app/import/{appUid}
|
|
7
|
+
- api/app_version/populate/{appVersionUid}
|
|
8
|
+
- api/app_version/clear/{appVersionUid}
|
|
9
|
+
- api/app/export/{appUid}
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Description |
|
|
14
|
+
| ------------------------------------ | ------------------------------------------------------------ |
|
|
15
|
+
| _app_version_info | Request parameter that can be included (as 'false', '0', or 'no') to turn off addressing app version info on app import |
|
|
16
|
+
| _app_data | Request parameter that can be included (as 'false', '0', or 'no') to turn off addressing app data on app import |
|
|
17
|
+
| _app_media | Request parameter that can be included (as 'false', '0', or 'no') to turn off addressing app media on app import |
|
|
18
|
+
| _schema_migration_check | Request parameter that can be included (as 'false', '0', or 'no') to turn off checking the schema migration of the import against that of the local core |
|
|
19
|
+
| _skip_media_rearch_2020_validation | When truthy, app import will not fail if the import account's MediaRearch2020 is false and the app's is true |
|
|
20
|
+
| _skip_dboio_version_validation | When truthy, app import will not fail if the import system's dbo.io version is less than the export system's |
|
|
21
|
+
| _legacy_import_data_generation | When truthy, app import generate app version and app version updates in the legacy (pre-.9.48) fashion |
|
|
22
|
+
| _app_url | Request parameter that can be used to specify a url to import an app from |
|
|
23
|
+
| _skip_archival_export | Request parameter that can be included (as 'true', '1', or 'yes') to skip the archival export that is normally done before deleting an app |
|
|
24
|
+
| _legacy_by_appid | For use after MediaRearch2020, when truthy app operations will use asset AppID to collect app assets, instead of bin structure |
|
|
25
|
+
| _force_local_record_check | Request parameter to force an app import to check for all records locally, by record UID |
|
|
26
|
+
| _patch | DEPRECATED Parameter to use when exporting a patch version |
|
|
27
|
+
| _type | Parameter to use when exporting, to specify "update" (patch) version |
|
|
28
|
+
| _continue_on_execution_group_failure | During import, if this is truthy, then when an execution group fails, the import process will log it as a warning and continue |
|
|
29
|
+
| _no_rollback | During import, if this is truthy, then when a failure causes the import to stop, there will be no rollback performed |
|
|
30
|
+
| _media_only | During import, if this is truthy, then when a failure causes the import to stop, there will be no rollback performed |
|
|
31
|
+
| _nullify_parentbinid | |
|
|
32
|
+
| _legacy_app_delete | When true, will use legacy app delete (instead of app_delete SPROC) |
|
|
33
|
+
| _modify_key | Request parameter used to indicate a valid update of an app asset by a client (non-owner) of the app |
|
|
34
|
+
| _modify_key_check_override | Modify key check override. If this key is set in HttpContext.Current.Items = true, then the check for whether a modify key is present to modify an app will be bypassed (used in app import, for example). |
|
|
35
|
+
| _db_timeout_seconds | Request parameter to indicate a custom db timeout |
|
|
36
|
+
| _no_transaction | Request parameter to indicate that a transaction should NOT be used |
|
|
37
|
+
| _no_db_ops | Request parameter to indicate that db ops should not be executed for the given request |
|
|
38
|
+
| _skip_minimum_content_uid_length | When this is truthy, we'll skip the validation that says contents must be less than 5 characters |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Authenticate
|
|
2
|
+
|
|
3
|
+
Used to log users in an out of dbo.io. Can be invoked through any endpoint by use of `_login=true` parameter.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## URL Endpoint
|
|
8
|
+
|
|
9
|
+
api/authenticate
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Paremeter | Description | Shorthand |
|
|
16
|
+
| ------------ | ------------------------------------------------------------ | --------- |
|
|
17
|
+
| _username | Corresponds to user.username | _un |
|
|
18
|
+
| _email | Corresponds to user.email | _em |
|
|
19
|
+
| _phonenumber | Corresponds to user.PhoneNumber | _pn |
|
|
20
|
+
| _password | Corresponds to user.Password | _pw |
|
|
21
|
+
| _passkey | Corresponds to user.Passkey | _pk |
|
|
22
|
+
| _login | When true the `athenticate` API is invoked for all endpoints | |
|
|
23
|
+
| _logout | Logs the user out of [dbo.io](http://dbo.io/) | _lo |
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|