Skip to content
dbterm

Practical reference for daily usage

dbterm guide

This page documents the real app workflow from connection setup to production-safe operations. Keep it open while onboarding new users.

Setup + workflowKeybindings by contextServices + backup actionsTroubleshooting tips

1. Start in 60 seconds

Install, connect, run SQL, then iterate in panel-focused flow.

Install on Linux / macOS

curl -fsSL https://raw.githubusercontent.com/shreyam1008/dbterm/main/install.sh | bash

Install on Windows

powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/shreyam1008/dbterm/main/install.ps1 | iex"

1. Install dbterm

Use the shell installer for Linux/macOS or PowerShell installer for Windows.

2. Create a connection

Press N and enter the MySQL/PostgreSQL server login. The database is optional: Save & Connect opens every accessible database when no default is set.

3. Run your first query

Focus Query panel (Alt+Q), type SQL, and press Enter to run.

4. Inspect and iterate

Use Alt+T and Alt+R to move between tables and results while refining SQL.

2. Understand the workspace

dbterm is optimized around panel focus and keyboard flow.

Scroll horizontally to inspect every column.

PanelPrimary behaviorCore keys
DashboardManage saved server logins, browse every accessible database, enter Backup Center, and reconnect quickly.N, E, D, Enter, A, B, R
QueryWrite SQL and execute it directly against the current database session.Alt+Q, Enter, Shift+Enter
TablesBrowse grouped schema objects, type to jump, pin frequent tables, and load data into Results.Alt+T, type, Space, F5, Ctrl+F5
ResultsFilter typed values, follow foreign keys, page and sort data, inspect full cells, and export selected/current/all-matching CSV.Alt+R, /, V, F, S, PgUp/PgDn, Alt+E, Enter, +/−

3. Essential shortcuts

Use these to avoid context switching and keep query loops fast.

Scroll horizontally to inspect every shortcut and action.

ShortcutAction
Ctrl + PFuzzy-search commands, database objects, and recent SQL (default binding)
Alt + Q / T / RFocus Query, Tables, or Results panel
Space (Tables)Pin or unpin the highlighted table at the top for this database connection
EnterExecute query (in Query panel)
Shift + EnterNew line in query (multiline SQL)
Alt + YOpen per-connection query history
Alt + A / Alt + CSelect all result rows / clear selection
Space (Results)Toggle current row selection
C (Results)Copy the selected cell's complete value
/ / V (Results)Build typed AND filters / filter the selected column by clipboard value
F / Backspace (Results)Follow a declared foreign key / return to the previous table
Alt + EExport selected rows, the current page, or all rows matching active table filters
Alt + IOpen SQL import modal for active connection (PostgreSQL/MySQL)
I (Dashboard)Import SQL dump into selected saved PostgreSQL/MySQL connection
A (Dashboard)Browse every database visible through the highlighted PostgreSQL/MySQL server login
G (Dashboard) / Alt + ,Open keymap settings page
Alt + HToggle help + SQL cheatsheets
Alt + DBack to dashboard
Alt + SOpen services dashboard
Alt + K / B (Dashboard)Open Backup Center for schedules, history, inspection, restore, and agent status
Ctrl + B (Dashboard)Create a backup policy from the highlighted saved connection
F5 / Ctrl + F5Refresh current table / refresh list + table
PgUp / PgDn, Home / EndNavigate previous/next and first/last result pages
Alt + FToggle fullscreen results
Alt + BInstant backup from any workspace panel; F2 chooses a folder and F3 refreshes disk capacity
N (Backup Center)Choose an existing saved database or add one for a new plan
Ctrl + N (plan form)Add another saved database without leaving the backup workflow
Alt + = / - / 0Adjust preview row limit
Ctrl + = / -Resize all columns (remembered per table)
Ctrl + 0Reset this table's column widths
+ / -Resize selected column (remembered per table)
Ctrl + CCancel an active query/import/export; otherwise quit

Use Esc and Backspace to back out safely from most views if you lose focus.

4. Instant backup, scheduled agent, guarded restore

One backup engine serves the TUI, CLI, and background agent. See the focused Backup Center guide for the complete operator model.

Inspect service state

Press Alt+S from anywhere to view MySQL/PostgreSQL status and quick actions.

Toggle MySQL/PostgreSQL

Inside services, use key 1 for MySQL and key 2 for PostgreSQL start/stop.

Connect directly from services

Use C or Enter, select a saved database login or enter credentials, and leave Database blank to browse every accessible database.

Keep instant backup

Press Alt+B from Tables, Query, or Results for a one-off engine-appropriate backup. Type a destination or press F2; F3 refreshes destination and staging capacity.

Schedule the durable path

Highlight a saved connection and press Ctrl+B, or open Backup Center and press N to choose a saved database or add one. Essentials stay first; advanced controls expand only when needed.

Choose desktop or server mode

Desktop mode needs no administrator access. Server mode registers at machine boot, uses explicit data paths, and clearly shows the elevated command required.

Watch storage and progress

See the destination volume and free space before saving, then follow phase, bytes, elapsed time, rate, and ETA without a fabricated database-row percentage.

