Skip to main content

Dremio CLI

The Dremio 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

Requirements: Python 3.11+

Install with pip
pip 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

Create ~/.config/dremioai/config.yaml:

~/.config/dremioai/config.yaml
pat: your-personal-access-token
project_id: your-project-id
uri: https://api.dremio.cloud
tip

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

Use the CLI

Once authenticated, you're ready to start using the CLI. The sections below cover the core capabilities, from discovering what commands are available to building agents that call the library directly.

Discover Commands

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" }
]
}

Run a Query

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

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 Reference

Query

CommandDescription
dremio query run "<sql>"Submit SQL, poll to completion, return all rows
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

Support

The Dremio CLI is an open-source project and is not covered by Dremio Support Policies. For issues and feature requests, see: