npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aiex-cli

v0.0.2-beta.6

Published

JSON Schema → SQLite with AI-powered data extraction

Downloads

4,508

Readme

npm install -g aiex-cli
aiex web                                # configure schemas, AI, integrations, and inspect data
aiex schema                             # generate SQLite from JSON Schema files
aiex extract -s invoice -f invoice.pdf  # extract data with AI and insert into database

✨ Features

  • JSON Schema → SQLite — Define tables as JSON Schema files, generate Drizzle ORM schema, and migrate to SQLite
  • Web Configuration & Viewer — Browser-based UI for designing schemas, configuring integrations, previewing prompts, and browsing extracted data
  • AI Extraction — Extract structured data from text, images, and PDFs using any OpenAI-compatible provider (OpenAI, Anthropic, Ollama, DeepSeek, local models, etc.)
  • Interactive Mode — Run aiex extract without arguments for a guided extraction workflow
  • Batch Modeaiex extract -d <dir> processes entire directories with optional glob filtering
  • Notion Sync — Optionally sync CLI extraction results to configured Notion data sources
  • Extraction Audit Trail — Every extraction is recorded with status, input source, output path, token usage, database inserts, Notion pages, and errors
  • Built-in Model Registry — Knows capabilities of 2000+ models (vision, structured output) so you don't have to guess

🚀 Getting Started

1. Configure In Web UI

aiex web

Opens a browser UI where you can visually design and manage your schemas, configure AI and integrations, preview extraction prompts, browse inserted SQLite data, inspect extracted JSON files, and apply schema changes to the database. Extraction itself runs from the CLI.

2. Generate Database

aiex schema

Converts your JSON Schema files into a SQLite database with full migration support.

3. Extract Data

aiex extract                              # interactive mode (prompts for schema & input)
aiex extract -s <schema> -f <file>        # from file (txt, pdf, png, jpg, ...)
aiex extract -s <schema> -t <text>        # from text
aiex extract -s <schema> -f <file> -m <model>     # specify AI model (overrides auto-selection)
aiex extract -s <schema> -f <file> --no-insert    # extract and save JSON without inserting into SQLite
aiex extract -s <schema> -d <directory>           # batch extract all supported files in a directory
aiex extract -s <schema> -d <dir> -g "*.pdf"      # batch with glob filter
aiex extract history                              # list extraction audit records
aiex extract show <audit-id>                      # show full audit record JSON
aiex extract retry <audit-id>                     # retry a previous extraction
aiex extract rm <audit-id>                        # delete an audit record and cached upload

The AI reads your document and outputs structured JSON matching your schema.

Examples:

aiex extract                                      # interactive mode
aiex extract -s paper -f research.pdf              # save result to .aiex/extracted/ and insert into database
aiex extract -s paper -f research.pdf --no-insert   # save result only, skip database insert
aiex extract -s paper -f research.pdf -m gpt-4o    # use a specific model
aiex extract -s paper -d ./papers -g "*.pdf"        # batch extract PDFs from a directory
aiex extract history                                # inspect recent extraction runs

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.

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.

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, synced Notion pages, retry lineage, and error message. Deleting an audit record removes its cached upload, but keeps extracted JSON result files to avoid accidental data loss.

📖 Commands

| Command | Description | | --- | --- | | aiex schema | Parse JSON Schema files and migrate to SQLite | | aiex schema --generate | Generate Drizzle schema code only (skip migration) | | aiex web | Launch visual schema/configuration UI and data viewer in browser | | aiex extract | Interactive mode — prompts for schema and input source | | aiex extract -s <name> -f <file> | Extract structured data from documents and insert into SQLite database | | aiex extract -s <name> -f <file> -m <model> | Extract with a specific AI model | | aiex extract -s <name> -f <file> --no-insert | Extract and save JSON without inserting into SQLite | | aiex extract -s <name> -d <dir> | Batch extract all supported files in a directory | | aiex extract -s <name> -d <dir> -g "*.pdf" | Batch extract with glob filter | | aiex extract history | List extraction audit records | | aiex extract show <audit-id> | Show a full extraction audit record | | aiex extract retry <audit-id> | Retry a previous extraction run | | aiex extract retry <audit-id> --no-insert | Retry without inserting into SQLite | | aiex extract rm <audit-id> | Delete an audit record and its cached upload | | aiex doctor | System and configuration diagnostics | | aiex completion bash\|zsh\|fish | Generate shell completion scripts |

Shell Completions

Enable tab completion for commands and options:

# bash
source <(aiex completion bash)

# zsh
source <(aiex completion zsh)

# fish
aiex completion fish | source

To make it permanent, add the source line to your shell config file (~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish).

Completions are dynamically generated from the command definitions — no manual updates needed when commands or options change.

🔧 AI Configuration

aiex works with any OpenAI-compatible API provider. Configure in the Web UI (AI Settings panel):

  • Provider — Set your base URL and API key
  • Models — Add models with vision and/or structured output capabilities
  • Prompts — Customize system and user prompt templates with {schema} and {text} placeholders

The built-in model registry automatically suggests capabilities for 2000+ models from providers including OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, Alibaba Cloud, and more.

Langfuse Tracing

aiex can send AI model interaction traces to Langfuse for monitoring and debugging.

  • Enable — In Web UI → AI Settings → Langfuse Tracing, toggle on and enter your Langfuse Secret Key / Public Key
  • Self-hosted — Optionally set a custom Host URL; defaults to https://us.cloud.langfuse.com
  • No impact when disabled — No tracing is sent if keys are left empty
  • Non-blocking — Misconfigured keys will not affect extraction

Once enabled, every aiex extract call is automatically traced with full request/response payloads, token usage, and latency.

🙏 Acknowledgments

This project includes source code adapted from jsonschema-builder-vue by Gabriel Casotti, used and modified under the MIT License.

The AI model capabilities registry is derived from LiteLLM's model_prices_and_context_window.json, used under the MIT License.

📄 License

MIT © OSpoon