Skip to main content

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

PageWhat it covers
Install and upgradeGetting the CLI onto macOS, Linux, or Windows, and keeping it current
AuthenticationSigning in, and using tokens in CI
QuickstartA full workflow: query your data, build a Dive, publish it, and script it with JSON output
Working with agentsLetting an AI agent author Dives and Flights through the CLI
Command referenceEvery command, argument, and option

Commands

CommandWhat it does
diveBuild, preview, and publish Dives
flightBuild Flights, then schedule and operate their runs
login, logoutSign in through your browser, or remove the saved token
newCreate a MotherDuck account and organization, and sign in with it
queryRun SQL and write the results to stdout
statusShow who you're signed in as and what you're connected to
upgradeMove 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.