harlequin
The SQL IDE for Your Terminal. Now with hsql, your agent's favorite sql client.
What is harlequin?
The SQL IDE for Your Terminal. Now with hsql, your agent's favorite sql client.
Overview of harlequin
What it is
Harlequin is a SQL IDE that runs in the terminal. It is a Python program that provides a text-based user interface for writing and executing SQL queries. The project also includes a companion command-line interface called hsql, which is designed for use by AI agents and in automated scripts.
Key features
- Terminal-based SQL IDE with a graphical interface
- Supports multiple databases through adapter plug-ins, including DuckDB and SQLite adapters that ship with Harlequin
- Includes hsql, a headless CLI for agents and automations that uses the same adapters and config files
- Configurable via command-line options or config files; config files can reference environment variables for credentials
- Supports read-only mode and query timeouts to bound what an agent can do- hsql can explore the database catalog and search across all levels
Use cases
- Interactive SQL querying and data exploration in the terminal
- Automating SQL tasks with scripts or AI agents using hsql
- Connecting to various databases (DuckDB, SQLite, Postgres, MySQL, etc.) via adapter plug-ins
- Sharing configuration across a team without exposing credentials
Getting started
Install Harlequin using uv:curl -LsSf https://astral.sh/uv/install.sh | shuv tool install harlequinOr using pip:pip install harlequinOr using Homebrew:brew install harlequinRun Harlequin with no arguments to open an in-memory DuckDB session:harlequin
License and pricing
Harlequin is open source under the MIT license.
Based on the project's public README and repository metadata.