{"slug": "i-turned-the-psql-commands-i-keep-forgetting-into-buttons", "title": "I turned the psql commands I keep forgetting into buttons", "summary": "A developer built cli2ui, a local web UI that turns frequently forgotten PostgreSQL CLI commands into one-click buttons. The tool runs on the user's machine, requires no AI or SaaS, and supports features like running queries, table inspection, safe transactions, and database snapshots. It is MIT-licensed and available on GitHub.", "body_md": "You know the command exists. You've run it a dozen times. But every single time you need to see what's *actually* running on your database, you end up typing some variant of:\n\n```\nSELECT pid, state, query, wait_event_type\nFROM pg_stat_activity\nWHERE state != 'idle' AND pid != pg_backend_pid();\n```\n\n…and then googling `pg_stat_activity columns`\n\nhalfway through because you forgot whether it's `wait_event`\n\nor `wait_event_type`\n\n.\n\nI got tired of that. So I built ** cli2ui** — a small web UI that turns the database CLI commands you keep half-remembering into buttons.\n\n```\npsql -c \"SELECT * FROM pg_stat_activity\"   →  one \"running queries\" button\npg_dump -t users mydb                       →  one \"back up this table\" button\nSELECT pg_terminate_backend(pid)            →  one \"kill this process\" button\n```\n\nNo AI. No SaaS. No magic. It runs **on your machine, right next to your database**, and your connection credentials never leave your network.\n\nIt's built for **app developers and solo developers** — not DBAs. The pitch is \"you're looking at your tables 3 minutes after deciding to\": `docker compose up`\n\n, connect, done. No install marathon, no connection-wizard maze, no digging through nested trees.\n\nA few of the things it puts one click away (PostgreSQL today):\n\n`\\d table`\n\n), and a row preview.`SET TRANSACTION READ ONLY`\n\ntransaction (so the `statement_timeout`\n\nand a 1000-row cap. Write mode is opt-in and takes a whole-database safety snapshot `pg_stat_activity`\n\nand the blocking tree from `pg_locks`\n\n+ `pg_blocking_pids`\n\n, with one-click cancel / kill.`wal_level`\n\n/ `max_wal_senders`\n\n), connected standbys, slot create/drop, and a copy-paste `pg_basebackup`\n\ncommand.`pg_settings`\n\n+ `ALTER SYSTEM SET`\n\n+ `pg_reload_conf()`\n\n, with reload-vs-restart badges.`pg_dump`\n\nsnapshots before every destructive change, restore of an uploaded dump streamed to the client tool (not buffered in memory).The UI ships in **English and Japanese** with a header toggle.\n\ncli2ui has **no authentication layer**. That sounds reckless until you look at the threat model: it's a trusted local tool sitting next to your database, not a multi-tenant service on the internet. No accounts, no outbound calls, no AI. Your DB credentials stay on your machine.\n\nThe moment you'd hold someone's database connection info on a server, the liability-and-encryption story swallows the whole project. Staying local keeps it honest — and the README is very loud about *\"don't expose this to an untrusted network.\"*\n\nBeing local doesn't mean being careless:\n\n`psycopg2.sql.Identifier`\n\n; the few raw-SQL spots (e.g. index access method, column type) go through fixed allow-lists.`autocommit=False`\n\nand always `ROLLBACK`\n\n.`localhost`\n\nand drop your database), and `X-Frame-Options: DENY`\n\nstops clickjacking the destructive buttons.`node_modules`\n\n. Panels are htmx partials; the page swaps `innerHTML`\n\nand that's the whole interaction model.That last bit is the thing I'm happiest about: adding a feature is small and mechanical, which is why the PostgreSQL coverage got deep instead of wide.\n\n```\ngit clone https://github.com/MR-TABATA/cli2ui\ncd cli2ui\ndocker compose up\n# then open http://localhost:8000\n```\n\nThe connection form is pre-filled to point at a bundled sample database — hit **Connect** and you're looking at its tables. To point at your own PostgreSQL, change the form fields. (Connecting to a database in *another* container trips everyone up — there's a [whole networking guide](https://github.com/MR-TABATA/cli2ui/blob/main/README.NETWORKING.md) for that.)\n\nIt's **MIT-licensed** and the code is on [GitHub](https://github.com/MR-TABATA/cli2ui). The landing page is at ** cli2ui.com**.\n\nIf you've ever rage-googled `pg_stat_replication`\n\ncolumns, I'd love your feedback — especially on what command you reach for most that *should* be a button.", "url": "https://wpnews.pro/news/i-turned-the-psql-commands-i-keep-forgetting-into-buttons", "canonical_source": "https://dev.to/hitoshi1964/i-turned-the-psql-commands-i-keep-forgetting-into-buttons-d26", "published_at": "2026-06-15 12:34:20+00:00", "updated_at": "2026-06-15 12:36:38.241346+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["cli2ui", "PostgreSQL", "GitHub", "MR-TABATA"], "alternates": {"html": "https://wpnews.pro/news/i-turned-the-psql-commands-i-keep-forgetting-into-buttons", "markdown": "https://wpnews.pro/news/i-turned-the-psql-commands-i-keep-forgetting-into-buttons.md", "text": "https://wpnews.pro/news/i-turned-the-psql-commands-i-keep-forgetting-into-buttons.txt", "jsonld": "https://wpnews.pro/news/i-turned-the-psql-commands-i-keep-forgetting-into-buttons.jsonld"}}