Repolode
tconbeer

tconbeer/harlequin

A terminal SQL IDE with a built-in DuckDB client and plug-in adapters for many databases, plus a headless companion CLI, hsql, for agents and scripts.

Open-source alternative to:DBeaverDataGrip

Stars
6,513
Forks
189
Open issues
36
Last commit
yesterday

What is it?

Harlequin is a SQL client that runs in the terminal as a full-screen interface. It ships with a DuckDB adapter that includes the in-process DuckDB engine and a SQLite3 adapter, and other databases such as Postgres, MySQL/MariaDB, Snowflake, and ODBC sources are available as installable adapter packages. Users can open in-memory or file-based databases directly from the command line, and configure connections and options through profile files.

Alongside the interactive app, Harlequin includes hsql, a companion CLI that uses the same adapters and config files but is designed for non-interactive use. hsql can run queries and print results, browse the catalog for schemas, relations and columns, and search across catalog levels. Read-only mode and query timeouts help bound what automated tools can do. Config profiles can read credentials from environment variables and mask secret values when printed.

Harlequin is a Python package installable with uv, pip or Homebrew, and it runs on Linux, macOS and Windows.

Key features

  • 01Full-screen SQL editor and results view that runs in the terminal.
  • 02Built-in DuckDB and SQLite3 adapters, with more databases available as plug-ins.
  • 03Data catalog browsing for schemas, tables and columns.
  • 04Config profiles with environment variable substitution and masked secrets.
  • 05hsql companion CLI for scripts and agents, with read-only mode and query timeouts.

Use cases

  • Querying local DuckDB or SQLite files without leaving the terminal.
  • Exploring a production or analytics warehouse over SSH from a remote shell.
  • Letting an AI agent run read-only SQL against a database through hsql.
  • Running SQL queries from shell scripts or automation pipelines.

In collections

Topics

FAQ

What is harlequin?
A terminal SQL IDE with a built-in DuckDB client and plug-in adapters for many databases, plus a headless companion CLI, hsql, for agents and scripts. Harlequin is a SQL client that runs in the terminal as a full-screen interface. It ships with a DuckDB adapter that includes the in-process DuckDB engine and a SQLite3 adapter, and other databases such as Postgres, MySQL/MariaDB, Snowflake, and ODBC sources are available as installable adapter packages. Users can open in-memory or file-based databases directly from the command line, and configure connections and options through profile files.
Is harlequin free to use? What license does it have?
harlequin is open source under the MIT license. Check the license terms before using it in commercial products.
Is harlequin still maintained?
Actively maintained. The last commit to harlequin was on Nov 6, 2026.
What can I use harlequin for?
Querying local DuckDB or SQLite files without leaving the terminal. Exploring a production or analytics warehouse over SSH from a remote shell. Letting an AI agent run read-only SQL against a database through hsql. Running SQL queries from shell scripts or automation pipelines.
Where can I get harlequin?
The source code and installation instructions are on GitHub: https://github.com/tconbeer/harlequin

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects