Skip to main content

Dremio Developer CLI

The Dremio Developer CLI (dremio) gives you full programmatic access to Dremio from the terminal or any automation pipeline. It wraps the Dremio REST API into a consistent set of commands covering queries, catalog management, Reflections, engines, users, roles, grants, and projects, without needing to hand-craft API calls.

Whether you're querying data from a pipeline, debugging a job from the terminal, or building an agent that interacts with Dremio, the CLI provides a consistent interface with structured output and predictable error handling.

Install

You can install the Dremio Developer CLI using pipx, uv, or pip. Python 3.11 or later is required.

The package name is dremio-cli. Do not install dremio-client, which is an unrelated third-party package.

Install with pipx
pipx install dremio-cli
Verify the installation
dremio --help

Authenticate

The CLI requires a personal access token (PAT) and your Dremio project ID. CLI flags take priority over environment variables, which take priority over the config file.

Your API endpoint depends on your control plane region:

Control PlaneURI
UShttps://api.dremio.cloud
EUhttps://api.eu.dremio.cloud

Run the interactive setup to configure credentials:

Run interactive setup
dremio setup

The setup command walks you through region selection, PAT creation, and project ID discovery, then validates your credentials and writes the config file to ~/.config/dremioai/config.yaml.

tip

This config file is shared with the Dremio MCP Server, so no duplicate configuration is needed if you use both.

Run a Query

You can run a SQL query directly from the terminal using dremio query run.

Run a SQL query
dremio query run "SELECT 1 AS hello"

You can also run SQL from a file or pipe it via stdin:

Run SQL from a file
dremio query run --file query.sql
Run SQL from stdin
cat query.sql | dremio query run -

Chat with the AI Agent

You can use dremio chat to have a conversation with Dremio's AI agent directly from the terminal.

Interactive Mode

Running dremio chat launches an interactive session with a You > prompt. The agent has access to your catalog, schemas, jobs, and Reflections, and can run queries on your behalf.

Start an interactive chat session
dremio chat

Use --conversation to resume a previous session, --log-file to write a JSON-lines event log, and --model to override the model.

Resume a previous conversation
dremio chat --conversation <conversation-id>

The following slash commands are available within the session:

CommandDescription
/newStart a new conversation
/listList recent conversations
/continue <id>Resume a previous conversation
/historyShow message history for the current conversation
/cancelCancel the current running request
/delete <id>Delete a conversation
/infoShow the current conversation and run ID
/helpShow available commands
/quitExit the session

To manage conversations from the terminal before starting a session, use dremio chat list, dremio chat history <id>, and dremio chat delete <id> instead.

Non-Interactive Mode

Use --message to send a single message and stream the response to stdout. This is useful for scripting and pipelines. Use --auto-approve to automatically approve any tool calls the agent makes.

Send a single message
dremio chat --message "Which tables in the Analytics space have failed Reflections?"
Send a single message and auto-approve tool calls
dremio chat --message "Refresh all stale Reflections in the Analytics space" --auto-approve

Format Output

All commands output JSON by default. Use --output to change the format:

FormatFlagBest for
JSON--output jsonPipelines, agents, scripting
CSV--output csvData export, spreadsheets
Pretty--output prettyTerminal review

Filter Output

Use --fields with dot notation to return only the fields you need:

Filter output fields
dremio schema describe myspace.orders --fields fields.name,fields.type
dremio job list --fields job_id,job_state,start_time

Validate Before You Execute

Append --dry-run to validate a destructive command before executing it:

Dry run before refreshing a Reflection
dremio reflection refresh <reflection-id> --dry-run
dremio reflection refresh <reflection-id>

Example: Autonomous Data Investigation

Here's what an agent session looks like in practice when investigating why a report is showing unexpected numbers, from first command to resolution:

Autonomous investigation workflow
# Search the catalog for relevant datasets
dremio search "revenue" --output json

# Inspect the table schema
dremio schema describe Analytics.production.quarterly_revenue --output json

# Trace where the data comes from
dremio schema lineage Analytics.production.quarterly_revenue

# Query the data directly
dremio query run "SELECT quarter, region, SUM(revenue)
FROM Analytics.production.quarterly_revenue
WHERE fiscal_year = 2026
GROUP BY quarter, region" --output json

# Check for failed refresh jobs
dremio job list --status FAILED --output json \
--fields job_id,dataset,start_time,error_message

# List Reflections on the table
dremio reflection list Analytics.production.quarterly_revenue --output json

# Validate and then apply the refresh
dremio reflection refresh <reflection-id> --dry-run
dremio reflection refresh <reflection-id>

