hotdata-cli README

README проекта с github.com/hotdata-dev/hotdata-cli. Одним файлом markdown: README.md.

Hotdata
Hotdata CLI
Command line interface for Hotdata.

release build coverage


Load your data into a Hotdata database, then query, join, and search it with plain SQL. Data can come from files on your machine, a URL, or an external source such as Postgres, S3, Iceberg, Kafka, or one of ~150 API services.

📖 Full documentation: hotdata.dev/docs

Install

curl -fsSL https://hotdata.dev/install | sh

That's it. The installer uses Homebrew if you have it (brew install hotdata-dev/tap/cli) and also installs the Hotdata skill for AI coding agents such as Claude Code. You can also download a binary from Releases.

The CLI tells you when a new version is out; upgrade with hotdata manage upgrade.

Quickstart

# 1. Log in (or create an account with: hotdata auth register)
hotdata auth login

# 2. Create a database and make it your current one
hotdata databases create --catalog demo
hotdata databases use demo

# 3. Load some data
hotdata databases load --catalog demo --table trips \
  --url https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2024-01.parquet

# 4. Query it
hotdata query "SELECT count(*) FROM demo.public.trips"

Tables are addressed as catalog.schema.table. Here the catalog is demo and the default schema is public. The examples below build on this demo database. For a longer walkthrough, see the quick start guide.

Load your data

From a file or URL (CSV, JSON, or Parquet). Point --file at your own file, or --url at one online:

hotdata databases load --catalog demo --table my_table --file ./my-data.csv

A load replaces the table. To add rows instead, use --mode append:

hotdata databases load --catalog demo --table my_table --file ./more-data.csv --mode append

To change existing rows by key, use --mode update, --mode delete, or --mode upsert with --key <column>.

From an external source such as Postgres, MySQL, S3, GCS, Iceberg, Kafka, or an API service: first save the connection details as a datasource, then create an ingest that copies data into your database once or on a schedule.

hotdata ingest sources types        # see what you can connect to
hotdata ingest sources add          # save a datasource (you'll be prompted)
hotdata ingest create --source "prod postgres" --table orders --database-id <database-id>
hotdata ingest list                 # check on your ingests

More in the docs: loading data and importing from external sources.

Query

hotdata databases tables list                       # what can I query?
hotdata databases tables show demo.public.trips     # columns and types
hotdata query "SELECT * FROM demo.public.trips LIMIT 10"

SQL is PostgreSQL-style. Add -o json or -o csv to change the output format. If you prefer another dialect, pass --dialect duckdb, postgres, snowflake, or clickhouse and the query is translated for you.

You can also write with SQL. INSERT, CREATE TABLE, CREATE TABLE AS, and DROP TABLE work on your current database's tables (your API key needs the write permission):

hotdata query "CREATE TABLE events (id BIGINT, kind TEXT)"
hotdata query "INSERT INTO events VALUES (1, 'signup'), (2, 'login')"

UPDATE and DELETE aren't supported in SQL yet; use databases load with --mode update, --mode delete, or --mode upsert instead.

Long-running queries finish in the background. The CLI prints an id you can check with hotdata query status <id>.

Column names are case-sensitive: wrap names with capital letters in double quotes, like "PULocationID". See the SQL reference for the supported syntax and functions.

Join across databases

Keep reference data in its own database and attach it wherever you need it. No data is copied. For example, load NYC's taxi zone names into a zones database, attach it to demo, and find the busiest pickup zones:

hotdata databases create --catalog zones
hotdata databases load --catalog zones --table zones \
  --url https://d37ci6vzurychx.cloudfront.net/misc/taxi_zone_lookup.csv
hotdata databases attach zones

hotdata query 'SELECT z."Zone", count(*) AS trips
               FROM demo.public.trips t
               JOIN zones.public.zones z ON z."LocationID" = t."PULocationID"
               GROUP BY z."Zone" ORDER BY trips DESC LIMIT 5'

Attached tables are read-only. hotdata databases detach zones removes the link without deleting anything.

Build a search index on a column, then search it. Using the zones table from above:

hotdata search create zone_names --type text --from zones.public.zones --column Zone
hotdata search "airport" --index zone_names -d zones

That returns JFK, LaGuardia, and Newark airports. An index lives in the same database as its table, so pass -d when that isn't your current database.

Rollups

A rollup keeps a table pre-aggregated by time, so dashboards and reports that aggregate a large, time-stamped table over days or weeks stay fast. You keep querying the table; an aggregate query the rollup can answer reads it instead.

hotdata rollups create public.requests --time-column ts --bucket 1h \
  --dimensions region,status \
  --measure count --measure numeric:bytes --measure approx_percentile:latency_ms

