Use the MotherDuck CLI for terminal queries, authentication, and file-based Dive or Flight workflows.
Getting started
Full instructionsInstall the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.
Instructions: SKILL.mdv1.0.4
Use the MotherDuck CLI
Source Of Truth
- Prefer the current MotherDuck CLI documentation and command reference. Read command help before relying on remembered flags because the command surface can evolve.
- Before authoring or editing a Dive or Flight, run
motherduck dive guideormotherduck flight guide. Those built-in guides are the current runtime contract. - Use
motherduck <command> --helpafter a parsing or option error instead of guessing at syntax.
Default Posture
- Reuse an authenticated CLI when available; check with
motherduck statusbefore starting a login flow. - For automation, pass
MOTHERDUCK_TOKENthrough the environment and set an absolute, task-specificMOTHERDUCK_HOMEso parallel agents do not share credentials or assets. - Request
--output jsonfor machine-readable resource operations and check both the exit code and returnedsuccessfield.motherduck query --output jsonreturns a bare JSON array instead. - Redirect large query results to a file rather than pulling every row into model context.
- Never run
motherduck newmerely because authentication is missing. Account creation requires an explicit signup request. - Keep Guides as files with
motherduck guide init|pull|push;pushcreates or updates and only adds a version when content changes. Record a Git SHA with--external-idand the reason with--version-description.pulloverwrites local files, so push or save local edits first. - Change a Guide's sharing only with
motherduck guide push --access user|organization; a new Guide is private unless--access organizationis passed, andguide.metadata.jsonno longer recordsaccess. - Share a Dive with SQL through
motherduck query(GRANT READ ON DIVE '<id>' TO ROLE <role>, checked withmd_list_dive_grantees('<id>'::UUID));dive pushnever changes who can open it, and the data and Flights it uses need their own grants. - Treat
dive push,flight push,guide push, scheduling, secret changes, and account creation as external mutations. Perform them only when the user's build/change request includes that outcome.
Workflow
- Inspect the host project and existing CLI/authentication state.
- Install or upgrade only when needed, following the current platform-specific docs.
- Choose CLI or MCP based on the task shape:
- files, local edits, CI, large results, or repeated iterations: CLI
- chat-only exploration, inline answers, or no filesystem: MCP
- mixed workflow: explore through MCP, then build from local files through the CLI
- For queries, use
motherduck querywith the smallest suitable output format. - For a Dive or Flight, read its built-in guide, pull or initialize the local project, edit files, validate or preview, then push only when publication is requested.
- Capture the resource ID, URL, or run number from JSON output and verify the remote state after mutation.
For answer, review, or planning requests, recommend commands without logging in, creating an account, or changing remote resources. For explicit build/change requests, complete the in-scope CLI workflow and validate its result; ask before destructive deletes or materially broader external changes.
References
Read only the reference sections needed for the current task.
- Read
references/CLI_PLAYBOOK.mdfor installation, authentication, JSON contracts, query patterns, agent isolation, and complete Dive/Flight file workflows.
Related Skills
Load related skills only for missing capabilities; reuse established context.
motherduck-connectfor choosing the underlying application connection pathmotherduck-exploreandmotherduck-queryfor catalog discovery and SQL behaviormotherduck-create-diveandmotherduck-create-flightfor the product-specific authoring workflow
Explore more skills
Browse all- Motherduck Design DiveDesign or improve a MotherDuck Dive’s layout, responsive behavior, themes, filters, and visual accessibility.
- Motherduck Build Malleable DiveBuild a generative MotherDuck Dive where a Flight writes a daily briefing and question-to-page specs from a semantic…
- Motherduck Manage GuidesRead or maintain MotherDuck Guides for business definitions, join rules, and reusable warehouse conventions.
- Motherduck Model DataDesign or implement MotherDuck analytical schemas and transformation models, including grain, types, and…
- Motherduck ExploreFind and understand MotherDuck databases, tables, columns, shares, and sample data, including which tables hold a given…
- Motherduck Share DataCreate, consume, or manage MotherDuck data shares, including audience grants, table filters, and refresh policy.
Security
Reviews (0)
More from MotherDuck Agent Skills
View source →Frequently asked questions about motherduck-cli
What does the motherduck-cli skill do?
Use the MotherDuck CLI for terminal queries, authentication, and file-based Dive or Flight workflows. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the motherduck-cli skill?
Run `npx @skills-hub-ai/cli install motherduck-cli` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/motherduck-cli/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does motherduck-cli work with?
motherduck-cli runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the motherduck-cli skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use motherduck-cli after installing it?
In Claude Code, type `/motherduck-cli` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the motherduck-cli skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.
Badge for your README
Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.
[](https://skills-hub.ai/skills/motherduck-cli)<a href="https://skills-hub.ai/skills/motherduck-cli"><img src="https://skills-hub.ai/api/badges/skill/motherduck-cli" alt="Install on Skills Hub"></a>More options in the badge docs.