Build Agents with Python

If you're building a Python application or agent, you can import the CLI functions directly instead of running commands from the terminal:

Python library import
from drs.auth import load_config
from drs.client import DremioClient
from drs.commands.query import run_query

config = load_config()
client = DremioClient(config)
result = await run_query(client, "SELECT * FROM myspace.orders LIMIT 10")
await client.close()

Command Introspection

Use dremio describe to get the full parameter schema for any command:

Introspect a command
dremio describe query.run
Output
{
"group": "query",
"command": "run",
"description": "Execute a SQL query against Dremio Cloud, wait for completion, return results.",
"mechanism": "REST",
"endpoints": [
"POST /v0/projects/{pid}/sql",
"GET /v0/projects/{pid}/job/{id}",
"GET /v0/projects/{pid}/job/{id}/results"
],
"parameters": [
{ "name": "sql", "type": "string", "required": true, "positional": true, "description": "SQL query to execute" },
{ "name": "output", "type": "enum", "required": false, "default": "json", "enum": ["json", "csv", "pretty"] },
{ "name": "fields", "type": "string", "required": false, "flag": "--fields/-f", "description": "Comma-separated fields to include" }
]
}

Command Reference

The following tables list all available commands, grouped by function.

Setup

CommandDescription
dremio setupInteractive setup to configure credentials (region, PAT, project ID)

Chat

CommandDescription
dremio chatStart an interactive chat session with the AI agent
dremio chat --message "<prompt>"Send a single message (non-interactive)
dremio chat listList recent conversations
dremio chat history <id>Show message history for a conversation
dremio chat delete <id>Delete a conversation

Query

CommandDescription
dremio query run "<sql>"Submit SQL, poll to completion, return all rows
dremio query run --file <path>Submit SQL from a file
dremio query status <job-id>Get current status of a running job
dremio query cancel <job-id>Cancel a running job

Schema and Catalog

CommandDescription
dremio schema describe <path>Column names and types for a table or view
dremio schema lineage <path>Upstream and downstream dependency graph
dremio schema sample <path>Preview rows from a table
dremio search <term>Full-text search across all catalog entities
dremio folder list <path>List contents of a space or folder
dremio folder get <path>Get metadata for a space or folder
dremio folder create <path>Create a space or folder
dremio folder delete <path>Delete a space or folder
dremio folder grants <path>View grants on a space or folder

Metadata

CommandDescription
dremio wiki get <path>Read wiki documentation for a catalog entity
dremio wiki update <path>Write wiki documentation for a catalog entity
dremio tag get <path>Read tags on a catalog entity
dremio tag update <path>Write tags on a catalog entity

Jobs

CommandDescription
dremio job listList recent jobs (supports --status FAILED filter)
dremio job get <job-id>Get details for a specific job
dremio job profile <job-id>Operator-level execution profile for performance analysis

Reflections

CommandDescription
dremio reflection listList all Reflections in the project
dremio reflection get <id>Get details for a specific Reflection
dremio reflection createCreate a new Reflection
dremio reflection refresh <id>Force-refresh a Reflection
dremio reflection delete <id>Delete a Reflection

Engines

CommandDescription
dremio engine listList all engines
dremio engine get <id>Get engine details
dremio engine createCreate a new engine
dremio engine update <id>Update engine configuration
dremio engine enable <id>Enable an engine
dremio engine disable <id>Disable an engine
dremio engine delete <id>Delete an engine

Users and Access

CommandDescription
dremio user listList all users in the organization
dremio user get <id>Get user details
dremio user createInvite a new user
dremio user delete <id>Remove a user
dremio user whoamiShow the currently authenticated user
dremio user audit <username>Trace all role memberships and effective grants for a user
dremio role listList all roles
dremio role get <id>Get role details
dremio role createCreate a new role
dremio role update <id>Update a role
dremio role delete <id>Delete a role
dremio grant getView grants on a resource
dremio grant updateUpdate grants on a resource
dremio grant deleteRemove grants from a resource

Projects

CommandDescription
dremio project listList all projects in the organization
dremio project get <id>Get project details
dremio project createCreate a new project
dremio project update <id>Update a project
dremio project delete <id>Delete a project

Introspection

CommandDescription
dremio describe <command>Return machine-readable JSON schema for any command

Global Flags

These flags apply to all commands:

FlagDescription
--tokenPAT for authentication
--project-idDremio project ID
--uriDremio API endpoint (default: https://api.dremio.cloud)
--configPath to config file
--output / -oOutput format: json (default), csv, pretty
--fields / -fComma-separated dot-notation field filter