The idea
A single-binary CLI tool that opens a SQLite database file and presents a full terminal UI: a sidebar listing tables, a schema pane, a SQL editor, and a scrollable results grid. You run sqlite-tui myapp.db and immediately have a lightweight DBeaver-equivalent without leaving your terminal session. No Electron, no browser tab, no credentials to configure.
Why build this
SQLite is everywhere — mobile apps, embedded configs, local caches, test fixtures, Datasette exports, Obsidian vaults, browser profiles, n8n's default storage — but the tooling story for quickly poking around a file from the command line is poor. sqlite3 REPL works but has no visual structure. GUI tools like DB Browser for SQLite are fine on a desktop but unavailable over SSH, inside Docker, or on a headless VPS.
The gap is the headless/remote developer who just wants to run a few queries against a file without installing anything heavy. TUI frameworks have matured enough (Textual, Bubble Tea) that building a polished terminal app is now a weekend project, not a month of ncurses pain.
Stack sketch
- Language: Python 3.11+
- TUI framework: Textual — widget-based, CSS-driven layout, works over SSH
- Database driver:
sqlite3from the standard library — zero dependencies for the core - Query results rendering: Textual's built-in
DataTablewidget with virtual scrolling - Distribution: PyPI (
pip install sqlite-tui) and a single-file zipapp for no-install use - Testing:
pytest+ Textual'sPilottest driver for headless UI tests
Scope for v1
- Open a SQLite file passed as a CLI argument; error clearly if the file is locked or corrupt.
- Sidebar listing all tables and views, updated live if the file changes on disk.
- Schema pane showing column names, types, and constraints for the selected table.
- SQL editor panel with basic line editing (no syntax highlighting in v1).
- Run query with a keybinding; display results in a paginated
DataTable(default LIMIT 500, configurable). - Export the last query result to CSV with a single keystroke.
- Read-only mode by default; a
--writeflag unlocks INSERT/UPDATE/DELETE. - Keyboard-only navigation throughout — no mouse dependency.
Out of scope for v1: multiple database connections, query history persistence, visual query builder, syntax highlighting, foreign key graph visualization.
Where it could go
The natural next step is multi-database support via SQLAlchemy — adding a --driver flag so the same UI works against PostgreSQL or MySQL over a connection string. That turns the tool from a SQLite-specific utility into a general headless database browser, which is a much larger audience. You could offer a hosted binary download and charge for the PostgreSQL/MySQL drivers as a one-time purchase.
A second expansion path is a "diff" subcommand: sqlite-tui diff a.db b.db that shows schema changes and row-level diffs between two files. This is immediately useful for anyone running migrations locally and wanting to verify what changed before committing, and it's a natural companion to the existing browse workflow.
Watch out for
Tables without an explicit ROWID or with millions of rows will make the DataTable unusable if you don't enforce a hard row cap — wire in a configurable LIMIT from day one and make sure the UI makes the cap visible so users don't assume they're seeing all rows.