Settings

Theme

Show HN: Dbcli – A Lightweight Database CLI Designed for AI Agents

1 points by justvugg 9 days ago · 2 comments · 1 min read


I built dbcli, a lightweight database CLI designed specifically for AI agents that need fast, low-overhead access to relational databases.

The main idea is to make database introspection and querying simple and efficient when an agent has shell access. With a single command (dbcli snap), you can retrieve schema details, table relationships, and basic data profiling (column stats, ranges, cardinality) without stitching together multiple queries or tools. This helps reduce token usage and unnecessary round-trips in agent workflows.

Dbcli supports multiple databases, including PostgreSQL, MySQL, MariaDB, SQLite, DuckDB, ClickHouse, SQL Server, and others via optional drivers. It allows running queries, executing SQL files, and writing data directly from the CLI. There’s no server process or external service required — just install locally with:

pip install -e .

The goal is to provide a simple, agent-agnostic alternative to heavier protocol-based approaches, working with any system capable of executing shell commands.

I’d really appreciate feedback, especially from those building AI agents or tools that require structured database access.

Github repo: https://github.com/JustVugg/dbcli

xing_horizon 9 days ago

Nice tool direction. For agent workflows, a snapshot command that returns schema + stats in one shot is genuinely useful. One thing that could make this even stronger for multi-agent pipelines: stable snapshot metadata (timestamp, source DB identity, row-count hash) so downstream agents can detect staleness and avoid reasoning on outdated state.

  • justvuggOP 9 days ago

    Thanks for the suggestion and for the comment! I will try to implement more and more things as soon as the usage becomes hopefully wider!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection