aiex-cli 0.0.3-beta.5 → 0.0.3-beta.6

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 CHANGED
@@ -37,7 +37,7 @@ aiex watch -s invoice -d ./watch_folder # watch folder daemon for automatic extr
37
37
  - **Interactive Mode** — Run `aiex extract` without arguments for a guided extraction workflow
38
38
  - **Batch Mode** — `aiex extract -d <dir>` processes entire directories with optional glob filtering
39
39
  - **Incremental Extraction** — File hash deduplication skips already-processed files; use `--force` to override
40
- - **Data Export** — `aiex export` exports SQLite tables to CSV or Excel (.xlsx)
40
+ - **Data Dump** — `aiex dump` exports SQLite tables to CSV or Excel (.xlsx)
41
41
  - **Notion Sync** — Optionally sync CLI extraction results to configured Notion data sources
42
42
  - **Extraction Audit Trail** — Every extraction is recorded with status, input source, output path, token usage, database inserts, Notion pages, and errors
43
43
  - **Built-in Model Registry** — Knows capabilities of 2000+ models (vision, structured output) so you don't have to guess
@@ -104,15 +104,15 @@ aiex watch -s <schema> -d <folder>
104
104
 
105
105
  Runs a background watcher daemon to monitor a folder for new incoming files (such as scanned documents or downloads), automatically performing offline data extraction, database insertion, and system notifications.
106
106
 
107
- ### 5. Export Data
107
+ ### 5. Dump Data
108
108
 
109
109
  ```bash
110
- aiex export -s <schema> # export to CSV (default)
111
- aiex export -s <schema> -f xlsx -o output.xlsx # export to Excel
112
- aiex export -t <table> -f csv -o output.csv # export a specific table by name
110
+ aiex dump -s <schema> # dump to CSV (default)
111
+ aiex dump -s <schema> -f xlsx -o output.xlsx # dump to Excel
112
+ aiex dump -t <table> -f csv -o output.csv # dump a specific table by name
113
113
  ```
114
114
 
115
- Exports all extracted data for a given schema (or table) from the SQLite database to CSV or Excel format.
115
+ Dumps all extracted data for a given schema (or table) from the SQLite database to CSV or Excel format.
116
116
 
117
117
  <br>
118
118
 
@@ -137,14 +137,16 @@ Exports all extracted data for a given schema (or table) from the SQLite databas
137
137
  | `aiex extract rm <audit-id>` | Delete an audit record and its cached upload |
138
138
  | `aiex watch -s <name> -d <dir>` | Watch a directory for new files and automatically extract data |
139
139
  | `aiex watch -s <name> -d <dir> --no-insert` | Watch and save JSON without inserting into SQLite |
140
- | `aiex export -s <name>` | Export extracted data for a schema to CSV |
141
- | `aiex export -s <name> -f xlsx -o <file>` | Export to Excel (.xlsx) |
140
+ | `aiex dump -s <name>` | Dump extracted data for a schema to CSV |
141
+ | `aiex dump -s <name> -f xlsx -o <file>` | Dump to Excel (.xlsx) |
142
142
  | `aiex doctor` | System and configuration diagnostics |
143
143
  | `aiex completion bash\|zsh\|fish` | Generate shell completion scripts |
144
144
 
145
145
  ### Shell Completions
146
146
 
147
- Enable tab completion for commands and options:
147
+ Each release ships pre-generated completion files in `dist/completions/`. You can use either the dynamic method or install them permanently.
148
+
149
+ **Dynamic (session only):**
148
150
 
149
151
  ```bash
150
152
  # bash
@@ -157,9 +159,25 @@ source <(aiex completion zsh)
157
159
  aiex completion fish | source
158
160
  ```
159
161
 
160
- To make it permanent, add the `source` line to your shell config file (`~/.bashrc`, `~/.zshrc`, or `~/.config/fish/config.fish`).
162
+ **Permanent install (recommended):**
163
+
164
+ ```bash
165
+ # bash — write to system completions directory
166
+ aiex completion bash > /etc/bash_completion.d/aiex
167
+ # or for user-level (no sudo):
168
+ mkdir -p ~/.local/share/bash-completion/completions
169
+ aiex completion bash > ~/.local/share/bash-completion/completions/aiex
170
+
171
+ # zsh — write to a directory in $fpath
172
+ aiex completion zsh > "${fpath[1]}/_aiex"
173
+ # or use the pre-built file from the package:
174
+ # $(npm root -g)/aiex-cli/dist/completions/aiex.zsh
175
+
176
+ # fish — write to fish completions directory
177
+ aiex completion fish > ~/.config/fish/completions/aiex.fish
178
+ ```
161
179
 