hotdata query "SELECT date_trunc('day', ts) AS day, region, count(*), avg(bytes)
               FROM public.requests GROUP BY 1, 2"
# ... [rollup: used]

create waits for the rollup to build; pass --async to return right away. hotdata query tells you whether a rollup answered: used, not_matched (the query's shape doesn't fit it), or not_ready (still building, or it needs hotdata rollups rebuild).

Creating a rollup restricts writes to its table: rows older than the window (one hour by default; change it with hotdata rollups window) can no longer be changed or deleted. Appends always work. See the rollups guide for the details.

Your current workspace and database

Most commands run against your current workspace and database, so you don't have to name them every time.

Your choice is saved on this machine and survives logging out and back in.

Scripts, CI, and AI agents

Claude Code plugin

To get the agent skill through Claude Code's plugin manager instead, which updates it with each release:

/plugin marketplace add hotdata-dev/claude-plugins
/plugin install hotdata-cli@hotdata

Self-hosted marketplaces don't auto-update by default. To get each release automatically, open /plugin, go to Marketplaces, select hotdata, and choose Enable auto-update. Otherwise run /plugin marketplace update hotdata when a new version ships.

Use either the plugin or the installer's skill, not both: if you installed the CLI with the script above, install it with HOTDATA_NO_SKILLS=1 or Claude Code will list the skill twice.

For what the plugin runs, sends, and fetches, see plugin/README.md.

Getting help

Reference

All commands
Command What it does
auth login Log in via browser
auth register Create a new account via browser (GitHub OAuth; --email for email + password)
auth logout Remove authentication for a profile
auth status Show authentication status
workspaces list List all workspaces
workspaces use Switch the current workspace (remembered across logins)
databases list List instant databases in the workspace
databases count Count instant databases in the workspace
databases show Show details for an instant database
databases create Create a new instant database
databases fork Fork a database into a new, independent database
databases lineage Show a database's whole fork family tree
databases attach Attach another database so its tables are queryable
databases detach Detach a previously attached database
databases use Switch the current database (remembered across logins)
databases unset Clear the current database
databases remove Delete a database and all its tables
databases load Load a csv/json/parquet file or saved result into a table (--mode replace|append|delete|update|upsert)
databases tables add Declare a table with its key and storage layout
databases tables list List tables in a database
databases tables show Show column definitions for a table
databases tables load Same as databases load, addressed by database instead of catalog
databases tables remove Delete a table from a database
databases context list List named contexts in a database
databases context show Print context content to stdout
databases context pull Download context to ./<NAME>.md
databases context push Upload ./<NAME>.md as named context
databases query Execute a SQL query against a database
databases query status Check a running query and retrieve results
databases queries list List query runs
databases results get Show a stored query result by ID
databases results list List stored query results
query "<sql>" Execute a SQL query (shortcut for databases query)
query status Check a running query and retrieve results
jobs list List background jobs (active by default)
jobs <id> Show one background job
ingest create Create a load definition
ingest list List the ingests in the workspace
ingest show Show one ingest: state, selector, destination, schedule
ingest pause Stop an ingest (cancel the active run and future runs)
ingest resume Clear a stop and let the schedule dispatch again
ingest schedule Change when a scheduled/continuous ingest runs next
ingest logs List the runs of one ingest
ingest run Show one run: status, snapshots, timings
ingest remove Delete an ingest and release its destination table
ingest sources test Check a config and credentials without creating anything
ingest sources add Create a datasource and its first config version
ingest sources list List the datasources in the workspace
ingest sources show Show one datasource: state, config, discovery
ingest sources update-config Append a config version (rotate credentials)
ingest sources remove Delete a datasource
ingest sources types Browse the catalog of source types
ingest sources fields Show the fields a source family accepts
search "<text>" --index <name> Run a full-text or vector search against an index
search create Create a search index over a table column
search list List search indexes
search show Show one search index by name
search remove Remove a search index by name
search embeddings list List embedding providers
search embeddings show Show one embedding provider
search embeddings add Create a new embedding provider
search embeddings update Update an embedding provider
search embeddings remove Delete an embedding provider
rollups create Create a rollup on a table and wait for it to build
rollups list List the rollups in a database
rollups show Show one rollup: what it keeps, its status, its build progress
rollups rebuild Build a rollup again (after its table was replaced, or a failed build)
rollups window Set how long a table's rows stay editable after their time
rollups remove Remove a rollup; the table does not change
manage usage Show workspace usage: queries, bytes scanned, stored bytes
manage completions Generate shell completions (bash, zsh, fish)
manage upgrade Upgrade the CLI to the latest release
manage skills install Install/update the agent skill into agent directories
manage skills status Show the agent skill's installation status
manage skills list List installed skills (alias for status)
support report File a support ticket with the Hotdata team
Configuration and environment variables

