@carllee1983/dbcli 1.52.0 → 1.53.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/.cursor/rules/dbcli.mdc +39 -28
- package/.cursor/skills/dbcli/reference.md +233 -21
- package/.github/skills/dbcli/SKILL.md +36 -25
- package/.github/skills/dbcli/reference.md +233 -21
- package/CHANGELOG.md +38 -0
- package/assets/SKILL.md +36 -25
- package/assets/SKILL.zh-TW.md +48 -30
- package/assets/reference.md +233 -21
- package/assets/ui-template.html +2 -2
- package/dist/cli-runtime.mjs +101686 -0
- package/dist/cli.mjs +140 -109572
- package/dist/core.d.ts +4 -0
- package/dist/core.mjs +157 -254
- package/dist/ui-style.css +2 -2
- package/package.json +4 -4
- package/plugins/dbcli-agent/skills/dbcli/SKILL.md +36 -25
- package/plugins/dbcli-agent/skills/dbcli/reference.md +233 -21
- package/skills/dbcli/SKILL.md +36 -25
- package/skills/dbcli/reference.md +233 -21
package/.cursor/rules/dbcli.mdc
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
description: Database CLI for AI agents with permission-gated access to MySQL, PostgreSQL, MariaDB, MongoDB, Redis, and Elasticsearch. Trigger when: wiring up a connection (`.dbcli` / `.env`, v1 single vs v2 multi-connection, auth mode); running SQL / MongoDB JSON / Redis commands / Elasticsearch DSL; inspecting table, collection, key, or index structure; writing rows or exporting results; building a report, dashboard, or HTML UI; authoring or reviewing a schema design; protecting sensitive data with the blacklist; or recovering after a failed command. For exhaustive flags and examples, read the companion `../skills/dbcli/reference.md`.
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
4
5
|
---
|
|
5
|
-
|
|
6
6
|
# dbcli
|
|
7
7
|
|
|
8
8
|
Database CLI for AI agents with permission-based access control.
|
|
@@ -71,7 +71,7 @@ afterwards add only the `@diag/*` it does not cover (`missing-indexes`, `locks`,
|
|
|
71
71
|
`export` / `schema` / `inspect` / `lint` / `diff --against-orm`. The command emits a `RecoveryEnvelope` to stdout and saves
|
|
72
72
|
it to `.dbcli/last-recovery.json`; then `dbcli recover` inspects it and `dbcli recover --apply`
|
|
73
73
|
runs the saved plan under risk gating. Multi-turn `--next`, connection branching, and the
|
|
74
|
-
post-apply verify probe are documented in reference.md
|
|
74
|
+
post-apply verify probe are documented in [reference.md](../skills/dbcli/reference.md#recovery-cookbook-agent-walkthroughs).
|
|
75
75
|
|
|
76
76
|
When reporting a check's outcome use the vocabulary `verified` (evidence matched) /
|
|
77
77
|
`not_verified` (check ran and contradicted) / `indeterminate` (ran but ambiguous) /
|
|
@@ -110,8 +110,8 @@ still stop where those gates require human confirmation.
|
|
|
110
110
|
term, or relationship/join intent instead of a physical table or field name, first run
|
|
111
111
|
`dbcli skill context --format json`. If it includes `semantic`, treat that reviewed
|
|
112
112
|
section as the governed vocabulary; use `dbcli semantic search <terms> --format json`
|
|
113
|
-
to look up a specific term. If
|
|
114
|
-
fall back to `blacklist` → `schema` mapping and tell the user that optional
|
|
113
|
+
to look up a specific term. If `contracts` is present, use only its approved terms and
|
|
114
|
+
their descriptive evidence policy; it never authorizes an assertion or query. If no semantic section exists or search returns no result, fall back to `blacklist` → `schema` mapping and tell the user that optional
|
|
115
115
|
`dbcli.semantic.json` can make future requests consistent. Never create, update, or
|
|
116
116
|
migrate that file without an explicit human request; semantic vocabulary never replaces
|
|
117
117
|
schema confirmation or the normal query/write safety gates.
|
|
@@ -157,6 +157,9 @@ in **How to use dbcli** still applies.
|
|
|
157
157
|
| DB report / dashboard request | `blacklist list` → `queries search <keywords>` / `queries suggest <intent>` → `queries show @<name>` → `q @<name> --ui` or `--format html` |
|
|
158
158
|
| Application data bug | `audit tail --for-agent --n 10` → `blacklist list` → `schema <object>` → narrow query |
|
|
159
159
|
| ORM or migration work | `schema --format json` → `diff --against-orm <orm-schema>` → review error-level drift → proposals via `migrate` (dry-run) → `migration-review` task pack → `diff --against <snapshot>` after applying. |
|
|
160
|
+
| Schema design, no database yet | `design init --output ./dbcli.design.json` → edit → `design validate` → `design render --format mermaid`. With existing ORM models, reconcile via `design diff --against-orm <path>` first. |
|
|
161
|
+
| Design drift on a live database | `blacklist list` → `schema --format json` → `design diff --against-cache` → `design propose --against-cache`, then hand the plan to a human before any migration. |
|
|
162
|
+
| PR schema-change review | `blacklist list` → `impact assess --design ./dbcli.design.json --against-cache --output ./impact.json --fail-on warn`; optionally add explicit `--events ./.dbcli/proxy/events.jsonl` for advisory redacted workload table evidence (never SQL/log rendering or a blocker), then review declared findings, coverage gaps, and the optional reviewed `dbcli.data-access.json` (declared operations only; never source parsing). |
|
|
160
163
|
| PR database review | Review changed persistence paths, then propose concrete `schema` / `plan` / `dry-run` / `report` / `guide` commands per material claim. |
|
|
161
164
|
| Slow endpoint or query | `report --section perf` → task pack `analyze-table-perf` → `lint "<query>"` → `guide missing-index-for "<query>"`; use `proxy analyze` when logs exist. |
|
|
162
165
|
| Safe data backfill | `blacklist list` → `schema <object>` → count/scope query → `update … --dry-run` → read-back or snippet `--verify`. |
|
|
@@ -193,12 +196,16 @@ Guardrails:
|
|
|
193
196
|
- Separate database facts from application-code inference. Report which dbcli output shaped the conclusion.
|
|
194
197
|
- For writes and backfills, include scope count, dry-run preview, execution command, and read-back.
|
|
195
198
|
- Do not create indexes directly from a performance suggestion; turn them into reviewed migrations.
|
|
199
|
+
- Do not execute the `commands` in a `design propose` plan, and do not create or rewrite
|
|
200
|
+
`dbcli.design.json` unless a human asked for it.
|
|
196
201
|
- Do not print credentials, copied connection strings, or blacklisted values.
|
|
197
202
|
- Durable evidence: `assert … --write-verification-artifact --verification-subject <kind:name>`;
|
|
198
203
|
inspect with `verification summary` / `list` / `show <id>`. The `verify safe-backfill` /
|
|
199
204
|
`migration` / `rollback --kind <ddl|dml>` / `constraint --check <fk|not-null|unique|custom>`
|
|
200
|
-
family runs preflight + `--after-write` checks and **never executes the write**.
|
|
201
|
-
|
|
205
|
+
family runs preflight + `--after-write` checks and **never executes the write**. Add
|
|
206
|
+
`--evidence-receipt <workspace-relative-path>` only after after-write for a safe provenance
|
|
207
|
+
receipt; it is never approval to execute a write. Full flags
|
|
208
|
+
and the per-command blocks are in [reference.md](../skills/dbcli/reference.md#commands).
|
|
202
209
|
|
|
203
210
|
## Audit log
|
|
204
211
|
|
|
@@ -215,7 +222,7 @@ The `inspect` / `guide` / `recover` agent JSON embeds `audit_recent` (last 5 ent
|
|
|
215
222
|
fresh session has immediate history. An envelope's `audit_ref` and an audit entry's
|
|
216
223
|
`recovery_ref` point at each other, so you can pivot either way. Audit is on by default
|
|
217
224
|
(`audit.enabled = false` to opt out); entries are metadata-only (never SQL bodies, `--param`
|
|
218
|
-
values, or result cells) and rotate at ~10 MB / 1000 entries. Full flags: reference.md
|
|
225
|
+
values, or result cells) and rotate at ~10 MB / 1000 entries. Full flags: [reference.md](../skills/dbcli/reference.md#audit).
|
|
219
226
|
|
|
220
227
|
## Quick start
|
|
221
228
|
|
|
@@ -318,7 +325,7 @@ dbcli --global query "SELECT 1"
|
|
|
318
325
|
Each named connection has its own schema cache at `.dbcli/schemas/<connection>/`. Run
|
|
319
326
|
`dbcli schema --use <name>` once per connection **before** `schema <table>` — otherwise the
|
|
320
327
|
cache may serve another connection's columns. `schema --refresh` / `--reset` manage the cache
|
|
321
|
-
(reference.md). `--skip-test` skips the init-time TCP connection test; it is implied
|
|
328
|
+
(../skills/dbcli/reference.md). `--skip-test` skips the init-time TCP connection test; it is implied
|
|
322
329
|
automatically when `--use-env-refs` is set (the `$env` refs have no value to connect with yet).
|
|
323
330
|
`--system` is optional for v2 — without it the engine is inferred from `--env-file` / `.env`
|
|
324
331
|
(`DATABASE_URL` scheme), defaulting to `postgresql`.
|
|
@@ -371,7 +378,7 @@ refs have no value to connect with yet.
|
|
|
371
378
|
- **Re-running `init`** — refuses to overwrite without `--force`; never use
|
|
372
379
|
`--force` to "fix" a config full of `{ "$env": "..." }` refs.
|
|
373
380
|
|
|
374
|
-
Full flags and edge cases: see [reference.md](reference.md)
|
|
381
|
+
Full flags and edge cases: see [reference.md](../skills/dbcli/reference.md#init).
|
|
375
382
|
|
|
376
383
|
## Command overview
|
|
377
384
|
|
|
@@ -382,34 +389,36 @@ Full flags and edge cases: see [reference.md](reference.md) `init` section.
|
|
|
382
389
|
| `list` | query-only+ | Tables (SQL), collections (MongoDB), keys (Redis), or indices (Elasticsearch). |
|
|
383
390
|
| `schema` | query-only+ | SQL: per-table or full scan into `.dbcli/schemas/`. MongoDB: sampled. ES: flattened mapping. Redis: per-key only (type/TTL/size). Supports `--recovery`. |
|
|
384
391
|
| `query` | query-only+ | SQL, Mongo JSON (`--collection`), Redis command, or ES DSL/Lucene (`--collection`). `--format table\|json\|csv\|html`, `--ui` to open the interactive dashboard in a browser. `--fields` (projection), `--truncate` (cell width), `-f/--query-file` (read query from file or stdin), `--use a,b` (read-only fan-out). Supports `--recovery`. `--slow-ms <n>` sets the passive slow-query hint threshold (default 1000, `0` off): at or above it, table output gains a `Performance hint` footer and JSON gains `metadata.performanceAdvisory`; it runs no extra diagnostics and is suppressed under `--recovery`. Distinct from the `proxy` flag of the same name. See **Query workflow flags**. |
|
|
385
|
-
| `explain` | query-only+ |
|
|
392
|
+
| `explain` | query-only+ | Read-only query plan with annotations. SQL only. Single query, `@saved-query`, `@file.sql`, or `--bulk @glob/*`. `--analyze` (EXPLAIN ANALYZE / MariaDB ANALYZE SELECT), `--format markdown\|json\|table`. |
|
|
386
393
|
| `lint` | n/a | Static SQL anti-pattern advisor (no DB connection). 9 rules incl. schema-aware implicit-cast / NOT IN-nullable checks via the layered `.dbcli/schemas/` cache; global `--use <conn>` selects a named cache. Findings carry rewrite drafts + guarded `explain` verify commands (`--analyze` only for proven read-only SQL) — report-only, never executes. `--format text\|json\|markdown`, `--min-severity`, `--no-schema`, `--bulk`. Supports `--recovery`. |
|
|
387
394
|
| `plan` | n/a | Static SQL risk analyzer (`--format text\|json`); classifies a statement without connecting to the database. |
|
|
388
395
|
| `q` | query-only+ | Run a saved snippet by `@name` with `--param k=v`. Supports `--verify` to run assertions and `--slow-ms <n>` (same passive slow-query hint as `query`). |
|
|
389
396
|
| `queries` | n/a | Manage saved snippets: `list` / `show` / `search` / `suggest` / `new` / `edit` / `check` / `delete` / `rename` / `copy` / `import` / `export`. |
|
|
390
397
|
| `insert` / `update` | read-write+ | SQL or MongoDB only. JSON `--data` / `--set`; `--where` required on `update`; `--dry-run` first. Redis writes go through `query`. Supports `--recovery`. |
|
|
391
398
|
| `delete` | data-admin+ | SQL or MongoDB; Redis has a basic implementation (see Redis section). `--where` required; `--dry-run` first. Supports `--recovery`. |
|
|
392
|
-
| `export` | query-only+ | SQL, MongoDB, or
|
|
399
|
+
| `export` | query-only+ | SQL, MongoDB, or Elasticsearch (DSL `--index` or whole-index scroll). Query → `--format json\|jsonl\|csv\|html` file or stdout. `html` emits a standalone interactive dashboard. **Fails closed rather than truncating silently**: if the auto-limit would drop rows, the export errors out and you must pass `--no-limit` or `--limit N`. Supports `--recovery`. |
|
|
393
400
|
| `blacklist` | n/a | `list` / `table` / `column` subcommands redact sensitive data from query results. |
|
|
394
401
|
| `check` | query-only+ | SQL only (best on MySQL/MariaDB). |
|
|
395
|
-
| `diff` | query-only+ | SQL only. Save/compare schema snapshots.
|
|
396
|
-
| `
|
|
397
|
-
| `
|
|
402
|
+
| `diff` | query-only+ | SQL only. Save/compare schema snapshots. `--against-orm <path>` compares a Prisma schema / DDL file / normalized JSON against the local schema cache (no DB connection): categorized drift (`missing_in_db` = error, `missing_in_orm` = warn, `mismatch` per tolerance table, `unmanaged`) with dry-run `migrate` proposals; exit 1 on error-level drift. `--orm-format prisma\|ddl\|json\|drizzle\|typeorm\|sequelize`, `--ignore <globs>`, `--format json\|table\|markdown`. Drizzle: point at `drizzle/meta/<NNNN>_snapshot.json` (run `drizzle-kit generate` first; `.ts` sources are rejected with a hint). TypeORM/Sequelize: feed tool-generated DDL (`schema:log` / a schema-only dump); source files are rejected with the exact generation command to run. |
|
|
403
|
+
| `design` | n/a | Offline SQL design assistant over a version-controlled `dbcli.design.json`: never connects, never runs DDL, never calls a provider. `init --output <path>` is the only writer and refuses to overwrite; `validate` is fail-closed, so `render` / `diff` / `propose` refuse to run while `error` findings remain. `diff` / `propose` need exactly one of `--against-cache` or `--against-orm <paths>`. **`propose` is review-only — it plans, it never writes.** Naming rules, finding codes, and the artifact shape are in [reference.md](../skills/dbcli/reference.md#design). |
|
|
404
|
+
| `snapshot` | query-only+ | SQL only. Capture a result fingerprint (`rowCount` + per-column null/distinct/min/max/sum + order-independent checksum). `--out` (default `.dbcli/snapshots/snap-<ts>.json`), `--rows`, `--stdout`, `--format`, `--no-limit`. Baseline for `assert --against`. |
|
|
405
|
+
| `assert` | query-only+ | SQL only. Verify an invariant; exit 1 on failure unless `--no-fail`. `--expect "rows>0\|value==X\|col:c not null\|unique\|between a and b\|>= n"`, `--vs <query> --compare rows\|value` (reconcile), `--against <snapshot> --tolerance <pct>`. |
|
|
398
406
|
| `verification` | n/a | Inspect and manage local verification artifacts. `list` / `show <id-or-path>` / `summary` are read-only; `prune` is dry-run by default and deletes only with `--execute --force`. Reads `<cwd>/.dbcli/verification/`; no DB connection, no audit writes. |
|
|
399
407
|
| `backfill artifact` | n/a | Build a bounded, reviewable source-to-SQL backfill artifact from JSON. Includes source/target identity, blacklist/schema preflight, read-back verification, and rollback hints; dry-run only and never executes writes. |
|
|
400
|
-
| `proxy` | n/a |
|
|
408
|
+
| `proxy` | n/a | MySQL/MariaDB/PostgreSQL only. Local-dev observability proxy — relays app traffic to the real DB and appends query/latency/byte/error events to `.dbcli/proxy/events.jsonl`. Observe-only. `proxy analyze` aggregates that log offline (summary, byFingerprint, slowest, errors, hotTables, N+1; `--format markdown` produces the QueryLens report) and errors out if no events exist. Act on it: run each finding's `suggestedCommands`, read its `hints`, then propose the fix — never guess a table name, confirm with `schema`. Protect the log itself with `--redact literals`. [Flags](../skills/dbcli/reference.md#proxy). |
|
|
401
409
|
| `status` | query-only+ | Safe JSON/text summary (no credentials). |
|
|
402
|
-
| `inspect` | query-only+ | Read-only context snapshot (connection, permission, blacklist, objects, snippets, context-aware `suggestedCommands`, and
|
|
410
|
+
| `inspect` | query-only+ | Read-only context snapshot (connection, permission, blacklist, objects, snippets, context-aware `suggestedCommands`, and human-readable `hints`). `--for-agent` / `--brief` / `--no-connect` / `--require-schema-cache`. Supports `--recovery`. |
|
|
403
411
|
| `report` | query-only+ | Diagnostic report built from `@diag/*` snippets. `--section <health\|capacity\|perf>` (comma-separated to combine), `--brief`, `--for-agent`, `--no-connect`. |
|
|
404
|
-
| `guide` | query-only+ | Deterministic next-command plan for a fixed goal (`slow-query`, `capacity`, `health`, `index-usage`, `permissions`, `schema-overview`). `--list` to enumerate.
|
|
412
|
+
| `guide` | query-only+ | Deterministic next-command plan for a fixed goal (`slow-query`, `capacity`, `health`, `index-usage`, `permissions`, `schema-overview`). `--list` to enumerate. `guide missing-index-for <query>` suggests composite indexes for a single SELECT (`--format yaml\|json\|markdown`, `--min-confidence`). |
|
|
405
413
|
| `recovery` | n/a | Look up the structured `RecoveryEnvelope` for a known error code (`--code <CODE>` or `--list`). Standalone synthesizer; does not require a real failure. |
|
|
406
414
|
| `recover` | n/a | Inspect (default) or `--apply` the auto-saved recovery plan in `.dbcli/last-recovery.json`. `--allow-write=readonly-cmd\|write-cmd`, `--no-verify`, `--from <file>`, `--next --after-step <n> --result <json\|@file>` for multi-turn step-at-a-time. |
|
|
407
415
|
| `doctor` | n/a | Environment/runtime identity, config, connection, SRV diagnostics (Mongo), schema cache age. `--format json --remediation` emits candidate-only blacklist/schema/bounded-sample plans (SQL: `dbcli plan` → human-confirmed bounded `dbcli query`; MongoDB/Elasticsearch: `dbcli schema` preflight → human-confirmed bounded query); it never applies them. |
|
|
408
416
|
| `completion` | n/a | bash / zsh / fish scripts. |
|
|
409
417
|
| `upgrade` | n/a | Self-update from npm; 24h-cached version hints on every command. |
|
|
410
|
-
| `shell` | (same as query+) | Interactive REPL. SQL engines, MongoDB, and Redis (single-line; `.no-limit on/off`).
|
|
418
|
+
| `shell` | (same as query+) | Interactive REPL. SQL engines, MongoDB, and Redis (single-line; `.no-limit on/off`). Elasticsearch opens a Kibana Dev Tools-style REPL (`<METHOD> /<path>` + optional JSON body, blank line submits). |
|
|
411
419
|
| `skill` | n/a | Generate / install AI skill docs (`--install <claude\|gemini\|antigravity\|copilot\|cursor\|codex\|windsurf>`); `skill tasks list/show/plan` for Agent Task Packs; `skill context` for an LLM prompt-context payload (for injecting into another LLM, not needed for normal operation). |
|
|
412
420
|
| `semantic` | n/a | Validate, search, inspect drift, migrate to v2, or print the optional project-root `dbcli.semantic.json`. Give its reviewed context to an external agent, but keep provider credentials, prompts, and agent context outside dbcli. `semantic draft validate --input <file|-> [--format text\|json]` validates only the explicit untrusted `QueryDraft` offline against local semantic/schema/saved-query metadata; it returns safe hashes/references/violation codes, never executes or echoes candidate SQL. Review the original draft, then invoke `explain` or `query` separately if intended. |
|
|
421
|
+
| `contract` | n/a | Validate, inspect approved context, search, or inspect drift for optional project-root `dbcli.contracts.json`. Contracts add ownership and a descriptive evidence policy to canonical semantic references; they are offline, never execute SQL, and cannot create verification or query authority. `skill context` includes only valid approved contracts. |
|
|
413
422
|
| `migrate` | admin | SQL only. **DDL; dry-run by default** — needs `--execute`. |
|
|
414
423
|
|
|
415
424
|
Use root-level `dbcli --use <name> <command>` for any command; `query`, `schema`, `list`,
|
|
@@ -475,12 +484,12 @@ truncation from a round number. This applies to `query` and to `q` snippets
|
|
|
475
484
|
explicit operators (`$set`/`$inc`/`$push`/…) pass through. Nested blacklist accepts dotted
|
|
476
485
|
paths (`profile.email`) and trailing wildcards (`profile.tokens.*`). Saved snippets end in
|
|
477
486
|
`.mongodb.sql` (frontmatter `engine: mongodb`, `operation: find|aggregate`). Full
|
|
478
|
-
write-planner tiers and syntax: reference.md
|
|
487
|
+
write-planner tiers and syntax: [reference.md](../skills/dbcli/reference.md#mongodb-support).
|
|
479
488
|
|
|
480
489
|
## Redis
|
|
481
490
|
|
|
482
491
|
- `query` runs a single **whitelisted** Redis command (e.g. `GET`, `SET`, `HSET`, `DEL`).
|
|
483
|
-
The full whitelist and the per-command permission tier are defined in reference.md.
|
|
492
|
+
The full whitelist and the per-command permission tier are defined in [reference.md](../skills/dbcli/reference.md#redis-support).
|
|
484
493
|
- **Supported:** `init`, `list` (keys via SCAN), `schema <key>` (type / TTL / size / sample),
|
|
485
494
|
`query`, `q` (saved snippets — **read-only commands only**), `delete` (basic implementation:
|
|
486
495
|
`DEL` / `HDEL` / `LREM` / `SREM` / `ZREM`, needs `data-admin`; `query "DEL <key>"` also
|
|
@@ -493,7 +502,7 @@ truncation from a round number. This applies to `query` and to `q` snippets
|
|
|
493
502
|
blacklist (matching reads/writes are rejected). To preview a delete, use `delete <key> --dry-run`.
|
|
494
503
|
- `database` is the logical DB index (default `0`). `dbcli blacklist table add 'secrets:*'`
|
|
495
504
|
registers a key glob; an optional `redis.mask` block masks values on read. Size guards
|
|
496
|
-
(SCAN/HGETALL truncation, `--no-limit` to bypass) and masking details: reference.md
|
|
505
|
+
(SCAN/HGETALL truncation, `--no-limit` to bypass) and masking details: [reference.md](../skills/dbcli/reference.md#redis-support).
|
|
497
506
|
|
|
498
507
|
## Elasticsearch
|
|
499
508
|
|
|
@@ -505,12 +514,14 @@ dbcli query '{"query":{"match":{"status":"active"}}}' --collection orders
|
|
|
505
514
|
|
|
506
515
|
- `query` takes a DSL (JSON body) or Lucene query string; `--collection <index>` is required.
|
|
507
516
|
- **Supported:** `init`, `list` (indices with doc count), `schema [index]` (flattened mapping),
|
|
508
|
-
`query`, `
|
|
517
|
+
`query`, `q` (snippets use the `.elasticsearch.sql` extension), `export`,
|
|
518
|
+
`shell`, `status`, `use`, `doctor`. **Not supported:**
|
|
509
519
|
`insert`, `update`, `delete`, `check`, `diff`, `migrate`.
|
|
510
520
|
- `export` takes a search DSL with `--index <index>`, or an index name as the query to scroll
|
|
511
|
-
the whole index via `match_all`. Query-only caps at 1000 hits; `--no-limit`
|
|
521
|
+
the whole index via `match_all`. Query-only caps at 1000 hits; `--no-limit` streams the whole
|
|
522
|
+
index via the scroll API. (The 10 000 bound belongs to `query`, not `export`.)
|
|
512
523
|
- Schema flattens nested fields (`a.b.c`) and surfaces `.fields` multi-fields. `shell` opens a
|
|
513
|
-
Kibana Dev Tools-style REPL. Full syntax and examples: reference.md
|
|
524
|
+
Kibana Dev Tools-style REPL. Full syntax and examples: [reference.md](../skills/dbcli/reference.md#elasticsearch-support).
|
|
514
525
|
|
|
515
526
|
## Saved queries
|
|
516
527
|
|
|
@@ -575,7 +586,7 @@ dbcli export "SELECT * FROM orders" --format html --output orders.html
|
|
|
575
586
|
When a saved snippet exists, prefer `q @<name> --ui` / `q @<name> --format html` because snippet
|
|
576
587
|
metadata can drive titles, KPI cards, and charts. Blacklist redaction is applied **before**
|
|
577
588
|
rendering. To get KPIs and charts instead of a plain table, add a `visual:` block (`title`,
|
|
578
|
-
`kpis[]`, `charts[]`) to the snippet frontmatter — see reference.md for the full `visual:`
|
|
589
|
+
`kpis[]`, `charts[]`) to the snippet frontmatter — see [reference.md](../skills/dbcli/reference.md#interactive-html-dashboard) for the full `visual:`
|
|
579
590
|
schema. Raw `query` / `export` invocations render a sortable table only.
|
|
580
591
|
|
|
581
592
|
## Common workflows
|
|
@@ -592,6 +603,6 @@ schema. Raw `query` / `export` invocations render a sortable table only.
|
|
|
592
603
|
|
|
593
604
|
- Query-only mode auto-appends `LIMIT 1000`; add `--no-limit` for `information_schema` or statements that break with `LIMIT`.
|
|
594
605
|
- Blacklisted tables and columns are redacted from query output.
|
|
595
|
-
- `schema` reports `estimatedRowCount` and `sizeCategory` (small / medium / large / huge). For large/huge tables add `WHERE` or `LIMIT` — bands in reference.md.
|
|
606
|
+
- `schema` reports `estimatedRowCount` and `sizeCategory` (small / medium / large / huge). For large/huge tables add `WHERE` or `LIMIT` — bands in [reference.md](../skills/dbcli/reference.md#schema).
|
|
596
607
|
- `doctor` on `mongodb+srv://` reports whether SRV resolves natively or through the DoH fallback — useful when the runtime restricts DNS.
|
|
597
608
|
- **Global flags:** `--version`, `--config <path>`, `--global`, `--use <name>`, `--timeout <ms>`, `-v` / `--verbose` / `-vv`, `-q` / `--quiet`, `--no-color` (also honours `NO_COLOR`). Root-level flags must precede the command unless the command explicitly declares a command-level option.
|