querying-dune

star 1

Executes SQL queries on Dune Analytics and writes results as CSV to /tmp. Use when the user needs blockchain data from Dune or wants to run a saved Dune query by ID. Triggers: "dune query", "dune sql", "query dune", "blockchain data"

charlieyou By charlieyou schedule Updated 1/20/2026

name: querying-dune description: | Executes SQL queries on Dune Analytics and writes results as CSV to /tmp. Use when the user needs blockchain data from Dune or wants to run a saved Dune query by ID. Triggers: "dune query", "dune sql", "query dune", "blockchain data" compatibility: Python 3.10+, Bash, DUNE_API_KEY in .env or environment

Dune SQL

Dune Documentation Reference

If there is any uncertainty about how to run a query or what data is available: use Web tools to find the answer in the Dune docs:

Running Direct SQL (Plus Feature)

Run scripts/run.sh to execute SQL:

SKILL_DIR="$HOME/.agents/skills/dune-sql"

# Basic query (saves to /tmp/dune_result.csv)
"$SKILL_DIR/scripts/run.sh" "SELECT * FROM ethereum.transactions LIMIT 100"

# Custom output filename
"$SKILL_DIR/scripts/run.sh" -o txns.csv "SELECT * FROM ethereum.blocks LIMIT 10"

# Large performance tier
"$SKILL_DIR/scripts/run.sh" -p large "SELECT * FROM ethereum.transactions LIMIT 1000"

Running Saved Queries by ID

Run scripts/query.sh to execute a saved query:

# Run a saved query by ID
"$SKILL_DIR/scripts/query.sh" 1215383

# With custom output
"$SKILL_DIR/scripts/query.sh" -o my_query.csv 1215383

# With parameters (JSON format, types inferred)
"$SKILL_DIR/scripts/query.sh" --params '{"token": "USDC", "min_amount": 1000}' 1215383

Exit Codes

  • 0 → Query succeeded, CSV written
  • 1 → Error (SQL error, API error, config error)
  • 2 → Query timed out or failed

References

Scripts:

Documentation:

Install via CLI
npx skills add https://github.com/charlieyou/cyai --skill querying-dune
Repository Details
star Stars 1
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator