harlequin

Portable, powerful, colorful.

An easy, fast, and beautiful database client for the terminal.

Harlequin ╭─ Data Catalog ─────────────╮╭─ Query Editor ─────────────────────────────────────────────────────────────────────────╮ │▼ f1 db││ 1  select│ │└─ ▼ main sch││ 2  drivers.surname, │ │├─ ▶ circuits t││ 3  drivers.forename, │ │├─ ▶ constructor_result││ 4  drivers.nationality, │ │├─ ▶ constructor_standi││ 5  avg(driver_standings.position)asavg_standing, │ │├─ ▶ constructors t││ 6  avg(driver_standings.points)asavg_points│ │├─ ▶ driver_standings t││ 7  fromdriver_standings│ │├─ ▼ drivers t││ 8  joindriversondriver_standings.driverid =drivers.driverid │ ││  ├─ code s││ 9  joinracesondriver_standings.raceid =races.raceid │ ││  ├─ dob d││10  groupby1, 2, 3│ ││  ├─ driverId ##││11  orderby avg_standing asc │ ││  ├─ driverRef s│││ ││  ├─ forename s│││ ││  ├─ nationality s│││ ││  ├─ number s│││ ││  ├─ surname s│╰────────────────────────────────────────────────────────────────────────────────────────╯ ││  └─ url s│▐X▌Limit 500Run Query │├─ ▶ lap_times t│╭─ Query Results (850 Records) ──────────────────────────────────────────────────────────╮ │├─ ▶ pit_stops t││ surname s forename s nationality s avg_standing #.# avg_│ │├─ ▶ qualifying t││ Hamilton                 Lewis              British                     2.66238 │ │├─ ▶ races t││ Prost                    Alain              French                       3.5098 │ │├─ ▶ results t││ Stewart                  Jackie             British                     3.77885 │ │├─ ▶ seasons t││ Schumacher               Michael            German                      4.32588 │ │├─ ▶ sprint_results t││ Verstappen               Max                Dutch                       5.09146 │ │└─ ▶ status t││ Fangio                   Juan               Argentine                   5.22388 │ │││ Pablo Montoya            Juan               Colombian                   5.24752 │ │││ Farina                   Nino               Italian                     5.27083 │ │││ Hulme                    Denny              New Zealander               5.33898 │ │││ Fagioli                  Luigi              Italian                     5.66667 │ │││ Clark                    Jim                British                     5.81395 │ │││ Vettel                   Sebastian          German                      5.83946 │ │││ Senna                    Ayrton             Brazilian                      5.92 │ │▉││▎│ ╰────────────────────────────╯╰────────────────────────────────────────────────────────────────────────────────────────╯  ^q Quit  f1 Help  f8 History 

One Engine, Two Interfaces.

harlequin and hsql share adapters, config files, profiles, and a query engine, so you, your scripts, and your agents can share one tool.

Runs Anywhere.

Any shell, any terminal, any machine. Fish in tmux on Alpine over SSH? Sure. Windows cmd? Yep.

Works with Your Database.

Whether in-process, local, or in the cloud, Harlequin makes it easy to explore your data.

More coming soon. Don't see your database here? Open an issue or create your own adapter.

harlequin

For humans, by humans

A feature-rich TUI.

The features you'd expect from an IDE, delightfully running right in your terminal.

  • Data Catalog

    View tables, columns, and their types across one or more attached databases. Optionally view local files or S3 objects.

  • Query Editor

    A full-featured editor: autocomplete, open, save, format, cut, copy, paste, and more. Supports multiple tabbed buffers!

  • Results Viewer

    View 1M+ results in an interactive table. Multiple queries loaded into separate tabs.

  • Full Screen

    Need more room? Press F10 to view the Editor or Results in full-screen mode.

  • Results Export

    Export query results and configure the export using a helpful UI.

  • Query History

    View a list of executed queries and a summary of results. Select to insert into a new buffer.

  • Themes

    A dozen built-in themes, to suit any taste (light or dark).

hsql

Your agent's favorite SQL client

More features, fewer tokens.

A fast and powerful CLI designed for efficient and safe use by agents.

  • Flexible inputs

    Execute one or more statements from the command line, files, or stdin.

    $ hsql -P dev -tAc "select 1"
    1
    $ hsql -P prod --result all --on-error stop \
      -f ./setup.sql \
      -c "select count(*) as raw from raw_table" \
      -f ./build-models.sql \
      -c "select count(*) as mod from model" 
  • Any output

    Write results to stdout or a file, in several customizable formats.

    $ hsql --csv --limit -1 -f report.sql > out.csv
    $ hsql -tAc "select count(*) from 'out.csv'"
    1284
    $ hsql --limit 1 --vertical -c "select count(*) from 'out.csv'"
    -[ RECORD 1 ]-----------
    id           | 1234
    company_id   | 111
    company_name | Acme Corp
  • Designed for Agents

    Documented and discoverable commands that work on any database; safe defaults; compact output.

    $ hsql -P bigquery --markdown --stats -f q.sql
    {"status":"ok","rows":500,"truncated":true}
    | order_id | customer |
    | -------- | -------- |
    | 1001     | acme     |

Join the Flock.

Thousands are using Harlequin. Join them with uv tool install harlequin.