aiex-cli 0.0.1-beta.9 → 0.0.2-beta.1
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 +50 -26
- package/dist/cli.mjs +1776 -626
- package/dist/{completions-ygS1okck.mjs → completions-C3rmTwXZ.mjs} +2 -2
- package/dist/core/schema-sqlite/migrate-helper.mjs +35 -37
- package/dist/{doctor-BiU1lDp-.mjs → doctor-collector-Cbqgwx__.mjs} +309 -223
- package/dist/index.d.mts +15 -15
- package/dist/index.mjs +1 -1
- package/dist/table-schema.json +4 -0
- package/dist/web/assets/AISettings-Cm8fAfaG.js +205 -0
- package/dist/web/assets/DataBrowser-DQwOvooY.js +6 -0
- package/dist/web/assets/ExtractRunner-CzfLlCCf.js +1 -0
- package/dist/web/assets/ExtractionViewer-D7tghmR-.js +1 -0
- package/dist/web/assets/JsonSchemaEditor-DXhYW-Un.js +570 -0
- package/dist/web/assets/api-client-CIC2X8_4.js +1 -0
- package/dist/web/assets/baseinput-B7PU5-38.js +2 -0
- package/dist/web/assets/button-Cdgr9Igy.js +927 -0
- package/dist/web/assets/checkbox-CCQwMfLd.js +142 -0
- package/dist/web/assets/{cssMode-DAbG0CMn.js → cssMode-CCz1uj8b.js} +1 -1
- package/dist/web/assets/dialog-8xaIXBKO.js +108 -0
- package/dist/web/assets/dist-B5Yem2Jn.js +1 -0
- package/dist/web/assets/{editor.main-BqhfoHxy.js → editor.main-DOue-nGf.js} +2 -2
- package/dist/web/assets/{freemarker2-B9_5ct2b.js → freemarker2-C87H7V8i.js} +1 -1
- package/dist/web/assets/{handlebars-TY59WcoQ.js → handlebars-TLnoktZW.js} +1 -1
- package/dist/web/assets/{html-CLULsh27.js → html-Rewbtgcp.js} +1 -1
- package/dist/web/assets/{htmlMode-BvG7RNbU.js → htmlMode-Cr9y3YUi.js} +1 -1
- package/dist/web/assets/index-BEorm4a5.css +2 -0
- package/dist/web/assets/{index-CKUXTDYj.js → index-CWy8KajQ.js} +38 -38
- package/dist/web/assets/{javascript-DHrLp6gu.js → javascript-BO8DPECx.js} +1 -1
- package/dist/web/assets/{jsonMode-DBDhdzl1.js → jsonMode-B78m_Y1l.js} +1 -1
- package/dist/web/assets/{liquid-tGeb-nqF.js → liquid-CDp_8YUE.js} +1 -1
- package/dist/web/assets/{mdx-Cmdz78VU.js → mdx-CeR1GULE.js} +1 -1
- package/dist/web/assets/{monaco.contribution-CroYPUF5.js → monaco.contribution-tCitzj1_.js} +2 -2
- package/dist/web/assets/object-utils-Cm2M3fPO.js +1 -0
- package/dist/web/assets/{python-Dmfz4iDE.js → python-DWmB1hQ6.js} +1 -1
- package/dist/web/assets/{razor-BJicZHJs.js → razor-BVk762Lq.js} +1 -1
- package/dist/web/assets/runtime-dom.esm-bundler-DZwuSnld.js +1 -0
- package/dist/web/assets/select-DKPPF403.js +438 -0
- package/dist/web/assets/{tsMode-DYqTyE66.js → tsMode-Gjs5D1gt.js} +1 -1
- package/dist/web/assets/{typescript-DLnTe9Hf.js → typescript-Cw6YtwrM.js} +1 -1
- package/dist/web/assets/utils-CZhxh2Ya.js +2 -0
- package/dist/web/assets/{xml-BIYqLORk.js → xml-guZq0YZJ.js} +1 -1
- package/dist/web/assets/{yaml-BjmulkMX.js → yaml-B9TbU-LX.js} +1 -1
- package/dist/web/index.html +11 -8
- package/package.json +17 -1
- package/src/core/schema-sqlite/migrate-helper.ts +32 -46
- package/dist/web/assets/AISettings-DOzonIux.js +0 -334
- package/dist/web/assets/DataBrowser-rznfVRaV.js +0 -3
- package/dist/web/assets/JsonSchemaEditor-C9iyQs7N.js +0 -929
- package/dist/web/assets/api-client-Dsg4WOM9.js +0 -1
- package/dist/web/assets/button-kTMweGMc.js +0 -927
- package/dist/web/assets/dialog-CWuu7WjI.js +0 -108
- package/dist/web/assets/index-DDFnprdM.css +0 -2
- package/dist/web/assets/lib-C30cIFrm.js +0 -1
- package/dist/web/assets/overlayeventbus-AtOpmI6n.js +0 -80
- package/dist/web/assets/table-schema-mJrrf9qw.js +0 -2
- /package/dist/web/assets/{abap-DrZwwXZX.js → abap-C3UM4cME.js} +0 -0
- /package/dist/web/assets/{apex-CrCz0btt.js → apex-BQBZvQmN.js} +0 -0
- /package/dist/web/assets/{azcli-BapzKHay.js → azcli-Dn9Awrok.js} +0 -0
- /package/dist/web/assets/{bat-C_NRAiA1.js → bat-JgEezSDo.js} +0 -0
- /package/dist/web/assets/{bicep-C7pp2CNk.js → bicep-vcQeC7wE.js} +0 -0
- /package/dist/web/assets/{cameligo-BhhK9vxZ.js → cameligo-C0cr0T3L.js} +0 -0
- /package/dist/web/assets/{clojure-D0ujmUyE.js → clojure-Brc1-rbW.js} +0 -0
- /package/dist/web/assets/{coffee-DHEl7Jbb.js → coffee-BiZYU83a.js} +0 -0
- /package/dist/web/assets/{cpp-Iil-3nzZ.js → cpp-ikWHCInz.js} +0 -0
- /package/dist/web/assets/{csharp-Dh0Ee7SY.js → csharp-BRWs_LfH.js} +0 -0
- /package/dist/web/assets/{csp-mwzjw0JL.js → csp-CcAumoJw.js} +0 -0
- /package/dist/web/assets/{css-COIa8ZTR.js → css-BZm6paiA.js} +0 -0
- /package/dist/web/assets/{cypher-GVc17FC4.js → cypher-CDQMONdb.js} +0 -0
- /package/dist/web/assets/{dart-phiCaE7_.js → dart-Ci4SZdF1.js} +0 -0
- /package/dist/web/assets/{dockerfile-BMaDhdim.js → dockerfile-BV0tAr-M.js} +0 -0
- /package/dist/web/assets/{ecl-Cj47kvqp.js → ecl-CP7nM2KN.js} +0 -0
- /package/dist/web/assets/{editor.api-DLXGyrN1.js → editor.api-BU_q4v8i.js} +0 -0
- /package/dist/web/assets/{elixir-DBbstcE1.js → elixir-GcA6wFiI.js} +0 -0
- /package/dist/web/assets/{flow9-ChHb1adO.js → flow9-CIb9youF.js} +0 -0
- /package/dist/web/assets/{fsharp-CMk2OIJN.js → fsharp-BVaBE4co.js} +0 -0
- /package/dist/web/assets/{go-BrMkuJg0.js → go-Bbqf306x.js} +0 -0
- /package/dist/web/assets/{graphql-PSR1UKGv.js → graphql-DJPrC4l-.js} +0 -0
- /package/dist/web/assets/{hcl-DAQrbDOW.js → hcl-QyfWVWpM.js} +0 -0
- /package/dist/web/assets/{ini-0TG5BxW0.js → ini-CgstZeS8.js} +0 -0
- /package/dist/web/assets/{java-rgorz17v.js → java-D4AG88ZY.js} +0 -0
- /package/dist/web/assets/{julia-C8VMdHm8.js → julia-CN8U9648.js} +0 -0
- /package/dist/web/assets/{kotlin-CllWo3gX.js → kotlin-gNNgpJhY.js} +0 -0
- /package/dist/web/assets/{less-Cgca25AP.js → less-C3SY2L8t.js} +0 -0
- /package/dist/web/assets/{lexon-D0GHdBaw.js → lexon-CznnqzUX.js} +0 -0
- /package/dist/web/assets/{lua-DmRsNG-P.js → lua-f3xyJgy5.js} +0 -0
- /package/dist/web/assets/{m3-BgL5dNKT.js → m3-Cl7J89p-.js} +0 -0
- /package/dist/web/assets/{markdown-BuJfycGS.js → markdown-Bv2fnzzT.js} +0 -0
- /package/dist/web/assets/{mips-C9m_93PR.js → mips-D6rXUTWa.js} +0 -0
- /package/dist/web/assets/{msdax-CpFHC9OI.js → msdax-Bb1N2x5J.js} +0 -0
- /package/dist/web/assets/{mysql-qFvltsqN.js → mysql-DXSr6oD7.js} +0 -0
- /package/dist/web/assets/{objective-c-Bnmr858J.js → objective-c-CEJiVkDa.js} +0 -0
- /package/dist/web/assets/{pascal-WP0_D5AO.js → pascal-BtkMEIba.js} +0 -0
- /package/dist/web/assets/{pascaligo-Blom4Rij.js → pascaligo-C7FAwqk7.js} +0 -0
- /package/dist/web/assets/{perl-B-vk8g64.js → perl-D9kqkBbN.js} +0 -0
- /package/dist/web/assets/{pgsql-Cgvz6v67.js → pgsql-BjGTBL1W.js} +0 -0
- /package/dist/web/assets/{php-8a3Lrw9m.js → php-BN0c0noA.js} +0 -0
- /package/dist/web/assets/{pla-DuFqEZ8V.js → pla-B94QTqOt.js} +0 -0
- /package/dist/web/assets/{postiats-DkLtSgkp.js → postiats-DH91dqBs.js} +0 -0
- /package/dist/web/assets/{powerquery-BJ1aNepW.js → powerquery-D7P0oUen.js} +0 -0
- /package/dist/web/assets/{powershell-rE98k687.js → powershell-CCVHmJax.js} +0 -0
- /package/dist/web/assets/{preload-helper-DWTEM3RW.js → preload-helper-DgFuoWHe.js} +0 -0
- /package/dist/web/assets/{protobuf-CUheFacr.js → protobuf-BIP7pixC.js} +0 -0
- /package/dist/web/assets/{pug-LDcAMD8w.js → pug-DcbLK7HH.js} +0 -0
- /package/dist/web/assets/{qsharp-IHfqKOfK.js → qsharp-B-VY_WOG.js} +0 -0
- /package/dist/web/assets/{r-D-QApv87.js → r-DwRtsJsj.js} +0 -0
- /package/dist/web/assets/{redis-SXdDyWR9.js → redis-CaW0tkwu.js} +0 -0
- /package/dist/web/assets/{redshift-Y6lsCryn.js → redshift-3tS8G0ME.js} +0 -0
- /package/dist/web/assets/{restructuredtext-edObr9a8.js → restructuredtext-_TNyGyK0.js} +0 -0
- /package/dist/web/assets/{ruby-CNnUfF-8.js → ruby-A-MwVfO4.js} +0 -0
- /package/dist/web/assets/{rust-IHUZWzBr.js → rust-oemlUIvG.js} +0 -0
- /package/dist/web/assets/{sb-DrUvY44N.js → sb-BDZuaI3W.js} +0 -0
- /package/dist/web/assets/{scala-B4hbXGLM.js → scala-Bfo2loK4.js} +0 -0
- /package/dist/web/assets/{scheme-BGrd12j3.js → scheme-N2eo7rjB.js} +0 -0
- /package/dist/web/assets/{scss-x5G1ES4U.js → scss-vjjSCTgN.js} +0 -0
- /package/dist/web/assets/{shell-DOehe2Y8.js → shell-Bfb9Yq6w.js} +0 -0
- /package/dist/web/assets/{solidity-BeRvcwWV.js → solidity-C9RbukzG.js} +0 -0
- /package/dist/web/assets/{sophia-DZbkUNjy.js → sophia-DWV_MWOg.js} +0 -0
- /package/dist/web/assets/{sparql-B7_oi5-h.js → sparql-iMXILWhh.js} +0 -0
- /package/dist/web/assets/{sql-CTlsFWVE.js → sql-CJDj31JM.js} +0 -0
- /package/dist/web/assets/{st-DJVEJdPE.js → st-BG9AQ1OO.js} +0 -0
- /package/dist/web/assets/{swift-CwhT3fYa.js → swift-B579DvHm.js} +0 -0
- /package/dist/web/assets/{systemverilog-BQN63pkN.js → systemverilog-BNgaF3ZX.js} +0 -0
- /package/dist/web/assets/{tcl-DqwfpskA.js → tcl-grdtJiUA.js} +0 -0
- /package/dist/web/assets/{twig-BiyenUgc.js → twig-JAsFXBZw.js} +0 -0
- /package/dist/web/assets/{typespec-CWOJribt.js → typespec-D3hIQXEU.js} +0 -0
- /package/dist/web/assets/{vb-Cq5F87m3.js → vb-H38jRcEz.js} +0 -0
- /package/dist/web/assets/{wgsl-BAvW2lVr.js → wgsl-BC5Grc5r.js} +0 -0
package/README.md
CHANGED
|
@@ -21,10 +21,9 @@ npm install -g aiex-cli
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
aiex
|
|
24
|
+
aiex web # configure schemas, AI settings, and run extractions in the browser
|
|
25
25
|
aiex schema # generate SQLite from JSON Schema files
|
|
26
|
-
aiex extract -s invoice -f invoice.pdf # extract data with AI
|
|
27
|
-
aiex extract -s invoice -f invoice.pdf --db # extract and insert into database
|
|
26
|
+
aiex extract -s invoice -f invoice.pdf # extract data with AI and insert into database
|
|
28
27
|
```
|
|
29
28
|
|
|
30
29
|
<br>
|
|
@@ -33,32 +32,26 @@ aiex extract -s invoice -f invoice.pdf --db # extract and insert into database
|
|
|
33
32
|
|
|
34
33
|
- **JSON Schema → SQLite** — Define tables as JSON Schema files, generate Drizzle ORM schema, and migrate to SQLite
|
|
35
34
|
- **Visual Editor** — Browser-based UI for designing schemas without writing JSON by hand
|
|
35
|
+
- **Web Extraction Workbench** — Run text/file extraction in the browser, review audit history, inspect details, retry failed runs, and delete history records
|
|
36
36
|
- **AI Extraction** — Extract structured data from text, images, and PDFs using any OpenAI-compatible provider (OpenAI, Anthropic, Ollama, DeepSeek, local models, etc.)
|
|
37
|
+
- **Interactive Mode** — Run `aiex extract` without arguments for a guided extraction workflow
|
|
38
|
+
- **Batch Mode** — `aiex extract -d <dir>` processes entire directories with optional glob filtering
|
|
39
|
+
- **Extraction Audit Trail** — Every CLI/Web extraction is recorded with status, input source, output path, token usage, database inserts, and errors
|
|
37
40
|
- **Built-in Model Registry** — Knows capabilities of 2000+ models (vision, structured output) so you don't have to guess
|
|
38
41
|
|
|
39
42
|
<br>
|
|
40
43
|
|
|
41
44
|
## 🚀 Getting Started
|
|
42
45
|
|
|
43
|
-
### 1.
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
aiex schema --init
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Creates a `.aiex/` directory with example schemas to get you started.
|
|
50
|
-
|
|
51
|
-
Add your own JSON Schema files to `.aiex/schema/` (one file per table), then run `aiex schema` to migrate them into the database.
|
|
52
|
-
|
|
53
|
-
### 2. Visual Editor
|
|
46
|
+
### 1. Configure In Web UI
|
|
54
47
|
|
|
55
48
|
```bash
|
|
56
49
|
aiex web
|
|
57
50
|
```
|
|
58
51
|
|
|
59
|
-
Opens a browser UI where you can visually design and manage your schemas, configure AI settings, preview extraction prompts, and apply changes to the database.
|
|
52
|
+
Opens a browser UI where you can visually design and manage your schemas, configure AI settings, run text/file extraction, inspect extraction history, retry failed runs, preview extraction prompts, browse inserted data, and apply changes to the database.
|
|
60
53
|
|
|
61
|
-
###
|
|
54
|
+
### 2. Generate Database
|
|
62
55
|
|
|
63
56
|
```bash
|
|
64
57
|
aiex schema
|
|
@@ -66,39 +59,59 @@ aiex schema
|
|
|
66
59
|
|
|
67
60
|
Converts your JSON Schema files into a SQLite database with full migration support.
|
|
68
61
|
|
|
69
|
-
###
|
|
62
|
+
### 3. Extract Data
|
|
70
63
|
|
|
71
64
|
```bash
|
|
72
|
-
aiex extract
|
|
73
|
-
aiex extract -s <schema> -
|
|
74
|
-
aiex extract -s <schema> -
|
|
65
|
+
aiex extract # interactive mode (prompts for schema & input)
|
|
66
|
+
aiex extract -s <schema> -f <file> # from file (txt, pdf, png, jpg, ...)
|
|
67
|
+
aiex extract -s <schema> -t <text> # from text
|
|
68
|
+
aiex extract -s <schema> -f <file> -m <model> # specify AI model (overrides auto-selection)
|
|
69
|
+
aiex extract -s <schema> -f <file> --no-insert # extract and save JSON without inserting into SQLite
|
|
70
|
+
aiex extract -s <schema> -d <directory> # batch extract all supported files in a directory
|
|
71
|
+
aiex extract -s <schema> -d <dir> -g "*.pdf" # batch with glob filter
|
|
72
|
+
aiex extract history # list extraction audit records
|
|
73
|
+
aiex extract show <audit-id> # show full audit record JSON
|
|
74
|
+
aiex extract retry <audit-id> # retry a previous extraction
|
|
75
|
+
aiex extract rm <audit-id> # delete an audit record and cached upload
|
|
75
76
|
```
|
|
76
77
|
|
|
77
78
|
The AI reads your document and outputs structured JSON matching your schema.
|
|
78
79
|
|
|
79
80
|
**Examples:**
|
|
80
81
|
```bash
|
|
81
|
-
aiex extract
|
|
82
|
-
aiex extract -s paper -f research.pdf
|
|
82
|
+
aiex extract # interactive mode
|
|
83
|
+
aiex extract -s paper -f research.pdf # save result to .aiex/extracted/ and insert into database
|
|
84
|
+
aiex extract -s paper -f research.pdf --no-insert # save result only, skip database insert
|
|
83
85
|
aiex extract -s paper -f research.pdf -m gpt-4o # use a specific model
|
|
86
|
+
aiex extract -s paper -d ./papers -g "*.pdf" # batch extract PDFs from a directory
|
|
87
|
+
aiex extract history # inspect recent extraction runs
|
|
84
88
|
```
|
|
85
|
-
Saves the extracted result to `.aiex/extracted/<schema-name>-<timestamp>.json` with fields like `title`, `firstAuthor`, `journal`, `year` — exactly as defined in your schema.
|
|
89
|
+
Saves the extracted result to `.aiex/extracted/<schema-name>-<timestamp>.json` with fields like `title`, `firstAuthor`, `journal`, `year` — exactly as defined in your schema. Data is automatically inserted into the SQLite database.
|
|
86
90
|
|
|
87
91
|
By default, aiex automatically selects a model based on your input type (vision-capable for images, structured output for text). Use `--model` / `-m` to override and specify any model from your AI configuration.
|
|
88
92
|
|
|
93
|
+
Every extraction is also recorded under `.aiex/extracted/_audit/`. Audit records include the run status (`running`, `succeeded`, `failed`, or `stale`), schema name, input source, output file, token usage, inserted table rows, retry lineage, and error message. Uploaded files used by Web extraction are cached under `.aiex/uploads/` so failed or historical file extractions can be retried. Deleting an audit record removes its cached upload, but keeps extracted JSON result files to avoid accidental data loss.
|
|
94
|
+
|
|
89
95
|
<br>
|
|
90
96
|
|
|
91
97
|
## 📖 Commands
|
|
92
98
|
|
|
93
99
|
| Command | Description |
|
|
94
100
|
| --- | --- |
|
|
95
|
-
| `aiex schema --init` | Scaffold `.aiex/` directory with example schemas |
|
|
96
101
|
| `aiex schema` | Parse JSON Schema files and migrate to SQLite |
|
|
97
102
|
| `aiex schema --generate` | Generate Drizzle schema code only (skip migration) |
|
|
98
103
|
| `aiex web` | Launch visual schema editor in browser |
|
|
99
|
-
| `aiex extract
|
|
100
|
-
| `aiex extract -s <name> -f <file
|
|
104
|
+
| `aiex extract` | Interactive mode — prompts for schema and input source |
|
|
105
|
+
| `aiex extract -s <name> -f <file>` | Extract structured data from documents and insert into SQLite database |
|
|
101
106
|
| `aiex extract -s <name> -f <file> -m <model>` | Extract with a specific AI model |
|
|
107
|
+
| `aiex extract -s <name> -f <file> --no-insert` | Extract and save JSON without inserting into SQLite |
|
|
108
|
+
| `aiex extract -s <name> -d <dir>` | Batch extract all supported files in a directory |
|
|
109
|
+
| `aiex extract -s <name> -d <dir> -g "*.pdf"` | Batch extract with glob filter |
|
|
110
|
+
| `aiex extract history` | List extraction audit records |
|
|
111
|
+
| `aiex extract show <audit-id>` | Show a full extraction audit record |
|
|
112
|
+
| `aiex extract retry <audit-id>` | Retry a previous extraction run |
|
|
113
|
+
| `aiex extract retry <audit-id> --no-insert` | Retry without inserting into SQLite |
|
|
114
|
+
| `aiex extract rm <audit-id>` | Delete an audit record and its cached upload |
|
|
102
115
|
| `aiex doctor` | System and configuration diagnostics |
|
|
103
116
|
| `aiex completion bash\|zsh\|fish` | Generate shell completion scripts |
|
|
104
117
|
|
|
@@ -133,6 +146,17 @@ aiex works with any OpenAI-compatible API provider. Configure in the Web UI (AI
|
|
|
133
146
|
|
|
134
147
|
The built-in model registry automatically suggests capabilities for 2000+ models from providers including OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, Alibaba Cloud, and more.
|
|
135
148
|
|
|
149
|
+
### Langfuse Tracing
|
|
150
|
+
|
|
151
|
+
aiex can send AI model interaction traces to [Langfuse](https://langfuse.com) for monitoring and debugging.
|
|
152
|
+
|
|
153
|
+
- **Enable** — In Web UI → AI Settings → Langfuse Tracing, toggle on and enter your Langfuse Secret Key / Public Key
|
|
154
|
+
- **Self-hosted** — Optionally set a custom Host URL; defaults to `https://us.cloud.langfuse.com`
|
|
155
|
+
- **No impact when disabled** — No tracing is sent if keys are left empty
|
|
156
|
+
- **Non-blocking** — Misconfigured keys will not affect extraction
|
|
157
|
+
|
|
158
|
+
Once enabled, every `aiex extract` call is automatically traced with full request/response payloads, token usage, and latency.
|
|
159
|
+
|
|
136
160
|
<br>
|
|
137
161
|
|
|
138
162
|
## 🙏 Acknowledgments
|