MotherDuck CLI
Preview
This feature is in preview and is subject to change.
The MotherDuck CLI drives MotherDuck from your terminal. Use it to sign in, run queries, and build Dives and Flights without leaving your editor.
It's built for people and for AI agents alike. Every command that returns
structured results takes --output json. Agents can create and publish a Dive
or a Flight from local files, and read the built-in guides for working with
Dives and Flights.
curl -s https://install.motherduck.com | SKIP_DUCKDB_CLI=1 sh
motherduck login
motherduck query "SELECT count(*) FROM sample_data.nyc.taxi"
Where to start
| Page | What it covers |
|---|---|
| Install and upgrade | Getting the CLI onto macOS, Linux, or Windows, and keeping it current |
| Authentication | Signing in, and using tokens in CI |
| Quickstart | A full workflow: query your data, build a Dive, publish it, and script it with JSON output |
| Working with agents | Letting an AI agent author Dives and Flights through the CLI |
| Command reference | Every command, argument, and option |
Commands
| Command | What it does |
|---|---|
dive | Build, preview, and publish Dives |
flight | Build Flights, then schedule and operate their runs |
login, logout | Sign in through your browser, or remove the saved token |
new | Create a MotherDuck account and organization, and sign in with it |
query | Run SQL and write the results to stdout |
status | Show who you're signed in as and what you're connected to |
upgrade | Move to the latest CLI release |
Run motherduck --help, or motherduck <command> --help, to get the same
information at the terminal. The deepest level carries the examples.