dDatahopdocs
Agents

CLI

The Datahop command — every MCP tool from any shell, for coding agents, scripts and CI.

datahop is a small command that gives you every MCP tool from a shell, plus shortcuts for the common ones. Coding agents with a shell, such as Claude Code, Codex and Cursor, can use it without any MCP setup. So can scripts and CI.

Agent-first

Hand this to your agent. It installs the CLI (or uses MCP), logs in, learns your data and reports what's interesting.

Install

Needs Node 20+ or Bun.

curl -fsSL https://app.datahop.dev/cli/install.sh | sh

It installs to ~/.local/bin/datahop. You can also download datahop.mjs and run it with node or bun.

Log in

Set two environment variables. Nothing is written to disk.

export DATAHOP_HOST=https://app.datahop.dev
export DATAHOP_API_KEY=dh_sk_…

Use a project API key. With a read-only key, you only get the read tools.

Commands

CommandWhat it does
overviewStart here: products, top events, cohorts, insights, running experiments, recent changes
events [search] · event <name>Event names and volumes · the properties seen on one event
query <json|@file|->Any query
sql "<sql>"Read-only SQL over your events
insights [search] · insight <id>Saved insights · one with fresh results
dashboards · dashboard <id>Dashboards · every card's summary
persons [search] · person <id>People · one profile with recent events
cohorts · flags · experiments · activityLists
results <experimentId>Verdict, lift, segments and recommendation
tools [<name>]Every tool, or one tool's arguments with an example
call <tool> [<json>|@file|-] [--arg value …]Run any tool

Arguments for call can be JSON, a file (@args.json), stdin (-) or flags. Flags use kebab-case and dots for nesting:

datahop call create_cohort --name "Power users" \
  --definition '{"criteria":[{"type":"behavior","event":"project_opened","withinDays":14,"minCount":20}]}'

datahop call create_annotation --date 2026-11-02 --content "Shipped annual discount banner to everyone"

Output

FlagPrints
(none)The summary, then the data
--jsonOnly the JSON, ready for jq
--quiet / -qOnly the summary

The exit code is 0 on success, 1 when the call failed and 2 for usage errors. Errors suggest a fix.

$ datahop results 4 -q
Experiment "Annual plan discount banner" (running). Exposures: control 1475, test 1525.
Primary: Upgraded — control: 30.8% (n=1475); test: 39.1% (n=1525) lift +26.9% [15.0%, 39.8%], P(beats control) 100.0%. Verdict: winner (test).
Recommendation: Ship "test": it is the best variant with 100.0% probability.

In CI

Because it fails with a non-zero exit code and --json output is stable, you can use it as a guardrail. For example, stop a rollout when an experiment's guardrail metric is losing:

verdict=$(datahop results 7 --json | jq -r '.secondary[0].verdict')
[ "$verdict" = "loser" ] && { echo "Guardrail metric is losing — stop the rollout"; exit 1; }

On this page