@dboio/cli 0.13.2 → 0.15.0
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 +57 -0
- package/bin/dbo.js +2 -0
- package/package.json +1 -1
- package/plugins/claude/dbo/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/dbo/commands/dbo.md +76 -74
- package/plugins/claude/dbo/docs/dbo-cli-readme.md +57 -0
- package/plugins/claude/dbo/skills/cli/SKILL.md +2 -1
- package/src/commands/add.js +12 -7
- package/src/commands/clone.js +138 -94
- package/src/commands/deploy.js +9 -2
- package/src/commands/diff.js +4 -4
- package/src/commands/login.js +30 -4
- package/src/commands/mv.js +17 -4
- package/src/commands/push.js +34 -9
- package/src/commands/rm.js +6 -4
- package/src/commands/tag.js +65 -0
- package/src/lib/config.js +28 -0
- package/src/lib/deploy-config.js +137 -0
- package/src/lib/diff.js +5 -4
- package/src/lib/filenames.js +89 -24
- package/src/lib/scaffold.js +1 -1
- package/src/lib/tagging.js +380 -0
- package/src/lib/toe-stepping.js +2 -1
- package/src/migrations/006-remove-uid-companion-filenames.js +3 -3
- package/src/migrations/007-natural-entity-companion-filenames.js +165 -0
- package/src/migrations/008-metadata-uid-in-suffix.js +70 -0
package/README.md
CHANGED
|
@@ -190,6 +190,17 @@ All configuration is **directory-scoped**. Each project folder maintains its own
|
|
|
190
190
|
|
|
191
191
|
> **Upgrading from pre-0.11.0**: `TransactionKeyPreset` now applies only to records that carry a `UID` column (core assets). Data records without a UID are always submitted with `RowID` regardless of the preset. Migration 001 runs automatically on first command after upgrade and logs a one-time notice.
|
|
192
192
|
|
|
193
|
+
> **Upgrading to 0.13.3+**: Entity and extension companion files no longer include `~UID` in the filename. Migration 007 automatically renames legacy `name~uid.Column.ext` files to `name.Column.ext` and updates `@references` in metadata.
|
|
194
|
+
|
|
195
|
+
> **Upgrading to 0.14.0+**: Metadata files now use `name.metadata~uid.json` instead of `name~uid.metadata.json`. The UID has moved from the base name into the `.metadata~uid` suffix. Migration 008 automatically renames all metadata files. Output child companions use index-based naming (`Sales.column.CustomSQL.sql`, `Sales.column-1.CustomSQL.sql`) instead of UID-based naming.
|
|
196
|
+
>
|
|
197
|
+
> | Record type | Example metadata file |
|
|
198
|
+
> |---|---|
|
|
199
|
+
> | Content | `colors.metadata~abc123.json` |
|
|
200
|
+
> | Media | `logo.png.metadata~def456.json` |
|
|
201
|
+
> | Output | `Sales.metadata~ghi789.json` |
|
|
202
|
+
> | Extension | `MyExtension.metadata~jkl012.json` |
|
|
203
|
+
|
|
193
204
|
#### Automatic migrations
|
|
194
205
|
|
|
195
206
|
When the CLI version is upgraded, one-time migration scripts in `tools/cli/src/migrations/` run automatically on the first command invocation in a project directory. Completed migration IDs are recorded in `.dbo/config.local.json` under `_completedMigrations` (per-user, gitignored) so each developer runs them independently and they never re-fire.
|
|
@@ -498,6 +509,8 @@ For each entity type, the CLI prompts to choose which column becomes the filenam
|
|
|
498
509
|
|
|
499
510
|
If any columns contain base64-encoded content, the CLI prompts to extract them as companion files. Extracted columns produce files named `<name>.<Column>.<ext>` alongside the metadata, with `@reference` entries in the metadata and a `_contentColumns` array.
|
|
500
511
|
|
|
512
|
+
**Companion file naming convention:** Only `.metadata.json` files carry the `~UID` suffix (e.g. `Add-Asst-Execute-Security~wxl6ivcwfkix3zgantszjg.metadata.json`). Companion content files use the natural base name without `~UID` (e.g. `Add-Asst-Execute-Security.String16.js`). If two records share the same name within a directory, the second gets a `-1` suffix (e.g. `Add-Asst-Execute-Security-1.String16.js` with metadata `Add-Asst-Execute-Security-1~otheruid.metadata.json`). Migration 007 automatically renames legacy `~UID` companion files to the natural convention.
|
|
513
|
+
|
|
501
514
|
Use `-y` to skip prompts (uses `Name` column, no content extraction).
|
|
502
515
|
|
|
503
516
|
#### Extension descriptor sub-directories
|
|
@@ -1308,6 +1321,31 @@ You can then choose to overwrite the server changes or cancel and pull first. Us
|
|
|
1308
1321
|
|
|
1309
1322
|
---
|
|
1310
1323
|
|
|
1324
|
+
### `dbo tag`
|
|
1325
|
+
|
|
1326
|
+
Apply macOS Finder color tags or Linux gio emblems to companion files based on their sync status relative to the server. Tags are automatically refreshed after `dbo clone` and `dbo push`.
|
|
1327
|
+
|
|
1328
|
+
| Tag | Color | Meaning |
|
|
1329
|
+
|-----|-------|---------|
|
|
1330
|
+
| `dbo:Synced` | 🟢 Green | File matches server — no local changes |
|
|
1331
|
+
| `dbo:Modified` | 🔵 Blue | Local edits not yet pushed |
|
|
1332
|
+
| `dbo:Untracked` | 🟡 Yellow | No metadata — not yet added with `dbo add` |
|
|
1333
|
+
| `dbo:Trashed` | 🔴 Red | File is in the `trash/` directory |
|
|
1334
|
+
|
|
1335
|
+
```bash
|
|
1336
|
+
dbo tag # Refresh tags for all project files
|
|
1337
|
+
dbo tag --clear # Remove all dbo:* tags (preserves other Finder tags)
|
|
1338
|
+
dbo tag --status # Show counts per category
|
|
1339
|
+
dbo tag --verbose # Log each file and its status
|
|
1340
|
+
dbo tag path/to/dir # Tag a specific file or directory subtree
|
|
1341
|
+
dbo tag --enable # Enable automatic tagging after clone/push (default)
|
|
1342
|
+
dbo tag --disable # Disable automatic tagging
|
|
1343
|
+
```
|
|
1344
|
+
|
|
1345
|
+
Tagging is silently skipped on Windows and unsupported platforms. Only macOS (Finder color tags via `xattr`) and Linux (gio emblems) are supported. The `--clear` flag only removes `dbo:*` prefixed tags, preserving any user-applied Finder tags.
|
|
1346
|
+
|
|
1347
|
+
---
|
|
1348
|
+
|
|
1311
1349
|
### `dbo rm`
|
|
1312
1350
|
|
|
1313
1351
|
Remove a file or directory locally and stage server deletions for the next `dbo push`. Similar to `git rm`.
|
|
@@ -1773,6 +1811,25 @@ Create a `.dbo/deploy_config.json` file to define named deployments:
|
|
|
1773
1811
|
|
|
1774
1812
|
This replaces the curl commands typically embedded in `package.json` scripts.
|
|
1775
1813
|
|
|
1814
|
+
#### Automatic deploy config generation
|
|
1815
|
+
|
|
1816
|
+
When you run `dbo clone` or `dbo add`, each companion file (CSS, JS, HTML, SQL, etc.) is automatically registered in `.dbo/deploy_config.json` under an `<extension>:<name>` key — no manual authoring needed:
|
|
1817
|
+
|
|
1818
|
+
```bash
|
|
1819
|
+
dbo clone # → .dbo/deploy_config.json auto-populated with one entry per companion file
|
|
1820
|
+
```
|
|
1821
|
+
|
|
1822
|
+
Keys are derived as `<extension>:<basename>` from the companion file path. If two files share the same key, a parent directory segment is appended to disambiguate (`css:colors` and `css:admin/colors`). Entries include `entity` and `column` from the record metadata.
|
|
1823
|
+
|
|
1824
|
+
Once generated, you can deploy by name or by UID:
|
|
1825
|
+
|
|
1826
|
+
```bash
|
|
1827
|
+
dbo deploy css:colors # deploy by key name
|
|
1828
|
+
dbo deploy cdlftyk2lkg21whojzqqoa # deploy by UID (scans manifest values)
|
|
1829
|
+
```
|
|
1830
|
+
|
|
1831
|
+
Entries are updated automatically on re-clone (path changes are reflected in place) and removed when you run `dbo rm`. When you `dbo mv` a file, the old entry is removed and a new entry is inserted with the correct key for the new path.
|
|
1832
|
+
|
|
1776
1833
|
#### Non-interactive mode (npm scripts)
|
|
1777
1834
|
|
|
1778
1835
|
When running `dbo deploy` (or any submission command) inside npm scripts or piped commands where stdin is not a TTY, the CLI automatically skips all interactive prompts and uses stored credentials:
|
package/bin/dbo.js
CHANGED
|
@@ -33,6 +33,7 @@ import { mvCommand } from '../src/commands/mv.js';
|
|
|
33
33
|
import { syncCommand } from '../src/commands/sync.js';
|
|
34
34
|
import { buildCommand } from '../src/commands/build.js';
|
|
35
35
|
import { runCommand } from '../src/commands/run.js';
|
|
36
|
+
import { tagCommand } from '../src/commands/tag.js';
|
|
36
37
|
|
|
37
38
|
// First-run welcome message
|
|
38
39
|
function checkFirstRun() {
|
|
@@ -95,6 +96,7 @@ program.addCommand(mvCommand);
|
|
|
95
96
|
program.addCommand(syncCommand);
|
|
96
97
|
program.addCommand(buildCommand);
|
|
97
98
|
program.addCommand(runCommand);
|
|
99
|
+
program.addCommand(tagCommand);
|
|
98
100
|
|
|
99
101
|
// Show welcome message on first run
|
|
100
102
|
checkFirstRun();
|
package/package.json
CHANGED
|
@@ -1,95 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
name: cli
|
|
3
|
+
description: Run DBO.io CLI commands for local file sync, project management, and deployment (push/pull/clone/add/rm/diff/build/deploy). NOT for direct API operations — use docs/ for that.
|
|
4
|
+
allowed-tools: Read, Write, Glob, Bash(git status:*), Bash(git branch:*), Bash(git diff:*), Bash(ls:*), Bash(dbo init:*), Bash(dbo login:*), Bash(dbo status:*), Bash(dbo deploy:*), Bash(dbo add:*), Bash(dbo clone:*), Bash(dbo push:*), Bash(dbo pull:*), Bash(dbo diff:*), Bash(dbo rm:*), Bash(dbo mv:*), Bash(dbo run:*), Bash(dbo install:*), Bash(git stash:*), Bash(grep:*), Bash(which dbo:*)
|
|
5
|
+
user-invokable: true
|
|
6
|
+
---
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
# DBO CLI Skill
|
|
4
9
|
|
|
5
|
-
|
|
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
|
|
10
|
+
Run `dbo` CLI commands for local file sync, project management, and deployment.
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
## When to use this skill
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
Use this skill when the user wants to:
|
|
15
|
+
- Run a local workflow command (push, pull, clone, add, rm, diff, build, deploy)
|
|
16
|
+
- Set up a project (`dbo init`, `dbo login`, `dbo clone`)
|
|
17
|
+
- Deploy files to the server (`dbo push`, `dbo deploy`)
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
## When NOT to use this skill
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
Do NOT use this skill for direct API operations. The following CLI commands are thin wrappers around REST endpoints — use the `docs/` reference instead for the canonical API syntax:
|
|
22
|
+
- `dbo input` wraps `POST /api/input/submit` — use `docs/dbo-cheat-sheet.md`
|
|
23
|
+
- `dbo output` wraps `GET /api/output/` — use `docs/dbo-output-query.md`
|
|
24
|
+
- `dbo content` wraps `GET /api/content/` — use `docs/dbo-cheat-sheet.md`
|
|
25
|
+
- `dbo media` wraps `GET /api/media/` — use `docs/dbo-cheat-sheet.md`
|
|
26
|
+
- `dbo upload` wraps `POST /api/upload/submit` — use `docs/dbo-cheat-sheet.md`
|
|
27
|
+
- `dbo message` wraps `GET /api/message/` — use `docs/dbo-cheat-sheet.md`
|
|
28
|
+
- `dbo cache` wraps `/api/cache/` — use `docs/dbo-cheat-sheet.md`
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
Also do NOT use this skill for:
|
|
31
|
+
- **Entity schemas / column names** — use `docs/dbo-core-entities.md`
|
|
32
|
+
- **Token/tag syntax** (`#{...}`, `<#_embed>`, etc.) — use `docs/dbo-cheat-sheet.md`
|
|
33
|
+
- **Building server-side templates or content records** — use `docs/`
|
|
22
34
|
|
|
23
|
-
|
|
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?
|
|
35
|
+
All doc files are bundled in the `docs/` subdirectory of this plugin (copied during npm publish). When working in the repo, the API docs are at the repo root `docs/` and the CLI README is at `tools/cli/README.md`.
|
|
43
36
|
|
|
44
|
-
|
|
37
|
+
For detailed CLI command flags, options, and behavior — read `docs/dbo-cli-readme.md`.
|
|
45
38
|
|
|
46
|
-
|
|
39
|
+
## Running commands
|
|
47
40
|
|
|
48
|
-
**
|
|
41
|
+
**If `$ARGUMENTS` is empty**, show the command table and guide interactively.
|
|
42
|
+
|
|
43
|
+
**If `$ARGUMENTS` is provided**, check if command exists in the command table in the available commands (use best guess, eg: initialize => init), then on match run the command:**:
|
|
49
44
|
|
|
50
45
|
```bash
|
|
51
46
|
dbo $ARGUMENTS
|
|
52
47
|
```
|
|
53
48
|
|
|
54
|
-
##
|
|
49
|
+
## Command overview
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
```bash
|
|
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
|
|
62
|
-
```
|
|
51
|
+
These are the local workflow commands this skill covers:
|
|
63
52
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
| Command | Description |
|
|
54
|
+
|---------|-------------|
|
|
55
|
+
| `init` | Initialize .dbo/ configuration |
|
|
56
|
+
| `login` / `logout` | Authenticate / clear session |
|
|
57
|
+
| `status` | Show config, domain, session info |
|
|
58
|
+
| `clone` | Clone an app to local project |
|
|
59
|
+
| `pull` | Pull records to local files |
|
|
60
|
+
| `push` | Push local changes (default: current dir) |
|
|
61
|
+
| `add` | Add a new file to DBO.io |
|
|
62
|
+
| `diff` | Compare local vs server |
|
|
63
|
+
| `rm` | Remove file, stage server deletion |
|
|
64
|
+
| `deploy` | Deploy via .dbo/deploy_config.json manifest |
|
|
65
|
+
| `build` | Run build hooks (.dbo/scripts.json) |
|
|
66
|
+
| `run` | Run named script (.dbo/scripts.json) |
|
|
67
|
+
| `install` | Install/upgrade CLI, plugins (alias: `i`) |
|
|
68
|
+
|
|
69
|
+
## Common workflows
|
|
74
70
|
|
|
75
|
-
### Build & deploy
|
|
76
71
|
```bash
|
|
77
|
-
|
|
78
|
-
dbo
|
|
79
|
-
dbo
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
# Setup
|
|
73
|
+
dbo init --domain my-domain.com --app myapp --clone
|
|
74
|
+
dbo login
|
|
75
|
+
|
|
76
|
+
# Edit and push
|
|
77
|
+
dbo push # push all changes in current dir
|
|
78
|
+
dbo push lib/bins/app/assets/ # push specific directory
|
|
79
|
+
dbo push colors.css # push single file
|
|
80
|
+
|
|
81
|
+
# Build and push (with script hooks)
|
|
82
|
+
dbo build # run build hooks only
|
|
83
|
+
dbo push # build + push (hooks run automatically)
|
|
84
|
+
dbo push --no-build # push without build phase
|
|
85
|
+
dbo push --no-scripts # push without any hooks
|
|
86
|
+
|
|
87
|
+
# Pull
|
|
88
|
+
dbo pull -e content --filter 'AppID=10100'
|
|
89
|
+
|
|
90
|
+
# Add new files
|
|
91
|
+
dbo add assets/css/newstyle.css
|
|
92
|
+
dbo add . # scan for un-added files
|
|
93
|
+
|
|
94
|
+
# Compare and merge
|
|
95
|
+
dbo diff # compare all local vs server
|
|
96
|
+
dbo diff -y # auto-accept all server changes
|
|
82
97
|
```
|
|
83
|
-
|
|
84
|
-
## Interactive Guidance
|
|
85
|
-
|
|
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
|
|
91
|
-
|
|
92
|
-
## Error Recovery
|
|
93
|
-
- Session/auth error: suggest `dbo login`
|
|
94
|
-
- No domain configured: suggest `dbo init`
|
|
95
|
-
- Command not found: suggest `dbo --help`
|
|
@@ -190,6 +190,17 @@ All configuration is **directory-scoped**. Each project folder maintains its own
|
|
|
190
190
|
|
|
191
191
|
> **Upgrading from pre-0.11.0**: `TransactionKeyPreset` now applies only to records that carry a `UID` column (core assets). Data records without a UID are always submitted with `RowID` regardless of the preset. Migration 001 runs automatically on first command after upgrade and logs a one-time notice.
|
|
192
192
|
|
|
193
|
+
> **Upgrading to 0.13.3+**: Entity and extension companion files no longer include `~UID` in the filename. Migration 007 automatically renames legacy `name~uid.Column.ext` files to `name.Column.ext` and updates `@references` in metadata.
|
|
194
|
+
|
|
195
|
+
> **Upgrading to 0.14.0+**: Metadata files now use `name.metadata~uid.json` instead of `name~uid.metadata.json`. The UID has moved from the base name into the `.metadata~uid` suffix. Migration 008 automatically renames all metadata files. Output child companions use index-based naming (`Sales.column.CustomSQL.sql`, `Sales.column-1.CustomSQL.sql`) instead of UID-based naming.
|
|
196
|
+
>
|
|
197
|
+
> | Record type | Example metadata file |
|
|
198
|
+
> |---|---|
|
|
199
|
+
> | Content | `colors.metadata~abc123.json` |
|
|
200
|
+
> | Media | `logo.png.metadata~def456.json` |
|
|
201
|
+
> | Output | `Sales.metadata~ghi789.json` |
|
|
202
|
+
> | Extension | `MyExtension.metadata~jkl012.json` |
|
|
203
|
+
|
|
193
204
|
#### Automatic migrations
|
|
194
205
|
|
|
195
206
|
When the CLI version is upgraded, one-time migration scripts in `tools/cli/src/migrations/` run automatically on the first command invocation in a project directory. Completed migration IDs are recorded in `.dbo/config.local.json` under `_completedMigrations` (per-user, gitignored) so each developer runs them independently and they never re-fire.
|
|
@@ -498,6 +509,8 @@ For each entity type, the CLI prompts to choose which column becomes the filenam
|
|
|
498
509
|
|
|
499
510
|
If any columns contain base64-encoded content, the CLI prompts to extract them as companion files. Extracted columns produce files named `<name>.<Column>.<ext>` alongside the metadata, with `@reference` entries in the metadata and a `_contentColumns` array.
|
|
500
511
|
|
|
512
|
+
**Companion file naming convention:** Only `.metadata.json` files carry the `~UID` suffix (e.g. `Add-Asst-Execute-Security~wxl6ivcwfkix3zgantszjg.metadata.json`). Companion content files use the natural base name without `~UID` (e.g. `Add-Asst-Execute-Security.String16.js`). If two records share the same name within a directory, the second gets a `-1` suffix (e.g. `Add-Asst-Execute-Security-1.String16.js` with metadata `Add-Asst-Execute-Security-1~otheruid.metadata.json`). Migration 007 automatically renames legacy `~UID` companion files to the natural convention.
|
|
513
|
+
|
|
501
514
|
Use `-y` to skip prompts (uses `Name` column, no content extraction).
|
|
502
515
|
|
|
503
516
|
#### Extension descriptor sub-directories
|
|
@@ -1308,6 +1321,31 @@ You can then choose to overwrite the server changes or cancel and pull first. Us
|
|
|
1308
1321
|
|
|
1309
1322
|
---
|
|
1310
1323
|
|
|
1324
|
+
### `dbo tag`
|
|
1325
|
+
|
|
1326
|
+
Apply macOS Finder color tags or Linux gio emblems to companion files based on their sync status relative to the server. Tags are automatically refreshed after `dbo clone` and `dbo push`.
|
|
1327
|
+
|
|
1328
|
+
| Tag | Color | Meaning |
|
|
1329
|
+
|-----|-------|---------|
|
|
1330
|
+
| `dbo:Synced` | 🟢 Green | File matches server — no local changes |
|
|
1331
|
+
| `dbo:Modified` | 🔵 Blue | Local edits not yet pushed |
|
|
1332
|
+
| `dbo:Untracked` | 🟡 Yellow | No metadata — not yet added with `dbo add` |
|
|
1333
|
+
| `dbo:Trashed` | 🔴 Red | File is in the `trash/` directory |
|
|
1334
|
+
|
|
1335
|
+
```bash
|
|
1336
|
+
dbo tag # Refresh tags for all project files
|
|
1337
|
+
dbo tag --clear # Remove all dbo:* tags (preserves other Finder tags)
|
|
1338
|
+
dbo tag --status # Show counts per category
|
|
1339
|
+
dbo tag --verbose # Log each file and its status
|
|
1340
|
+
dbo tag path/to/dir # Tag a specific file or directory subtree
|
|
1341
|
+
dbo tag --enable # Enable automatic tagging after clone/push (default)
|
|
1342
|
+
dbo tag --disable # Disable automatic tagging
|
|
1343
|
+
```
|
|
1344
|
+
|
|
1345
|
+
Tagging is silently skipped on Windows and unsupported platforms. Only macOS (Finder color tags via `xattr`) and Linux (gio emblems) are supported. The `--clear` flag only removes `dbo:*` prefixed tags, preserving any user-applied Finder tags.
|
|
1346
|
+
|
|
1347
|
+
---
|
|
1348
|
+
|
|
1311
1349
|
### `dbo rm`
|
|
1312
1350
|
|
|
1313
1351
|
Remove a file or directory locally and stage server deletions for the next `dbo push`. Similar to `git rm`.
|
|
@@ -1773,6 +1811,25 @@ Create a `.dbo/deploy_config.json` file to define named deployments:
|
|
|
1773
1811
|
|
|
1774
1812
|
This replaces the curl commands typically embedded in `package.json` scripts.
|
|
1775
1813
|
|
|
1814
|
+
#### Automatic deploy config generation
|
|
1815
|
+
|
|
1816
|
+
When you run `dbo clone` or `dbo add`, each companion file (CSS, JS, HTML, SQL, etc.) is automatically registered in `.dbo/deploy_config.json` under an `<extension>:<name>` key — no manual authoring needed:
|
|
1817
|
+
|
|
1818
|
+
```bash
|
|
1819
|
+
dbo clone # → .dbo/deploy_config.json auto-populated with one entry per companion file
|
|
1820
|
+
```
|
|
1821
|
+
|
|
1822
|
+
Keys are derived as `<extension>:<basename>` from the companion file path. If two files share the same key, a parent directory segment is appended to disambiguate (`css:colors` and `css:admin/colors`). Entries include `entity` and `column` from the record metadata.
|
|
1823
|
+
|
|
1824
|
+
Once generated, you can deploy by name or by UID:
|
|
1825
|
+
|
|
1826
|
+
```bash
|
|
1827
|
+
dbo deploy css:colors # deploy by key name
|
|
1828
|
+
dbo deploy cdlftyk2lkg21whojzqqoa # deploy by UID (scans manifest values)
|
|
1829
|
+
```
|
|
1830
|
+
|
|
1831
|
+
Entries are updated automatically on re-clone (path changes are reflected in place) and removed when you run `dbo rm`. When you `dbo mv` a file, the old entry is removed and a new entry is inserted with the correct key for the new path.
|
|
1832
|
+
|
|
1776
1833
|
#### Non-interactive mode (npm scripts)
|
|
1777
1834
|
|
|
1778
1835
|
When running `dbo deploy` (or any submission command) inside npm scripts or piped commands where stdin is not a TTY, the CLI automatically skips all interactive prompts and uses stored credentials:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cli
|
|
3
3
|
description: Run DBO.io CLI commands for local file sync, project management, and deployment (push/pull/clone/add/rm/diff/build/deploy). NOT for direct API operations — use docs/ for that.
|
|
4
|
+
allowed-tools: Read, Write, Glob, Bash(git status:*), Bash(git branch:*), Bash(git diff:*), Bash(ls:*), Bash(dbo init:*), Bash(dbo login:*), Bash(dbo status:*), Bash(dbo deploy:*), Bash(dbo add:*), Bash(dbo clone:*), Bash(dbo push:*), Bash(dbo pull:*), Bash(dbo diff:*), Bash(dbo rm:*), Bash(dbo mv:*), Bash(dbo run:*), Bash(dbo install:*), Bash(git stash:*), Bash(grep:*), Bash(which dbo:*)
|
|
4
5
|
user-invokable: true
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -39,7 +40,7 @@ For detailed CLI command flags, options, and behavior — read `docs/dbo-cli-rea
|
|
|
39
40
|
|
|
40
41
|
**If `$ARGUMENTS` is empty**, show the command table and guide interactively.
|
|
41
42
|
|
|
42
|
-
**If `$ARGUMENTS` is provided**, run
|
|
43
|
+
**If `$ARGUMENTS` is provided**, check if command exists in the command table in the available commands (use best guess, eg: initialize => init), then on match run the command:**:
|
|
43
44
|
|
|
44
45
|
```bash
|
|
45
46
|
dbo $ARGUMENTS
|
package/src/commands/add.js
CHANGED
|
@@ -8,13 +8,14 @@ import { log } from '../lib/logger.js';
|
|
|
8
8
|
import { shouldSkipColumn } from '../lib/columns.js';
|
|
9
9
|
import { loadAppConfig, loadAppJsonBaseline, saveAppJsonBaseline, loadExtensionDocumentationMDPlacement, loadDescriptorFilenamePreference, loadConfig } from '../lib/config.js';
|
|
10
10
|
import { resolveDirective, resolveTemplateCols, assembleMetadata, promptReferenceColumn, setTemplateCols, saveMetadataTemplates, loadMetadataTemplates } from '../lib/metadata-templates.js';
|
|
11
|
-
import {
|
|
11
|
+
import { hasUidInFilename, buildMetaFilename, isMetadataFile } from '../lib/filenames.js';
|
|
12
12
|
import { setFileTimestamps } from '../lib/timestamps.js';
|
|
13
13
|
import { checkStoredTicket, clearGlobalTicket } from '../lib/ticketing.js';
|
|
14
14
|
import { checkModifyKey, isModifyKeyError, handleModifyKeyError } from '../lib/modify-key.js';
|
|
15
15
|
import { loadIgnore } from '../lib/ignore.js';
|
|
16
16
|
import { loadStructureFile, findBinByPath, BINS_DIR } from '../lib/structure.js';
|
|
17
17
|
import { runPendingMigrations } from '../lib/migrations.js';
|
|
18
|
+
import { upsertDeployEntry } from '../lib/deploy-config.js';
|
|
18
19
|
|
|
19
20
|
// ─── File type classification for auto-detection in bin directories ────────
|
|
20
21
|
|
|
@@ -673,8 +674,7 @@ export async function submitAdd(meta, metaPath, filePath, client, options) {
|
|
|
673
674
|
// Companion file NOT renamed — only update UID in metadata and rename metadata file
|
|
674
675
|
const metaDir = dirname(metaPath);
|
|
675
676
|
const metaBase = basename(metaPath, '.metadata.json');
|
|
676
|
-
const
|
|
677
|
-
const newMetaPath = join(metaDir, `${newMetaBase}.metadata.json`);
|
|
677
|
+
const newMetaPath = join(metaDir, buildMetaFilename(metaBase, returnedUID));
|
|
678
678
|
|
|
679
679
|
meta.UID = returnedUID;
|
|
680
680
|
|
|
@@ -695,9 +695,14 @@ export async function submitAdd(meta, metaPath, filePath, client, options) {
|
|
|
695
695
|
const ref = meta[col];
|
|
696
696
|
if (ref && String(ref).startsWith('@')) {
|
|
697
697
|
const fp = join(metaDir, String(ref).substring(1));
|
|
698
|
+
await upsertDeployEntry(fp, returnedUID, entity, col);
|
|
698
699
|
try { await setFileTimestamps(fp, returnedLastUpdated, returnedLastUpdated, serverTz); } catch {}
|
|
699
700
|
}
|
|
700
701
|
}
|
|
702
|
+
if (meta._mediaFile && String(meta._mediaFile).startsWith('@')) {
|
|
703
|
+
const mediaFp = join(metaDir, String(meta._mediaFile).substring(1));
|
|
704
|
+
await upsertDeployEntry(mediaFp, returnedUID, entity, 'File');
|
|
705
|
+
}
|
|
701
706
|
} catch { /* non-critical */ }
|
|
702
707
|
}
|
|
703
708
|
|
|
@@ -820,10 +825,10 @@ export async function findUnaddedFiles(dir, ig, referencedFiles) {
|
|
|
820
825
|
const entries = await readdir(dir, { withFileTypes: true });
|
|
821
826
|
|
|
822
827
|
// Build a set of filenames referenced by sibling metadata in this directory.
|
|
823
|
-
// This handles the ~UID naming convention: colors~uid.
|
|
828
|
+
// This handles the ~UID naming convention: colors.metadata~uid.json → @colors.css
|
|
824
829
|
const localRefs = new Set();
|
|
825
830
|
for (const entry of entries) {
|
|
826
|
-
if (!entry.name
|
|
831
|
+
if (!isMetadataFile(entry.name)) continue;
|
|
827
832
|
try {
|
|
828
833
|
const raw = await readFile(join(dir, entry.name), 'utf8');
|
|
829
834
|
if (!raw.trim()) continue;
|
|
@@ -853,7 +858,7 @@ export async function findUnaddedFiles(dir, ig, referencedFiles) {
|
|
|
853
858
|
}
|
|
854
859
|
|
|
855
860
|
// Skip metadata files themselves
|
|
856
|
-
if (entry.name
|
|
861
|
+
if (isMetadataFile(entry.name)) continue;
|
|
857
862
|
// Skip ignored files
|
|
858
863
|
if (ig.ignores(relPath)) continue;
|
|
859
864
|
|
|
@@ -899,7 +904,7 @@ async function _scanMetadataRefs(dir, referenced) {
|
|
|
899
904
|
continue;
|
|
900
905
|
}
|
|
901
906
|
|
|
902
|
-
if (!entry.name
|
|
907
|
+
if (!isMetadataFile(entry.name)) continue;
|
|
903
908
|
|
|
904
909
|
try {
|
|
905
910
|
const raw = await readFile(fullPath, 'utf8');
|