CLI for the MotherDuck REST API.
Important: This is a personal project. I am not affiliated with MotherDuck.
Pre-built binaries are available for Linux and macOS via Python (uv). Windows users should install via cargo or use macOS/Linux.
uv:
uv tool install dkdc-md-clicargo:
cargo install dkdc-md-cliEither option will install the md command globally. You can use uvx to run it without installing:
uvx --from dkdc-md-cli mdSet a MotherDuck API token via environment variable:
export MOTHERDUCK_TOKEN="your-token-here"Token resolution order (first non-empty wins):
--tokenflag (pass-to read from stdin)motherduck_tokenMOTHERDUCK_TOKENmotherduck_api_keyMOTHERDUCK_API_KEY
md [--output text|json] [--token TOKEN] [--yes] <command>
| Flag | Short | Description |
|---|---|---|
--output |
-o |
Output format: text (default) or json |
--token |
API token (overrides env vars; - reads from stdin) |
|
--yes |
-y |
Skip confirmation prompts |
# Create a service account
md service-account create <username>
# Delete a service account (prompts for confirmation)
md service-account delete <username># List tokens for a user
md token list <username>
# Create a new token
md token create <username> --name <name> [--ttl <seconds>] [--token-type <type>]
# Delete a token (prompts for confirmation)
md token delete <username> <token_id>--ttl: time-to-live in seconds (300–31536000). Omit for no expiration.
--token-type: read-write (default) or read-scaling.
# Get current duckling config
md duckling get <username>
# Set duckling config (at least one override required)
md duckling set <username> [--rw-size <size>] [--rs-size <size>] [--flock-size <n>]Instance sizes: pulse, standard, jumbo, mega, giga.
Flock size: 0–64. duckling set fetches the current config and merges your overrides, so you only need to specify what you're changing.
# List active accounts and their ducklings
md account list-active