{"slug": "motherduck-cli-query-pipelines-and-dashboards-from-your-terminal", "title": "MotherDuck CLI: query, pipelines, and dashboards from your terminal", "summary": "MotherDuck released a new CLI that lets users and AI agents create organizations, run queries, publish pipelines, and deploy dashboards directly from a terminal, with a single command enabling setup without a browser. The tool, demonstrated in a session where Claude Code drove the CLI to sign up, load data, and publish a dashboard in 45 seconds, is designed to reduce token usage by keeping execution local and scriptable for CI and coding environments.", "body_md": "2026/08/25 - Jordan Tigani\n\nMotherDuck Acquires Tower to power Data Agents[Read](https://motherduck.com/blog/motherduck-acquires-tower/)\n\n- 9 min read\n\nBYOne prompt and 45 seconds of CLI time. That's what it took an agent to sign up for MotherDuck, load a dataset into a pipeline, and publish a dashboard on top of it. That's the session I'll walk through in this post, with Claude Code driving the new MotherDuck CLI.\n\nSince launching our MCP server in November 2025, we've been investing in making MotherDuck work well with AI. But agents don't all live in chat windows anymore. A big chunk of them run in coding tools, CI jobs, and sandboxes where the natural interface is a shell. And a shell is where the rest of your infrastructure already lives: your CI, your deploy scripts, your Makefiles.\n\nSo we built a [CLI](https://motherduck.com/docs/getting-started/interfaces/motherduck-cli/). Use it to give your agent a MotherDuck environment it can operate directly, or use it on your own to deploy and manage MotherDuck resources as code. Same commands either way.\n\nWith the MotherDuck CLI, creating an org, a pipeline, and a dashboard is a handful of commands, whether a human or an agent is typing them:\n\n```\ncurl -s https://install.motherduck.com | sh    # install the CLI\nmotherduck login                               # existing user? browser login\nmotherduck new                                 # or: free org, no signup needed\nmotherduck query \"FROM 's3://bucket/data.parquet' LIMIT 10\"\nmotherduck flight push my_pipeline --run       # publish + run a Python pipeline\nmotherduck dive push my_dashboard              # publish a hosted dashboard\n```\n\nIn this post, I'll walk through why we built it, run a real end-to-end session with Claude Code driving the CLI (with actual timings from my terminal), and explain when to reach for the CLI vs our existing MCP server.\n\nMCP has been great for getting started. You go to the Claude or ChatGPT connector directory, authenticate to MotherDuck in a few clicks, and your agent gets a bunch of tools. That flow works well when the agent lives in a chat client.\n\nA CLI puts the work where the agent already lives. MCP tools are remote calls: every result comes back through the model. A CLI runs in the agent's local environment, next to grep, git, and the filesystem. `motherduck flight push hn_flight`\n\ndoes the same thing whether a human types it, a CI job runs it, or Claude Code calls it, and the agent only spends tokens on the decision, not on the execution.\n\nIt also keeps the work outside the context window. Every MCP tool result lands in the context, and you pay tokens for it. With a CLI, the agent can pipe `motherduck query`\n\ninto a file, grep the three rows it cares about, or diff two dive sources on disk, and only the relevant part ever reaches the model. DuckDB runs locally too, so file-shaped work (authoring code, staging data) happens on the machine and ships to the cloud in one call. Fewer round trips through the model means [fewer tokens burned](https://motherduck.com/docs/getting-started/interfaces/motherduck-cli/agents/#why-the-cli-costs-fewer-tokens-for-file-shaped-work).\n\nAnd since it's a plain command, it's scriptable. The same CLI you hand to an agent is the one you put in a Makefile or a GitHub Action to deploy flights and dives as code. No AI required.\n\nSecond reason: setup with no browser. An agent running in a CI job or a sandbox can't click through an OAuth screen. (You can run the MCP server with a token too, but the CLI makes it the default path.) With the CLI, one curl command and the agent has everything it needs. If you already have an account, `motherduck login`\n\ngets you in. If there's a `MOTHERDUCK_TOKEN`\n\nin the environment (the CI case), the CLI picks it up automatically. If neither, `motherduck new`\n\ncreates a [temporary org](https://new.motherduck.com/) for free, no signup, and stores the token. You also get a claim URL to attach that org to a human account later, so the agent can do the work first and you take ownership after.\n\nThird: one surface. MotherDuck started as a DuckDB extension, which meant installing DuckDB first. The CLI ships with DuckDB inside, so `motherduck query`\n\nworks locally and against the cloud from one install. Admin operations live in a [REST API](https://motherduck.com/docs/sql-reference/rest-api/motherduck-rest-api/). The CLI puts queries, pipelines, dashboards, and account management behind a single interface to manage all your MotherDuck resources and assets, for humans and agents alike.\n\n```\nCan you use the motherduck cli to analyze this dataset : https://us.data.motherduck.com/hacker_news/parquet/hacker_news_2021_2022.parquet\n```\n\nThis is a minimalist prompt on purpose. I gave it to Claude Code and let it figure out the rest. The dataset is 3.87M Hacker News items (stories, comments, polls). Here's what the agent did, with the wall-clock timings from my session.\n\nThe agent searches for the install command and finds:\n\n```\ncurl -s https://install.motherduck.com | sh\n```\n\nThis installs the [MotherDuck CLI](https://motherduck.com/docs/getting-started/interfaces/motherduck-cli/). In my case a token was already present, so the CLI connected straight to my org.\n\nBefore writing any pipeline code, the agent inspected the data with `motherduck query`\n\n, reading the parquet straight from our public datasets host (zero credential setup):\n\n`DESCRIBE`\n\nfor the schema: 1.8sHere's the schema inspection, exactly as it ran:\n\n```\nmotherduck query \"DESCRIBE SELECT * FROM 'https://us.data.motherduck.com/hacker_news/parquet/hacker_news_2021_2022.parquet'\"\ncolumn_name  column_type  null  key  default  extra\n-----------  -----------  ----  ---  -------  -----\ntitle        VARCHAR      YES\nurl          VARCHAR      YES\ntext         VARCHAR      YES\ndead         BOOLEAN      YES\nby           VARCHAR      YES\nscore        BIGINT       YES\ntime         BIGINT       YES\ntimestamp    TIMESTAMP    YES\ntype         VARCHAR      YES\nid           BIGINT       YES\nparent       BIGINT       YES\ndescendants  BIGINT       YES\nranking      BIGINT       YES\ndeleted      BOOLEAN      YES\n```\n\nAnd the row breakdown that told the agent what it was dealing with:\n\n```\nmotherduck query \"SELECT type, count(*) AS n FROM 'https://us.data.motherduck.com/.../hacker_news_2021_2022.parquet' GROUP BY type ORDER BY n DESC\"\ntype     n\n-------  -------\ncomment  3530415\nstory    334153\npollopt  1123\njob      915\npoll     134\n```\n\nThat exploration pass paid off: the pipeline SQL that came out of it quoted the reserved `\"by\"`\n\ncolumn, filtered on the `dead`\n\nand `deleted`\n\nflags, and picked the `timestamp`\n\ncolumn over the raw epoch one. The agent found the sharp edges before they became bugs.\n\nThis is my favorite part. The CLI ships its own agent-facing docs:\n\n```\nmotherduck flight guide\nmotherduck dive guide\n```\n\nEach prints a full authoring guide: supported APIs, runtime limits, gotchas like pinning the duckdb version or converting BigInt values before charting. If your org has authored its own flight or dive guidance, the CLI appends it here too. They run locally, so the agent gets everything it needs without a single web search. In my session, both the pipeline and the dashboard worked on the first try, and I credit the guides for that.\n\nA [Flight](https://motherduck.com/docs) is a Python data pipeline that runs on MotherDuck, on demand or on a cron schedule. The agent scaffolded one locally, wrote the ingestion logic, and shipped it:\n\n```\nmotherduck flight init hn_flight --name hn_ingest   # 0.04s\nmotherduck flight push hn_flight                    # 8.9s\nmotherduck flight run hn_flight                     # 3.0s to submit\n```\n\nThe run itself ingested all 3.87M rows into three aggregate tables (daily activity, top domains, top stories) in 11.5 seconds of server-side compute. The agent then checked the exit code with `flight list-runs`\n\nand verified the output tables with one more query (2.0s) before moving on.\n\nA Dive is an interactive dashboard authored as a single React file and hosted on MotherDuck. The agent wrote one `index.tsx`\n\nquerying the tables the flight produced: KPI tiles, a daily time series with a metric toggle, a top domains chart, and a top stories table.\n\n```\nmotherduck dive init hn_dive --title \"Hacker News 2022 Pulse\"   # 0.04s\nmotherduck dive push hn_dive                                    # 2.2s\n```\n\nPush returns a live URL. Since the dive reads the flight's output tables, re-running the flight refreshes the dashboard for free.\n\nThe dive created:\n\n*(placeholder: dive demo video goes here in the final post)*\n\nEnd to end: one prompt, about 45 seconds of CLI time, from no account to a scheduled-ready pipeline plus a hosted dashboard.\n\nA few design choices make the CLI pleasant for agents specifically:\n\n`init`\n\n, `guide`\n\n, `--help`\n\n) run instantly with no network call.`-o json`\n\nfor programmatic parsing:\n\n```\nmotherduck flight list-runs hn_flight -o json\n```\n\n`flight list-runs`\n\nreturns exit codes and `flight logs`\n\nreturns what the run printed. When a pipeline fails, the agent reads the logs, fixes the source, and pushes again. Versions are tracked on every push, so nothing is lost.`flight push --run`\n\ncollapses publish and execute into one call, which saves a round trip in tight loops.Both let an agent work with MotherDuck. The deciding question is whether the agent has a shell and a filesystem. If there's a local environment with compute available, the CLI is your best friend: it keeps big results out of the context window and lets the agent filter locally. If there's no shell (Claude or ChatGPT on the web), MCP is the way in:\n\nWith the CLI, agents get a smooth way to set up and use MotherDuck: one curl to install, one command for a free org, built-in guides so they don't guess, and JSON output so they don't parse tables. The CLI is the same tool either way: paste the prompt above into your favorite agent (and try it with your own dataset), or wire the commands into your CI. Both get a predictable MotherDuck experience. Watch the ducking magic happen.\n\n2026/08/25 - Jordan Tigani\n\n2026/08/26 - Jordan Tigani\n\nToday Duck Labs, the developers of DuckDB, announced they are being acquired by Amazon. This is big news in the duck-iverse, and many people are wondering what this will mean for everyone’s favorite duck-powered database, MotherDuck.", "url": "https://wpnews.pro/news/motherduck-cli-query-pipelines-and-dashboards-from-your-terminal", "canonical_source": "https://motherduck.com/blog/motherduck-cli-announcement", "published_at": "2026-08-27 00:00:00+00:00", "updated_at": "2026-08-27 15:20:38.395415+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-agents"], "entities": ["MotherDuck", "Claude Code", "DuckDB", "MCP"], "alternates": {"html": "https://wpnews.pro/news/motherduck-cli-query-pipelines-and-dashboards-from-your-terminal", "markdown": "https://wpnews.pro/news/motherduck-cli-query-pipelines-and-dashboards-from-your-terminal.md", "text": "https://wpnews.pro/news/motherduck-cli-query-pipelines-and-dashboards-from-your-terminal.txt", "jsonld": "https://wpnews.pro/news/motherduck-cli-query-pipelines-and-dashboards-from-your-terminal.jsonld"}}