Database Ops · Local-only

CLI database ops, as buttons.

A web UI over the database CLI commands you keep half-remembering. No AI, no magic — just psql / mysql operations turned into clicks, running fully on your machine.

uvx cli2ui # Run latest version: uvx --refresh cli2ui # or Docker git clone https://github.com/MR-TABATA/cli2ui && cd cli2ui && docker compose up

Local-only · uvx / Docker

The cli2ui locks view: the session at the head of the chain, the sessions waiting behind it, and Cancel and Terminate buttons

Features

A real DB client, on your machine

The workspace overview puts every panel one click away, with live counts. Table detail has columns, indexes, a row preview, a filter builder, CSV import/export, and one-click backup or rename.

Table detail with a row preview and filter, plus one-click actions

See the result before you commit to it

The dangerous part usually isn't the operation — it's not knowing until you've done it. Whatever can be answered first, is — and none of it leaves anything behind in your database.

An UPDATE refused inside a read-only transaction

The SQL runner is read-only by default

A read-only transaction with a statement timeout and a 1000-row cap. No SQL is parsed to guess your intent — the server itself refuses the write. EXPLAIN, scale and index what-ifs are built in.

The SQL runner with a query, its result, and EXPLAIN and index buttons

Is my list in the database?

Match a CSV, TSV, JSON or JSONL file — or a pasted list of IDs — against a table column. It asks the database in separate read-only queries which values exist and which don’t, so nothing is written. Copy the result as lines, CSV or a SQL IN clause, or export it as CSV.

A pasted list of 12 emails matched against the customers table: 8 found, 4 missing

How many rows violate a constraint

Count the rows a NOT VALID foreign key never checked — without validating it, and without changing anything.

Index lab: measure before you create

Build a hypothetical index inside one transaction, compare EXPLAIN ANALYZE before and after, then ROLLBACK. Know it helps before you create it.

DDL that gives up, not piles up

Every ALTER / DROP / TRUNCATE / rename runs under a short lock_timeout (2 s). If the lock can't be taken, it gives up and nobody queues behind it.

EXPLAIN snapshots + diff

Save query plans and diff two of them — before and after an index — instead of copy-pasting plans into a scratch file.

Scale simulation

EXPLAIN the same query at 1× / 100× / 10000× the real row counts (a what-if pg_class edit, always rolled back) to see where the plan shape breaks as data grows.

Activity

Running queries and connections from pg_stat_activity, with one-click cancel / kill.

Locks

The wait-for chain as a tree: the head blocker at the top, blocked sessions nested under it. Cycles are flagged.

Health · index & bloat facts

Table sizes, unused indexes, unindexed foreign keys, duplicate indexes, orphan rows, dead rows and a bloat estimate. Facts only — no advice.

Dependencies

The foreign-key graph sorted into a safe TRUNCATE order and its reverse (load order), with FK cycles named. Nothing is truncated.

Extensions and objects

Installed and installable extensions, databases, schemas and roles, and a postgresql.conf editor — changes sit behind a confirm gate.

Backup, restore and replication

Automatic snapshots before destructive changes, streamed dump restores, and replication readiness and slots.

What it supports — and what it won't do

The constraints are the product.

Databases

  • PostgreSQL
  • MySQL 8.0+
  • The same panels over either engine
  • Panels with no MySQL equivalent say “not applicable”

What it deliberately doesn't do

  • No AI: your schema never goes to a third party
  • No SaaS: DB credentials never leave your machine
  • Runs exactly the command you clicked, with no guessing

Safe by default

  • The SQL runner is read-only
  • DDL under a 2 s lock_timeout
  • Automatic snapshot before destructive changes
  • A local-only UI

Under the hood

  • Front end: htmx + Alpine.js
  • Back end: Django
  • Admin DB: SQLite
  • Runtime: uvx / pipx / Docker

A DB tool must never leave a corrupted state. Reviewed with MrkCodeReview, every finding backed by a scenario and evidence.

Guaranteed read-only transactions, 2-second DDL lock timeouts, MultiFernet encryption for saved credentials, and hosted-mode capability gates. Database tools hide brutal concurrency traps and permission bypasses. cli2ui is reviewed with MrkCodeReview, where every finding must carry a scenario and its evidence.

Every boundary condition and side-effect trap is captured in automated regression tests (464 tests), ensuring rock-solid stability in production containers. Note: This code example is illustrative only; actual output may differ.

Edge case caught and verified during review
# Case: Hosted-mode preflight (check_hosted) verifying encryption key safety
$ python manage.py check_hosted

# Blind spot: A read-only verification unexpectedly created secret.key on disk when missing
# MrkCodeReview finding:
#   "Keep the hosted preflight read-only.
#    Avoid creating a key file during check and verify folder permissions safely."

# Result: Zero side-effects during preflight, directory permissions pre-checked safely

Free and open source

cli2ui

You're looking at your tables 3 minutes after deciding to.

Free

Local-only · uvx / Docker

MIT License · Source on GitHub
Designed to run locally with no authentication. Never expose it to the public internet.

  • psql / mysql operations, one click each
  • See the result first (violations, delete order, read-only)
  • Match a local file against a real table
  • Index lab, scale simulation, EXPLAIN diff
  • Activity, locks and health
  • Single-command launch with uvx cli2ui (zero Docker networking friction)
  • Update anytime with uvx --refresh cli2ui (or uv tool install to keep locally)
  • Docker supported too (for bundled sample database: clone, then docker compose up)
Get started

Start with uvx cli2ui.

uvx cli2ui # To fetch and run the latest version: # uvx --refresh cli2ui # or Docker git clone https://github.com/MR-TABATA/cli2ui && cd cli2ui && docker compose up