Config lives at ~/.hotdata/config.yml.

Variable Description Default
HOTDATA_API_KEY API key (overrides config file; also read from .env)
HOTDATA_WORKSPACE Lock every command to one workspace (workspaces use refuses while set)
HOTDATA_DATABASE Database to use when -d/--database is not given; overrides the saved current database
HOTDATA_NO_UPDATE_CHECK Skip the interactive new-release check
HOTDATA_CONFIG_DIR Where config and credentials live ~/.hotdata
HOTDATA_UPLOAD_CONCURRENCY Parallel parts for multipart uploads in databases load 12
HOTDATA_API_URL API base URL https://api.hotdata.dev/v1
HOTDATA_APP_URL App URL for browser login https://app.hotdata.dev

An API key is taken from, in order of priority: --api-key, then HOTDATA_API_KEY, then the config file.

Installer options: HOTDATA_NO_BREW=1 skips Homebrew, HOTDATA_NO_SKILLS=1 skips the agent skill. Tab completion: hotdata manage completions bash|zsh|fish.

Development

cargo build && cargo test

Build from source with cargo install --path . (requires Rust). Release process: docs/RELEASING.md.

hotdata-cli (hotdata-dev/hotdata-cli)

Ищем в базе…

Что это?Hotdata CLI — это консольный клиент, который позволяет запрашивать, искать и объединять данные из одного места — внешних баз данных, API, облачных хранилищ, каталогов Iceberg и загруженных файлов — с помощью обычного SQL и горстки команд.
Это локальный движок базы данных или CLI для облачного сервиса?Это CLI-клиент, а не локальная база данных: он создаёт «мгновенную базу данных» (instant database), размещаемую HotData, и ваши SQL-запросы реально выполняются на сервере против неё.
Как его запустить?Возьмите готовый бинарник из GitHub Releases проекта, затем создайте instant database, загрузите в неё данные и выполняйте запросы на SQL с диалектом PostgreSQL — это базовый цикл, на котором строится всё остальное.
Нужен ли аккаунт HotData для использования CLI?Да — вы авторизуетесь командой `auth login` через браузер (включая GitHub OAuth) или передаёте API-ключ через `--api-key` или переменную окружения HOTDATAAPIKEY; настраивать локальный движок базы данных не нужно.
Что будет, если выполнить большой медленный запрос?Длинные запросы выполняются асинхронно: CLI выводит queryrunid, который вы опрашиваете через `query status`, а код выхода сообщает, завершён ли запрос, упал ли, ещё выполняется или завершён лишь с усечённым предпросмотром.
Это работает на Windows, Mac и Linux?Да, это CLI на Rust, распространяемый как кроссплатформенные бинарники через GitHub Releases, с поддержкой автодополнения для bash, zsh и fish.
Где в итоге оказываются мои загруженные данные?Загруженные файлы и импортированные данные попадают в размещённую HotData «instant database» в облаке, и даже межбазовые объединения (joins) выполняются против этого хостинг-сервиса, а не локально.
Можно ли объединять данные из двух разных instant databases без копирования?Да — вы подключаете другую instant database (в режиме только для чтения) и напрямую запрашиваете её таблицы рядом со своими; отключение лишь убирает видимость, не удаляя никаких данных.
Нужна ли своя модель эмбеддингов для векторного/семантического поиска?Нет, векторный поиск автоматически создаёт эмбеддинги и для индексируемого столбца, и для запроса на сервере, ключи для эмбеддингов не нужны, хотя можно подключить свою модель через `search embeddings add`.
Могут ли AI-агенты для кодинга вроде Claude Code использовать этот CLI напрямую?Да — `hotdata manage skills install` устанавливает встроенные Markdown-инструкции, которые обучают агентов всему CLI, а `databases context push` публикует вашу модель данных в виде схемы, по которой могут ориентироваться и люди, и агенты.
Из каких источников, кроме загрузки файлов, можно подтягивать данные?Данные можно импортировать из Postgres/MySQL, бакетов S3/GCS, каталогов Iceberg, Kafka и примерно 150 API-сервисов через datasource и сохраняемое определение импорта, настраиваемое по расписанию.
Какие есть похожие проекты?xerj, airbyte, doris, manticoresearch, clawhub, meilisearch, full-stack-data-engineering, agentsview
Автор
hotdata-dev
Размер
2.3 MB
Звёзды
1.8K
Возраст
8 мес
Коммиты · 90 дней