Skip to main content

Quick Start

1

Install the CLI

Installs the wheel from the latest GitHub release. Uses pipx when available so the CLI stays isolated, and falls back to pip install --user.
Requires Python 3.10 or later, and hydradb-cli 0.2.0 for the commands and flags on this page. On earlier versions, see Deprecated aliases.
pip install hydradb-cli installs 0.1.0, which predates every command name on this page. PyPI publishing is paused, so releases are served from GitHub until it resumes. Use one of the commands above.
2

Get credentials

3

Authenticate

You are prompted for your API key. Both it and the database are saved to ~/.hydradb/config.json (file permissions 0600).For scripts and agents, pass the key explicitly instead of being prompted:
Agents can skip login altogether: every command reads HYDRADB_API_KEY and HYDRADB_DATABASE directly from the environment, so no credential is written to disk. It also keeps the key out of ps output, which shows any value passed as a command-line argument to every other user on the machine.
4

Verify

Reports your resolved config and whether the API is reachable.

Configuration

Authentication

The CLI resolves credentials in this order (first match wins):
  1. Environment variables (HYDRADB_API_KEY, HYDRADB_DATABASE)
  2. Config file (~/.hydradb/config.json, written by hydradb login)

Environment Variables

The older HYDRA_DB_API_KEY, HYDRA_DB_TENANT_ID, HYDRA_DB_SUB_TENANT_ID, HYDRA_DB_BASE_URL and HYDRADB_API_URL spellings are still read, but each prints a one-line deprecation warning to stderr. The canonical name wins when both are set.

Output Formats

Every command supports --output human (default, Rich-formatted tables) or --output json (machine-readable). Set the default globally with the environment variable:
Or per-command, before the subcommand:
Warnings and errors always go to stderr, so --output json stdout stays a clean document you can pipe straight into jq.

Persistent Configuration

hydradb config set accepts api_key, database, collection and base_url. Environment variables always take precedence over the config file.

Commands

Every command that reads or writes data takes --database (-d) to choose the database, and --collection to scope to a partition within it. Both fall back to your configured defaults, so the examples below can omit them once hydradb login has run.

Context Operations

Ingesting

ingest stores a memory by default. Pass --kind knowledge for knowledge text, or give it file paths: files are always knowledge sources.
--text, --title, --source-id, --user-name, --markdown and --no-infer do not apply to file ingest. Passing them alongside file arguments is rejected rather than silently ignored.

Querying

Inspecting and deleting

list accepts --kind, --page and --page-size (1 to 100). inspect accepts --mode content (default), url, or both. delete defaults to --kind knowledge, so pass --kind memory to remove a memory.

Database Management

hydradb database delete permanently removes the database and all associated memories, knowledge, and graph data. This action cannot be undone. It prompts for confirmation unless you pass --yes.

Authentication & Configuration

Deprecated aliases

The command groups below still work and behave identically, but each prints a deprecation warning to stderr naming its replacement. They will be removed in a future major version.

Scripting & Automation

Use --output json to pipe results into jq, Python, or other tools:
query returns chunks, each with chunk_content, source_title and relevancy_score. list returns sources. Both memories and knowledge appear in the same sources array, distinguished by their type.

Feedback and contributions

The CLI is open source. Feel free to raise an issue or contribute on GitHub.