English | 中文
A keyboard-first terminal database client in one static binary, built on the DBX kernel and sharing the connection store with DBX Desktop.
- One static binary — no desktop app, no daemon, no HTTP server.
- Shares DBX Desktop's
dbx.dbconnection store, so connections configured anywhere just appear. - Built-in MCP server (
dbxt mcp) serves DBX's owndbx_*tools to AI agents. - MySQL, PostgreSQL, Redis, MongoDB, SQLite, plus other engines through the kernel.
- Safety-first writes: read-only mode, red confirmations, and every write shows its SQL first.
- Run
dbxt, then↑↓+Enterto pick a connection (ccreates one). ↑↓+Enteropens a table; just type in the sidebar to filter.Tabto the SQL editor, type a statement, thenCtrl-J(caret statement) orF5(whole script).- In the results pane
eedits a cell,iinserts,Deleteremoves — the full SQL is shown before anything runs. ?opens a cheat-sheet for the current pane,F1the full key list.- The top line of the connection list is the day's tip — press
Tfor the next one.
One-line script — bash (also Termux), or PowerShell:
curl -fsSL https://raw.githubusercontent.com/vst93/dbxt/refs/heads/master/cmd/install.sh | bashirm https://raw.githubusercontent.com/vst93/dbxt/master/cmd/install.ps1 | iexChina mirror: use https://cdn.jsdelivr.net/gh/vst93/dbxt@master/cmd/install.sh (or .../install.ps1) instead.
Every release attaches one archive per platform plus a .sha256:
| File | Platform |
|---|---|
dbxt-linux-amd64.zip |
Linux x86_64 (glibc) |
dbxt-linux-arm64.zip |
Linux ARM64 (glibc) |
dbxt-linux-amd64-musl.zip |
Linux x86_64 (static) |
dbxt-linux-arm64-musl.zip |
Linux ARM64 (static) |
dbxt-darwin-amd64.zip |
macOS Intel |
dbxt-darwin-arm64.zip |
macOS Apple Silicon |
dbxt-windows-amd64.zip |
Windows x86_64 |
From source (Rust 1.85+ and a C toolchain; the first build compiles the DBX kernel and several C dependencies):
cargo install --git https://github.com/vst93/dbxtdbxt --version and dbxt --help answer without opening the TUI; dbxt [DBX_STORE] --last reconnects the last session's connection and reopens its database.schema.table.
Connections
- Connections live in DBX's own SQLite store (
dbx.db), so everything you configured there shows up automatically. ccreates a connection in-TUI,eedits the highlighted one,pduplicates it into the form,xdeletes it behind a red confirmation,Enterconnects;ssorts by name / type / colour and thecolorrow sets a stored accent.- DBX Desktop's connection groups mirror into the tree as foldable
▾ name [n]nodes. - Every root carries a status dot —
●live /○disconnected /◐connecting — andxdisconnects it behind a red confirmation. - The
read_onlyflag refuses every write statement at one choke point, whileSELECT/SHOW/EXPLAINstill run. query_timeouttakes seconds per connection — blank keeps the kernel default (60 s),0means no limit.Lopens a.db/.sqlite/.sqlite3file as a session-only connection that never touches the store.Alt-Eexports every connection as JSON;Alt-Iimports a dbxt bundle, a DBeaverdata-sources.jsonor a Navicat.ncxexport.- SSH tunnels pass through DBX's
transport_layers, accept~/.ssh/configaliases (includingProxyJump), prompt for an unknown host key, and report failures by stage — auth, host unreachable, or database unreachable.
SQL editor & results
Alt-/completes from the caret's context — only tables afterFROM/JOIN, only columns afterWHERE/ON/SELECT.Alt-Hopens the history panel — repeated statements merge with×n,fpins favourites,Ctrl-Enter/pruns one straight away;Alt-Fformats andCtrl-Ffinds in the buffer.Ctrl-Oinserts a saved snippet,Alt-Ssaves the current SQL in one step,Alt-Topens built-in templates.Alt-↓/Alt-↑step through statements;F8/Shift-F8jump to the statements that failed.- One result tab per run (
[/]switch,Alt-Wcloses);Ctrl-PrunsEXPLAINandCtrl-Yexports CSV / XLSX / JSON / NDJSON / Markdown / Text / INSERT to the clipboard or a file. - Multi-statement scripts run as a batch with one row and a timing summary per statement.
Table data
- Keyset pagination seeks by primary key, so big tables stay fast on any page; row counts are cached per table and filter.
e/i/Deleteedit, insert and delete with a full SQL preview first.Venters row-select mode andCtrl-Usets one column to one value for the whole block.ffilters,ssorts,g w/g Wauto-fit the focused column / every visible column.Enter/oopens the row popup,vthe cell popup,g cthe column popup with an in-place value distribution.Ycopies the focused cell;ycopies the row asINSERT.
Structure & diff
g dshows the table structure;g cadds the column popup (Dcomplete DDL,ycopies the structure as Markdown);Eon the connection tree exports a data dictionary.Alt-Ddiffs two table structures (also across connections);Shift+Alt-Dcompares two databases' table lists.Alt-Kcompares two tables' data, aligned by primary key and working across dialects.Alt-Tmoves a table's structure and/or rows to another connection.- Diffs generate
ALTER/ sync scripts but never execute them.
Redis
- A paginated
SCANkey browser, neverKEYS *, with type and TTL badges. tcycles a type filter,Ctrl-Tsorts by TTL,Tsets a key's TTL, andMsamples memory whileCtrl-Msorts by it.Spacemulti-selects for batch delete / TTL / rename behind the red confirmation layer;Ctrl-Lopens a rawredis-cliconsole.
MongoDB
- A collection browser using the same filter / first-letter-jump keys as the SQL table list.
fapplies a JSON filter,g fjumps to the first loaded document carrying a field, andccopies a dotted sub-path.e/i/Deledit, insert and delete documents with a field-level diff;ycopies one as pretty JSON andrshows indexes.
UI
?opens a context cheat-sheet (orF1in the editor, where?is literal);/filters it by key or feature.- The connection tree expands a table's foldable column outline with
>/<. - Mouse and touch work (click selects, a second click confirms, a double-click opens the row popup); a 20,000 × 12 grid scrolls at ~0.6 ms/frame.
- All UI strings come from one table (Chinese default,
DBXT_LANG=enswitches to English);F10opens a static About dialog.
The TUI's ? overlay and dbxt --help carry the complete list; this is the short version.
| Context | Keys |
|---|---|
| Global | ? context cheat-sheet (again for the full help, / filters it) · F1 full help anywhere · Tab/Shift-Tab panes · Alt-←/Alt-→ back/forward over tables, collections and Redis keys · F5 run all · Ctrl-J run the caret statement (a selection wins for both) · Alt-Enter run only the caret statement · Ctrl-L cycle SQL → Redis → MongoDB · Ctrl-A auto-collapse unfocused panes (select all rows in row-select mode) · Ctrl-W collapse/expand the focused pane · Ctrl-O DBX SQL snippets · Ctrl-P EXPLAIN (SQL) · Ctrl-S/Ctrl-X commit/clear the batch queue · F10 About dialog · q/Ctrl-C quit (two-stage when the editor holds unrun SQL) |
| Connections | ↑/↓ move · Enter connect · Alt-1..9 jump to the Nth connection (smart db/table restore) · Alt-Tab/Alt-` toggle with the previous connection · Alt-Shift-H recent connections (this session, up to 8) · c new · e edit · p duplicate · Y copy as xxx-copy · x delete/disconnect (red confirm) · P health probe · Ctrl-P probe every saved connection at once · L open a SQLite file · s sort (name/type/colour) · d database/schema switcher, or disconnect the highlighted connection in the picker · ! toggle the read-only flag · T next tip of the day |
| Editor | Alt-H history panel (Enter recall · Ctrl-Enter/p direct run · y/Y copy · a cyan ● marks this session's in-memory runs) · Alt-G global search · Alt-L run a .sql file · Alt-F format/compress · Ctrl-Z/Ctrl-U undo · Ctrl-Y/Ctrl-R redo · Alt-/ complete · Alt-Enter run the caret statement · Alt-↓/Alt-↑ step statements · F8/Shift-F8 jump to the last run's failures · Ctrl-F find in the buffer · Ctrl-//Alt-C toggle -- comments · Ctrl-Shift-V paste from the session clipboard ring · Alt-P paste a snippet at the caret · Alt-T built-in SQL templates · % jump to the matching bracket · F2 statement-ordinal gutter · F5 run all · Ctrl-J run the caret statement · ↑/↓ history |
| Results | ↑/↓ rows · ←/→ columns · Home/End/gg/G first/last row · : jump to a row by number (:$ last) · n/p pages · PgUp/PgDn full page, Ctrl-U half a page up · gd/gt structure/data · g b switch table in the same database · g w/g W fit widths · g c column popup · D complete DDL · Alt-F pin/unpin the pane · gv locate a value · ` |
| Structure / diff | r table structure · t toggle DDL · D complete DDL popup · Alt-D table diff (c picks another connection) · Shift+Alt-D database compare · Alt-K data compare (m toggles schema/data, w WHERE) · Alt-T transfer wizard outside the editor · Tab switch panes · y copy summary · g generate a script · Esc close |
| Redis | Space select · a all · Del/x/m batch delete/TTL/rename · T set TTL · t type filter · Ctrl-T TTL sort · M sample memory · Ctrl-M memory sort · Shift-M clear the cache · / MATCH · Alt+letter first-letter jump · n more · e edit · Enter value |
| MongoDB | e edit · i insert · Del delete · f JSON filter · g f field jump · Ctrl-S size sort · c copy a dotted path · y copy JSON · n/p pages · r indexes |
| Overlays | Enter/y confirm · Esc/n cancel · ↑/↓ scroll · every Esc flashes a 1.5 s status message |
dbxt mcp runs DBX's own MCP server out of the dbxt binary. It is not a reimplementation: the server is dbx_mcp::DbxMcpServer, the exact struct the official dbx-mcp serves, so tools, resources, sessions, transactions and the Settings → MCP policy are identical.
| Command | Transport | Use it for |
|---|---|---|
dbxt mcp |
stdio (newline-delimited JSON-RPC) | Claude Code, Cursor, Codex — clients that spawn a command |
dbxt mcp --http |
Streamable HTTP (loopback + bearer token) | HTTP-capable clients, Docker, long-lived endpoints |
Stdio client entry (use the absolute dbxt path; GUI clients may not inherit PATH):
{ "mcpServers": { "dbx": { "command": "/absolute/path/to/dbxt", "args": ["mcp"] } } }HTTP is loopback-only and always requires a bearer token; dbxt mcp --help lists every option and environment variable (DBX_DATA_DIR, DBX_SECRET_KEY_FILE, DBX_MCP_HTTP_TOKEN, …). MCP policy, allowlists and database scopes are the ones saved in DBX (Settings → MCP), re-checked on every call.
~/.config/dbxt/tui.jsonholds UI preferences and per-table column widths (capped at 200 entries, LRU eviction).~/.config/dbxt/last-session.jsonrecords where the last run left off;--lastauto-resumes it.DBXT_LANG=en|zhselects the UI language (the locale decides when unset).DBX_DATA_DIRpoints dbxt at a different DBX store.DBXT_NO_PERSIST=1disables the session and UI files.
- dbxt builds against DBX v0.6.34; the kernel encrypts connection / plugin / AI / tunnel secrets at rest since v0.6.27, with a key that lives outside the database.
- On a legacy plaintext store, dbxt runs the kernel's own data-security upgrade at startup — backup → encrypt → verify — after which the store needs DBX v0.6.21+ to be read.
- Key sources, in kernel resolution order:
DBX_SECRET_KEY_FILE(a key file),DBX_SECRET_KEY(the environment), the OS keychain, then the managed<data-dir>/.dbx/secret.key. - The upgrade provisions the key the way the desktop wizard does and never overwrites an existing one; if ciphertext exists without its key, dbxt stops and asks for the original.
- On a host where the keychain is present but locked, dbxt catches
KEYRING_WRITE_FAILED/KEYRING_ACCESS_FAILEDand falls back to the managed key file, adopting it on later runs. - A dbxt built against a pre-encryption kernel (v0.6.20 and earlier) cannot read an upgraded store.
- Verified end-to-end against real MySQL 8.4, PostgreSQL 16, Redis and MongoDB servers.
- Seven prebuilt archives; only the Linux x86_64 build has been exercised locally, the others build in CI but are untested.
- Roadmap: cross-page search, Excel (
.xlsx) import, a dedicated Android/Termux build.
- Table size metadata is MySQL / PostgreSQL only —
son a database row reports unsupported on other engines. - Global search (
Alt-G) is MySQL / PostgreSQL only. - No
.xlsximport — deliberately out of scope; use CSV. Export to XLSX is supported. - Search is page-local —
/searches the visible rows, not the whole result set; cross-page result search is not implemented. - A large export warns, not stops — result sets over 10,000 rows warn before
Ctrl-Yproceeds. - Read-only detection fails closed — a statement with an unrecognised verb counts as a write, so a rare ambiguous read is refused by design.
- Redis / MongoDB are out of scope for the
Alt-Ttransfer wizard and theAlt-D/Alt-Kdiffs. - Only the Linux x86_64 prebuilt archive has been exercised locally — the other six build in CI but are untested.
- No dedicated Android/Termux artifact — the static aarch64 build usually runs; otherwise build from source.
- The connection tree reads the desktop group layout once per session, so a regrouping in DBX Desktop shows up on the next dbxt launch.
Apache-2.0, same as DBX. dbxt is an independent client built on the DBX kernel by t8y2; it is not a fork and is not affiliated with or endorsed by the DBX project.