162
- > Completions are dynamically generated from the command definitions no manual updates needed when commands or options change.
180
+ > Pre-built completion files are also available in the installed package at `node_modules/aiex-cli/dist/completions/`, so Homebrew formulae, oh-my-zsh plugins, and other package managers can reference them directly without running `aiex completion`.
163
181
 
164
182
  <br>
165
183
 
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as name, D as doctorDiagnosticsTableRows, O as formatDoctorDiagnosticsJson, S as description, T as version, _ as PLACEHOLDER_SCHEMA, a as parseJsonSchema, b as createConfig, c as recognizeImageText, d as readAIConfig, f as writeAIConfig, g as DEFAULT_PROMPT_CONFIG, h as DEFAULT_MINERU_CONFIG, i as JsonSchemaDefinitionSchema, l as shouldUseImageOcrFallback, m as DEFAULT_MARKITDOWN_CONFIG, n as createMigrationConfig, o as toSnakeCase, p as DEFAULT_MARKER_CONFIG, s as generateDrizzleSchema, t as collectDoctorDiagnostics, u as getDefaultAIConfig, v as PLACEHOLDER_TEXT, w as package_default, x as seedConfig, y as AIConfigSchema } from "./doctor-collector-DnH1Qu1e.mjs";
1
+ import { C as name, D as doctorDiagnosticsTableRows, O as formatDoctorDiagnosticsJson, S as description, T as version, _ as PLACEHOLDER_SCHEMA, a as parseJsonSchema, b as createConfig, c as recognizeImageText, d as readAIConfig, f as writeAIConfig, g as DEFAULT_PROMPT_CONFIG, h as DEFAULT_MINERU_CONFIG, i as JsonSchemaDefinitionSchema, l as shouldUseImageOcrFallback, m as DEFAULT_MARKITDOWN_CONFIG, n as createMigrationConfig, o as toSnakeCase, p as DEFAULT_MARKER_CONFIG, s as generateDrizzleSchema, t as collectDoctorDiagnostics, u as getDefaultAIConfig, v as PLACEHOLDER_TEXT, w as package_default, x as seedConfig, y as AIConfigSchema } from "./doctor-collector-OS3eNcXI.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import fs from "node:fs/promises";
4
4
  import os from "node:os";
@@ -14439,11 +14439,11 @@ async function runBatchExtraction(aiexDir, config, aiConfig, schemaName, dir, gl
14439
14439
  }
14440
14440
 
14441
14441
  //#endregion
