🗄️

SQLite Explorer

CLI (sqlitexp)

Open local databases from the terminal with sqlitexp.

sqlitexp — SQLite explorer from the terminal

sqlitexp opens any local SQLite database in the browser-based viewer straight from your terminal — no drop zone required. It starts a small local server (bound to 127.0.0.1), launches your browser, and serves the prebuilt viewer with the database already open.

# install once
npm install @lucasschirm/sqlite-explorer -g
# open a database
sqlitexp mydata.db
# custom port, no browser
sqlitexp mydata.db --port 8080 --no-open

Flags

FlagDefaultWhat it does
-p, --port <n>3000Port the local viewer server listens on.
--[no-]openopenLaunch the browser automatically (or suppress it with --no-open).
-h, --help—Show the command help.
-v, --version—Print the installed version.

How it works

The command serves the prebuilt viewer (local.html) with Fastify bound to 127.0.0.1 and streams the database file over HTTP Range requests. The UI's SQLite worker fetches only the 4 KiB pages a query touches — exactly like the drop-zone path, multi-gigabyte files open instantly and are never loaded into memory.

Nothing leaves your machine: the server never listens on a public interface and stops when you press Ctrl+C. If the port is taken, the command exits with a hint to pass --port.

Non-SQLite files fail fast: the CLI validates the 16-byte SQLite magic header before starting the server, so a 400 MB video file never wastes a server start.

Local development

# builds the UI (dist/) and compiles the CLI (cli/)
bun run build
# run your local build
bun run cli -- public/demo.db --port 4545