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

openinsight

v0.16.1

Published

Query your database with natural language

Readme

OpenInsight

Open Business Insights Agent

[!WARNING] Lot of the code was written by AI, this is an experiment.

TUI Mode

Web Mode

Agent-built dashboards

The web UI includes a Dashboards tab. Ask the configured agent to build a dashboard or revise the selected dashboard in natural language. The agent owns the widget queries, visualization types, column mappings, order, and layout; changes remain a draft until you save them. In-flight agent requests can be cancelled without changing the current dashboard draft.

Dashboards support tables and Chart.js line, bar, and pie charts. Every widget has an agent-authored title and subtitle and uses the dashboard's shared time range, which can be rerun with a relative or custom range. Saved dashboard configurations are scoped to their data source and stored in the project's .openinsight/config.json; query results are not persisted.

Quick Start

Install with Homebrew:

brew install arjunkomath/tap/openinsight

Or install from npm (a prebuilt binary is downloaded for your platform, no Bun required):

# 1. Install
npm install -g openinsight

# Set your OpenRouter API key
export OPENROUTER_KEY=sk-...

# Run
openinsight

Use Claude Code

OpenInsight can use an existing Claude Code login instead of OpenRouter. Install Claude Code 2.1.205 or newer, authenticate it, and opt in with --claude:

claude auth login
openinsight --claude

# Claude also works with the web UI
openinsight --claude --web

OpenInsight verifies that the claude executable is in PATH before starting. It runs each inference in non-interactive plan mode with all built-in and MCP tools disabled; the database schema and query context are sent over stdin. The default model is opus and can be changed with OPENINSIGHT_CLAUDE_MODEL:

OPENINSIGHT_CLAUDE_MODEL=sonnet openinsight --claude

For a persistent provider choice, set OPENINSIGHT_AI_PROVIDER=claude instead of passing --claude. OpenRouter remains the default provider.

Summarize query results

Run a one-shot, non-interactive query by selecting a configured source by name or ID and providing a natural-language question:

openinsight --source production --query "Show monthly revenue"

Add --summary to make a second AI call that summarizes the results. An optional instruction can be provided with --summary=<instruction>:

openinsight --source production --query "Show monthly revenue" --summary
openinsight --source production --query "Show monthly revenue" --summary="Focus on unusual trends"

The command prints the generated SQL and query results, followed by the summary, then exits. It does not start the TUI or web UI.

One-shot queries support the existing provider and diagnostics options. For example, this uses Claude Code, prints verbose diagnostics to stderr, and writes the same diagnostics to the normal log file:

openinsight --claude --verbose --log --source production --query "Show monthly revenue" --summary

Verbose diagnostics

Pass --verbose to show detailed diagnostics in the TUI transcript, the web UI's expanded Activity panel, or stderr for a one-shot query:

openinsight --claude --verbose
openinsight --web --verbose

Verbose output includes complete AI prompts, schemas, conversation history, provider responses and metadata, subprocess stdout/stderr, generated and repaired SQL, database timing, result columns, and result data. Connection credentials and the resolved Claude executable path are not logged. Because prompts and query results can contain sensitive application data, enable verbose mode only while diagnosing a problem.

To write the same detailed diagnostics to a file without expanding the UI activity, pass --log:

openinsight --log
openinsight --web --log

Use --verbose --log to send detailed diagnostics to both the UI and the log. Log entries are timestamped and appended to openinsight.log in the platform's standard log or state directory:

  • Linux: ${XDG_STATE_HOME:-~/.local/state}/openinsight
  • macOS: ~/Library/Logs/OpenInsight
  • Windows: %LOCALAPPDATA%\OpenInsight\Logs

Each file entry is capped at 20,000 characters. The log rotates at 5 MiB and retains one archive as openinsight.log.1.

Run openinsight paths to print the log directory and, when it exists, the project-local .openinsight config directory. Log files can contain prompts, schemas, SQL, and query results, so handle them as sensitive data.


Made with ❤️ for data exploration