14442
- //#region src/commands/export.ts
14443
- const exportCommand = defineCommand({
14442
+ //#region src/commands/dump.ts
14443
+ const dumpCommand = defineCommand({
14444
14444
  meta: {
14445
- name: "export",
14446
- description: "Export SQLite database table to Excel (.xlsx) or CSV (.csv)"
14445
+ name: "dump",
14446
+ description: "Dump SQLite database table to Excel (.xlsx) or CSV (.csv)"
14447
14447
  },
14448
14448
  args: {
14449
14449
  table: {
@@ -14468,7 +14468,7 @@ const exportCommand = defineCommand({
14468
14468
  }
14469
14469
  },
14470
14470
  async run({ args }) {
14471
- intro(pc.inverse(" aiex export "));
14471
+ intro(pc.inverse(" aiex dump "));
14472
14472
  if (!args.table && !args.schema) {
14473
14473
  failCommand("Either table name (--table / -t) or schema name (--schema / -s) is required");
14474
14474
  return;
@@ -14518,7 +14518,7 @@ const exportCommand = defineCommand({
14518
14518
  }
14519
14519
  if (!format) format = "csv";
14520
14520
  if (format !== "csv" && format !== "xlsx") {
14521
- failCommand(`Unsupported export format: "${format}". Supported formats: csv, xlsx`);
14521
+ failCommand(`Unsupported dump format: "${format}". Supported formats: csv, xlsx`);
14522
14522
  return;
14523
14523
  }
14524
14524
  const resolvedOutput = outputPathArg ? path.resolve(outputPathArg) : path.resolve(cwd, `${tableName}.${format}`);
@@ -14595,8 +14595,8 @@ const exportCommand = defineCommand({
14595
14595
  const csv = XLSX.utils.sheet_to_csv(ws);
14596
14596
  fs$1.writeFileSync(resolvedOutput, "" + csv, "utf8");
14597
14597
  }
14598
- s3.stop("Export completed successfully");
14599
- consola.success(`Successfully exported ${rows.length} row(s) to ${pc.cyan(resolvedOutput)}`);
14598
+ s3.stop("Dump completed successfully");
14599
+ consola.success(`Successfully dumped ${rows.length} row(s) to ${pc.cyan(resolvedOutput)}`);
14600
14600
  } catch (error) {
14601
14601
  s3.stop("File write failed");
14602
14602
  failCommand(error instanceof Error ? error.message : String(error));
@@ -16210,7 +16210,7 @@ const subCommands = {
16210
16210
  schema: schemaCommand,
16211
16211
  extract: extractCommand,
16212
16212
  watch: watchCommand,
16213
- export: exportCommand,
16213
+ dump: dumpCommand,
16214
16214
  completion: completionCommand,
16215
16215
  doctor: doctorCommand
16216
16216
  };
@@ -0,0 +1,8 @@
1
+ # aiex bash completion
2
+ # Install: source <(aiex completion bash)
3
+ # Permanent: aiex completion bash > /etc/bash_completion.d/aiex
4
+ _aiex() {
5
+ local IFS=$'\n'
6
+ COMPREPLY=($(aiex _complete "${COMP_WORDS[@]}" 2>/dev/null))
7
+ }
8
+ complete -F _aiex aiex
@@ -0,0 +1,4 @@
1
+ # aiex fish completion
2
+ # Install: aiex completion fish | source
3
+ # Permanent: aiex completion fish > ~/.config/fish/completions/aiex.fish
4
+ complete -c aiex -f -a '(aiex _complete (commandline -cp) 2>/dev/null)'
@@ -0,0 +1,11 @@
1
+ # aiex zsh completion
2
+ # Install (dynamic): source <(aiex completion zsh)
3
+ # Permanent: aiex completion zsh > "${fpath[1]}/_aiex"
4
+ #compdef aiex
5
+
6
+ _aiex() {
7
+ local -a completions
8
+ completions=("${(@f)$(aiex _complete "${words[@]}" 2>/dev/null)}")
9
+ _describe 'aiex' completions
10
+ }
11
+ compdef _aiex aiex
@@ -74,7 +74,7 @@ function doctorDiagnosticsTableRows(d) {
74
74
  //#endregion
75
75
  //#region package.json
76
76
  var name = "aiex-cli";
77
- var version = "0.0.3-beta.5";
77
+ var version = "0.0.3-beta.6";
78
78
  var description = "JSON Schema → SQLite with AI-powered data extraction";
79
79
  var package_default = {
80
80
  name,
@@ -129,7 +129,7 @@ var package_default = {
129
129
  "coverage": "vitest --coverage",
130
130
  "typecheck": "tsc",
131
131
  "lint": "eslint .",
132
- "prepack": "cp ../../README.md .",
132
+ "prepack": "cp ../../README.md . && node scripts/generate-completions.mjs",
133
133
  "postpack": "rm -f README.md",
134
134
  "prepublishOnly": "pnpm run build"
135
135
  },
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { D as doctorDiagnosticsTableRows, E as buildDoctorDiagnostics, O as formatDoctorDiagnosticsJson, a as parseJsonSchema, i as JsonSchemaDefinitionSchema, n as createMigrationConfig, r as generateDrizzleConfig, s as generateDrizzleSchema, t as collectDoctorDiagnostics } from "./doctor-collector-DnH1Qu1e.mjs";
1
+ import { D as doctorDiagnosticsTableRows, E as buildDoctorDiagnostics, O as formatDoctorDiagnosticsJson, a as parseJsonSchema, i as JsonSchemaDefinitionSchema, n as createMigrationConfig, r as generateDrizzleConfig, s as generateDrizzleSchema, t as collectDoctorDiagnostics } from "./doctor-collector-OS3eNcXI.mjs";
2
2
 
3
3
  export { JsonSchemaDefinitionSchema, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aiex-cli",
3
3
  "type": "module",
4
- "version": "0.0.3-beta.5",
4
+ "version": "0.0.3-beta.6",
5
5
  "description": "JSON Schema → SQLite with AI-powered data extraction",
6
6
  "author": "OSpoon <zxin088@gmail.com>",
7
7
  "license": "MIT",