Bound and report every job

Combine count, age, and total-size retention; prune oldest eligible artifacts now; and notify by Gmail defaults or custom SMTP on failure, success, both, or never.

Inspect before restore

Press I. dbterm unwraps gzip, zstd, ZIP, or age and detects the database format from content before a destination can be selected.

Headless setup

dbterm backup keygen
dbterm backup service install
dbterm backup service status --all
dbterm backup logs --lines 200
dbterm backup inspect --identity ./age-identity.txt ./prod.dump.zst.age
dbterm backup restore --connection production --identity ./age-identity.txt --yes ./prod.dump.zst.age

Scheduled destinations can be absolute local/mounted folders or rclone://remote/path locations. Configure rclone under the backup agent’s OS account. PostgreSQL/MySQL require their official clients; SQLite SQL restore requires sqlite3. Restore supports PostgreSQL, MySQL/MariaDB, and local SQLite. Merge is the restore default; clean restore is explicit and destructive.

Retention can combine newest-count, maximum-age, and total-size ceilings. Backup Center previews capacity and can apply the policy immediately; cleanup is restricted to verified artifacts recorded for that exact job, and always preserves its newest successful backup.

Per-job email can report failures, successes, both, or neither. Gmail defaults to STARTTLS on port 587; custom SMTP and implicit TLS are available. Test delivery before relying on it, and protect the locally stored app password.

Desktop scope is the no-admin default. Server scope runs at machine boot without an interactive login and requires elevation plus explicit existing config, state, and log paths. Runtime start/stop and startup enable/disable are deliberately separate controls.

Linux

XDG_CONFIG_HOME/dbterm
XDG_STATE_HOME/dbterm

macOS

~/Library/Application Support/dbterm
~/Library/Logs/dbterm

Windows

%AppData%\dbterm
%LocalAppData%\dbterm

Run dbterm backup paths for exact resolved paths. Raw dumps are wrapped in private state staging before the finished artifact is published to your destination, so private state needs room for one uncompressed dump. The live view shows real phase, byte growth, elapsed time, rate, and ETA where a meaningful total exists. Uninstalling only the agent never removes completed artifacts.

Restore only trusted files: dbterm rechecks content, checksum, engine, and client-side commands, but valid SQL can still perform any server-side action allowed to the selected database account. Turso exports use one source transaction and reject virtual/FTS schemas; D1 uses Cloudflare's native export API, which can briefly make that database unavailable.

Inspection unwraps at most three layers. Every decoded gzip, zstd, ZIP, or age layer has a 1 GiB default cap and uses private OS temporary storage; raise it with the TUI’s Max Decoded GiB field or --max-decoded-gib N, with enough temporary disk space available.

backup keygen defaults the private identity into dbterm config. For recovery safety, --uninstall --purge refuses to remove a private age identity or backup-like file it discovers there; move the key somewhere safe or delete it explicitly before retrying.

5. CLI maintenance reference

Use CLI mode for updates, diagnostics, and uninstall operations.

CLI command set

dbterm
dbterm --help
dbterm --version
dbterm --info
dbterm --update
dbterm --update X.Y.Z
dbterm --uninstall
dbterm --uninstall --purge
dbterm --uninstall --yes
dbterm backup --help
dbterm backup list
dbterm backup run <job>
dbterm backup inspect <file>
dbterm backup restore --connection <target> --yes <file>
dbterm backup service install
dbterm backup service status --all
dbterm backup service enable
dbterm backup prune --yes <job>
dbterm backup notify-test <job>
dbterm backup logs --lines 200
dbterm backup keygen
dbterm backup paths

Scroll horizontally to inspect every command and purpose.

CommandPurpose
dbtermLaunch interactive TUI
dbterm --helpShow command help
dbterm --versionShow version + build details
dbterm --infoShow install path, config path, and runtime info
dbterm --updateUpdate to latest release
dbterm --update X.Y.ZUpdate to a specific release
dbterm --uninstallUninstall binary with confirmation
dbterm --uninstall --purgeRemove binary + dbterm-owned config/state/logs; chosen backup artifacts stay
dbterm --uninstall --yesUninstall without prompt
dbterm backup --helpShow backup and agent commands
dbterm backup listList durable jobs and next runs
dbterm backup run <job>Run a job immediately
dbterm backup inspect <file>Detect wrappers, engine, checksum, and warnings
dbterm backup restore --connection <target> --yes <file>Run the guarded, content-inspected restore flow
dbterm backup service installInstall and start the native current-user agent
dbterm backup service status --allInspect desktop and server registrations, startup, runtime, and heartbeat
dbterm backup service enableEnable automatic startup independently of starting the agent now
dbterm backup prune --yes <job>Apply the job's retention ceilings immediately
dbterm backup notify-test <job>Send a test message using the job's SMTP settings
dbterm backup logs --lines 200Read the bounded agent log tail locally or over SSH
dbterm backup keygenGenerate an age X25519 identity and public recipient
dbterm backup pathsPrint OS-native config, state, log, and catalog paths

6. Troubleshooting quick list