Skip to content

Using dirsql from the CLI

Online: https://thekevinscott.github.io/dirsql/cli/

dirsql ships a command-line interface that starts an HTTP server exposing the same indexing, querying, and watching functionality as the SDK — no host language required. Run it in any directory to query your files over HTTP: with no config it serves a default files table, and a config file defines custom tables.

Everything you need to run dirsql as a CLI lives in this section:

Installation

bash
npx dirsql
bash
uvx dirsql
bash
# Installs the binary only (the `cli` feature is non-default)
cargo install dirsql --features cli
dirsql

Node version

Requires Node ≥ 20.11.

For Rust library consumers

The cli feature is opt-in. See the Rust library README for instructions on how to include.

Quick start

From any directory containing your files (no config needed):

bash
dirsql

$ Running at localhost:7117

Then query it over HTTP:

bash
curl -s http://localhost:7117/query \
  -H 'content-type: application/json' \
  -d '{"sql":"SELECT COUNT(*) AS n FROM files"}' \
  | jq

See Running the Server for flags and HTTP API for the full endpoint reference.

Released under the MIT License.