____ _ _ ____
/ ___| |__ ___ ___| |_| __ ) __ _ ___ ___
| | _| '_ \ / _ \/ __| __| _ \ / _` / __|/ _ \
| |_| | | | | (_) \__ \ |_| |_) | (_| \__ \ __/
\____|_| |_|\___/|___/\__|____/ \__,_|___/\___|
GhostBase 👻🗄️
A fast, keyboard-driven terminal database studio for SQLite, PostgreSQL, and MySQL.
No Java runtimes. No 1.5GB RAM bloat. Built-in production safety guard, instant SQL beautifier & zero-config.envconnect.
⚡ Why GhostBase?
Opening DBeaver or DataGrip just to run a quick SELECT, inspect an index, or check foreign keys is painful:
- ❌ 1.5 GB+ RAM bloat: Heavy Java/Eclipse runtimes that spin your laptop fans.
👉 GhostBase idles at ~25 MB RAM. - ❌ 15-Second Cold Starts: Splash screens, driver updates, and workspace indexing.
👉 GhostBase starts in under 120 ms directly in your terminal. - ❌ Accidental Destructive Queries on Production: Running
DELETEorUPDATEwithout aWHEREclause can wipe production tables.
👉 GhostBase intercepts destructive queries automatically with double-confirmation and one-key Read-Only Safe Mode (Ctrl + S). - ❌ Messy, Unformatted Queries: Manually formatting and indenting long SQL statements.
👉 GhostBase auto-formats and beautifies messy SQL queries with one keypress (Ctrl + B). - ❌ Tedious Connection Setup: Typing credentials into multi-tab dialogs.
👉 GhostBase auto-detectsDATABASE_URLfrom your local.envfile. - ❌ Seeding & Migrating Data: Manually writing
INSERT INTOstatements to replicate test rows.
👉 GhostBase exports query results directly into executable SQLINSERTstatements (Ctrl + I). - ❌ Exporting for GitHub / Jira / Notion: Exporting CSV, then finding a website to convert to Markdown.
👉 One-key instant Markdown table export (Ctrl + M) directly into clean GitHub Flavored Markdown.
🚀 Killer Features
- 🛡️ Production Safety Guard & Safe Mode (
Ctrl + S):- Intercepts dangerous statements (
DELETE/UPDATEwithoutWHERE,DROP TABLE,TRUNCATE). - In Safe Mode, all destructive operations are strictly blocked.
- In normal mode, requires explicit double-confirmation before execution.
- Intercepts dangerous statements (
- ✨ 1-Key SQL Beautifier (
Ctrl + B):- Instantly cleans up whitespace, capitalizes SQL keywords, and indents sub-clauses (
FROM,WHERE,AND,OR,JOIN,ORDER BY).
- Instantly cleans up whitespace, capitalizes SQL keywords, and indents sub-clauses (
- ⚡ 1-Key Query Plan (
Ctrl + P):- Run instant execution plans (
EXPLAIN QUERY PLAN/EXPLAIN) on any query to see index usage and bottlenecks.
- Run instant execution plans (
- 🔌 Universal Database Support: Connects natively to SQLite, PostgreSQL, and MySQL.
- 🔍 Zero-Config
.envAuto-Connect: Just runghostbasein any project folder; it automatically picks upDATABASE_URLor standard database environment variables. - 🔎 Real-time Table Search (
Ctrl + F): Type in the search bar to filter dozens of tables and views instantly. - 📊 Explorer with Tables & Views: Browse tables and views with live row counts.
- 📐 Instant Schema & Foreign Keys: See primary keys, column types, nullability, and foreign key references at a glance.
- 💾 Multi-Format Exports: Instant SQL
INSERTs (Ctrl + I), Markdown (Ctrl + M), CSV (Ctrl + E), and JSON (Ctrl + J). - 📜 Query History: Cycle through your last 20 queries with
Ctrl + ↑andCtrl + ↓. - 🎨 Clean Cyberpunk Aesthetic: Fast, high-contrast, zero-flicker terminal interface.
📦 Installation & Quick Start
Via pip
pip install ghostbase-cli
From Source
git clone https://github.com/4yk5/GhostBase.git
cd GhostBase
pip install -r requirements.txt
💻 How to Use
1. Auto-connect to current project (.env)
# Automatically finds DATABASE_URL or DB_HOST in your current directory's .env
ghostbase
2. Connect to SQLite
ghostbase path/to/database.db
3. Connect to PostgreSQL
ghostbase postgresql://user:password@localhost:5432/my_database
4. Connect to MySQL
ghostbase mysql://user:password@localhost:3306/my_database
5. Launch in Safe / Read-Only Mode
ghostbase postgresql://prod-db:5432/main --read-only
⌨️ Keyboard Shortcuts
| Shortcut | Description |
|---|---|
Ctrl + R |
Execute SQL Query (runs the query with safety validation) |
Ctrl + P |
1-Key EXPLAIN (instant query execution plan and performance inspector) |
Ctrl + B |
Beautify SQL (auto-formats, capitalizes keywords and indents clauses) |
Ctrl + S |
Toggle Safe Mode (enable/disable destructive query protection) |
Ctrl + N |
New Query (clears editor for a clean query) |
Ctrl + F |
Find Table (focuses table search filter) |
Ctrl + I |
Export to SQL INSERTs (generates executable INSERT INTO statements) |
Ctrl + M |
Export to Markdown (GitHub / Jira / Notion ready table) |
Ctrl + E |
Export to CSV (exports current table/query to CSV) |
Ctrl + J |
Export to JSON (exports current table/query to JSON) |
Ctrl + ↑ / Ctrl + ↓ |
Query History (cycle through previous queries) |
Tab / Shift + Tab |
Navigate between explorer, search, editor, and data table |
Ctrl + Q |
Quit GhostBase |
📬 Contact & Inquiries
For partnerships, feature requests, or business inquiries:
📧 contact.4yk5@proton.me
📄 License
Released under the MIT License.
Metadata
Release files for ghostbase-cli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ghostbase_cli-0.1.0.tar.gz | 29.0 kB | Without provenance | Details for ghostbase_cli-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ghostbase_cli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ghostbase_cli-0.1.0-py3-none-any.whl |
Total release size: 46.9 kB
Release files / ghostbase_cli-0.1.0.tar.gz
| Download URL | ghostbase_cli-0.1.0.tar.gz |
|---|---|
| Size | 29.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5addcdb341bea734a62fb6aa75a9be4d0ac04ea147065d104c839021a8ee51dc
|
|
BLAKE2b-256 checksum How to use checksums |
6a07d620049dc3bad2dece49f9689cba3a4781220837d5c51324de3417ebcee8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Release files / ghostbase_cli-0.1.0-py3-none-any.whl
| Download URL | ghostbase_cli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
164a277aa2d5ac5415aa958c6e61d0a1228834a2c9ef0c6bc2d32bf51ce156fd
|
|
BLAKE2b-256 checksum How to use checksums |
20b566cfdd5c5168f99f893542f1592c91f25c709f57ed1593a0c63e9b845983
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Security for ghostbase-cli 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.