usql
agent-ready json output non-interactive
Universal command-line interface for SQL databases
How to install usql
brew install xo/xo/usql usql use case
Execute SQL queries and manage databases across multiple SQL and NoSQL systems from a single command-line interface.
When to use usql
- Running SQL queries interactively or non-interactively across different database backends (PostgreSQL, MySQL, SQLite, etc.)
- Copying data or schema between heterogeneous databases (e.g., PostgreSQL to MySQL) with built-in backslash commands
- Automating database tasks in scripts or CI/CD pipelines using non-interactive mode and JSON output
When not to use usql
- When a full-featured GUI database management tool is preferred for visual schema editing
- For complex data migrations requiring specialized ETL tools or vendor-specific optimizations
usql features
- · Supports PostgreSQL, MySQL, Oracle, SQLite, SQL Server, and many other databases
- · psql-compatible backslash commands (\dt, \l, \copy, etc.)
- · Syntax highlighting and context-aware autocompletion
- · JSON, CSV, and vertical column output formatting (-J flag for JSON)
Want your agent to find this automatically?
Add the MCP server to your agent config and it will discover tools like usql on its own.
Set up MCP →