Skip to main content
The Dune CLI and Agent Skills give your AI coding agent structured access to Dune’s datasets, query engine, and documentation — directly inside the tools you already use. The Dune CLI is a terminal-native interface for discovering datasets, executing DuneSQL queries, and managing results. Dune Skills are portable instruction packages that teach AI agents how to use the CLI effectively — from writing correct SQL to handling errors and optimizing costs. Together, they turn any skills-compatible agent into a blockchain data analyst.

Dune CLI

The Dune CLI lets you query, explore, and manage blockchain data without leaving your terminal. All commands support both human-readable and JSON output, making them equally useful for interactive work and agent-driven workflows.

Install

curl -sSfL https://dune.com/cli/install.sh | sh
The install script handles everything you need to get started: it installs the Dune CLI, runs dune auth to configure your API key, and installs the Dune Agent Skill via npx skills add. In most cases, this single command is all you need.
You’ll need a Dune API key during setup. Generate one at dune.com under APIs and Connectors > API Keys before running the install script.

Authenticate (manual)

If you need to re-authenticate or configure a different API key after installation, you can run:
dune auth
You’ll be prompted to enter your API key. It’s saved to ~/.config/dune/config.yaml for future sessions. Alternatively, pass the key inline or via environment variable:
# Environment variable
export DUNE_API_KEY=<your-api-key>

# Inline flag
dune query run 12345 --api-key <your-api-key>

Usage

Run dune --help to see all available commands. All commands support -o json for structured, machine-parseable output — ideal for agent consumption:
dune query run-sql --sql "SELECT * FROM ethereum.transactions LIMIT 5" -o json

Dune Skills

Agent Skills are an open standard for giving AI agents new capabilities. The Dune Skill teaches your agent how to use the Dune CLI to discover datasets, write DuneSQL, execute queries, handle errors, and manage costs — all from natural language prompts. Skills are supported by Claude Code, Cursor, OpenCode, OpenAI Codex, VS Code, Gemini CLI, Goose, and many more.

Install

The Dune Skill is automatically installed when you run the CLI install script above — no extra steps required. If you need to install or reinstall the skill separately, you can run:
npx skills add duneanalytics/skills
Skills are automatically installed to ~/.claude/skills/ and loaded when your conversation matches blockchain-related triggers.

How it works

Once installed, the Dune Skill activates automatically when your conversation involves blockchain data, on-chain analytics, DuneSQL, token transfers, DEX trades, smart contract events, or wallet analysis. The agent then:
  1. Discovers the right tables using dune dataset search
  2. Inspects column schemas to build correct SQL
  3. Writes DuneSQL with proper partition filters for cost efficiency
  4. Executes the query and parses results
  5. Handles errors with built-in recovery strategies
The skill includes detailed reference documents for query execution, dataset discovery, DuneSQL syntax, and error handling — loaded on demand to keep context window usage efficient.

Key Benefits

Agent-Native Data Access

Your AI agent queries blockchain data directly — no context switching, no copy-pasting SQL between apps.

Works Where You Work

Compatible with Claude Code, Cursor, VS Code, Codex, and any agent that supports the Agent Skills standard.

Cost-Aware by Default

The skill teaches agents to filter on partition columns and choose the right performance tier, reducing credit consumption.

Use Cases

Ad-Hoc Analysis

Ask your agent a question in plain English and get results backed by DuneSQL — from DEX volumes to gas trends.

Contract Exploration

Give the agent a contract address and let it discover all decoded event and call tables automatically.

Pipeline Scripting

Use the CLI’s JSON output and async execution to integrate Dune queries into CI/CD pipelines or monitoring scripts.

Reusable Parameterized Queries

Create saved queries with parameters, then run them with different inputs across sessions.