Quick Start
1
Install the CLI
- curl
- pip
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.2
Get credentials
- Create an API key from Hydra DB
- Create or copy your database ID from the HydraDB dashboard
3
Authenticate
~/.hydradb/config.json (file permissions 0600).For scripts and agents, pass the key explicitly instead of being prompted:4
Verify
Configuration
Authentication
The CLI resolves credentials in this order (first match wins):- Environment variables (
HYDRADB_API_KEY,HYDRADB_DATABASE) - Config file (
~/.hydradb/config.json, written byhydradb login)
- macOS/Linux (bash)
- macOS/Linux (zsh)
- Windows (PowerShell)
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:
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–100). inspect accepts
--mode content (default), url, or both. delete defaults to --kind knowledge,
so pass --kind memory to remove a memory.
Database Management
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
The CLI is designed for both interactive use and scripting. Use--output json to get
machine-readable output that pipes cleanly 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.Source & Show Support
If HydraDB CLI makes your workflow faster, please star the open-source repo that
powers it. It helps keep it discoverable and motivates maintainers to keep shipping
improvements.
hydradb-cli
Star on GitHub if you found it useful.
