Who it is forA data engineer or CI maintainer who needs a query result as a file in a shell job.
The problemExporting data by hand from a GUI breaks repeatable reports and nightly jobs.
The outcomeA command writes the query result to a file that a later step can read.
What you need first
- A terminal on macOS, Linux, or Windows
- A database you can reach, or a local SQLite file
- One install method: Homebrew, npm, Go 1.27 or later, or a release package
Steps
- Install Masume with
brew install masumedb/tap/masumeor another method from the README - Run
masume run -p shop-prod -f json 'select count(*) from orders'to check the connection - Run
masume run ./notes.db -f csv 'select * from notes limit 100000' > notes.csvto export to CSV - Run
masume run -p shop -f parquet 'select * from orders' > orders.parquetfor a Parquet file
Prompt for your agent
In the masume repo, run `masume run -p <profile> -f json 'select count(*) from <table>'` and report the JSON output. Expected output: one JSON result with a count. Verify that the exit code is 0 before the next step uses the output.
Caveat. Check docs/headless.md for exit codes and format details before depending on them in CI.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for masumedb/masume and "Run SQL in a script and export results to a file"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer