Skip to main content

tableau-cli

A command-line interface for Tableau Server / Tableau Cloud, designed for AI agent integration. All output is structured JSON to stdout, with agent-friendly error messages that include actionable hints.

Why CLI over MCP?

MCP (Model Context Protocol) servers continuously occupy agent context — every tool description is loaded into the system prompt, even when only one command is needed. A CLI follows a simpler call-execute-exit pattern: the agent invokes a command, reads the JSON output, and moves on.

The companion agent skill under skills/ extends the same idea to command knowledge — the full reference is loaded only when the agent is about to execute a command, not kept in context upfront. See Use with Coding Agents below.

This project provides the same capabilities as the tableau-mcp server, with behavioral alignment in data transformations, error handling, and output structures.

Quick Start

Prerequisites

Install

git clone https://github.com/i-richardwang/tableau-cli.git
cd tableau-cli
pip install -e .

# Optional: install conversion dependencies (TDSX/HYPER → Parquet/CSV)
pip install -e ".[convert]"

Configure

# Option 1: CLI config (saved to ~/.tableau-cli.json)
tableau-cli config set \
  --server https://your-tableau-server.com \
  --site-name YourSite \
  --pat-name your-token-name \
  --pat-value your-token-value

# Option 2: Environment variables
export SERVER=https://your-tableau-server.com
export SITE_NAME=YourSite
export PAT_NAME=your-token-name
export PAT_VALUE=your-token-value

Environment variables take precedence over the config file. siteName defaults to "" (the default site) if not set.

# Verify configuration
tableau-cli config show

Use with Coding Agents

This repository ships an agent skill (skills/tableau-cli/) that routes a user's request to the right command and loads the full CLI reference only at execution time. The repository doubles as its own plugin marketplace for both Claude Code and Codex.

Claude Code

/plugin marketplace add i-richardwang/tableau-cli
/plugin install tableau-cli@tableau-cli

To receive updates, enable auto-update for the tableau-cli marketplace in /plugin, or run /plugin marketplace update tableau-cli manually.

Codex

codex plugin marketplace add i-richardwang/tableau-cli
codex plugin add tableau-cli@tableau-cli

To receive updates, run codex plugin marketplace upgrade.

The skill is only needed when an agent drives the tool — the CLI works standalone from any shell.

Commands

Search across all content types (workbooks, views, datasources, etc.).

tableau-cli search "Superstore"
tableau-cli search "Sales" --type workbook,view
tableau-cli search "Revenue" --limit 10 --order-by hitsTotal:desc

Datasources

# List all datasources
tableau-cli datasources list
tableau-cli ds list --filter "name:has:Sales" --limit 50

# Download datasource file (.tdsx)
tableau-cli datasources download <datasourceId> -o ./data/

# Download and convert to Parquet or CSV in one step (requires tableau-cli[convert] or uv)
tableau-cli ds download <datasourceId> -o ./data/ --to parquet
tableau-cli ds download <datasourceId> -o ./data/ --to csv

# Get field metadata (VizQL Data Service + Metadata API enrichment).
# On Tableau >= 2025.3 the result also includes the datasource model:
# logical tables and their relationships. `datasourceType` tells whether the
# LUID is a published datasource or one embedded in a workbook.
tableau-cli datasources metadata <luid>

# Query datasource data (VizQL Data Service)
tableau-cli datasources query <luid> --query '{"fields": [{"fieldCaption": "Category"}, {"fieldCaption": "Sales"}]}'
tableau-cli ds query <luid> --query '{"fields": [...]}' --limit 100

Views

# List views (includes upstream datasources via Metadata API enrichment)
tableau-cli views list
tableau-cli views list --filter "name:has:Dashboard" --format table

# Get view details: upstream datasources, workbook/project/owner info, and web URL
tableau-cli views get <viewId>

# Get view data as CSV
tableau-cli views data <viewId>

# Get view data with view filters applied
tableau-cli views data <viewId> --vf "Region=West" --vf "Category=Technology"

# Download view image
tableau-cli views image <viewId> -o dashboard.png
tableau-cli views image <viewId> --width 1200 --height 800 --img-format SVG -o dashboard.svg
tableau-cli views image <viewId> --vf "Region=West" -o west.png

Convert

Convert local TDSX/HYPER files to Parquet or CSV.

Conversion runs locally through the official tableauhyperapi package. Its native Hyper engine exports directly to Parquet or CSV, without loading the entire extract into a DataFrame. You have two options:

  • Install the export dependency into the CLI: pip install tableau-cli[convert].
  • Don't install anything: if uv is on your PATH, conversion transparently falls back to running the step in an ephemeral uv run --with ... environment, so the conversion dependency never lands in your host Python. The first run provisions the environment (a few seconds); later runs use uv's cache. This is the recommended path when the CLI itself was installed via uv tool install tableau-cli.

The conversion runtime requires native 64-bit Python 3.11 or newer. Supported targets are Apple Silicon Macs (macOS 13+), Intel Macs, Windows x86_64, and the Linux x86_64 distributions supported by Hyper API. Package installation selects the engine for the interpreter's platform; Apple Silicon uses the native ARM package.

Each extract must contain exactly one table. Exports preserve column order and use Hyper's native Parquet and CSV mappings. CSV includes a header and uses ISO dates. The destination is replaced only after a complete export. Download-and-convert commands check that the local engine can start before downloading the datasource.

For most use cases, ds download --to parquet (or --to csv) is simpler — it downloads and converts in one step. The convert command is useful when you already have a .tdsx or .hyper file on disk.

# Convert TDSX to Parquet (default)
tableau-cli convert data.tdsx
tableau-cli convert data.tdsx -o ./output/

# Convert to CSV
tableau-cli convert data.tdsx --to csv
tableau-cli convert data.tdsx --to csv -o ./output/

# Convert standalone HYPER file
tableau-cli convert extract.hyper --to csv -o ./output/result.csv

Workbooks

# List workbooks (includes upstream datasources via Metadata API enrichment)
tableau-cli workbooks list
tableau-cli wb list --filter "name:eq:Finance" --format table

# Get workbook details (includes views with usage statistics,
# upstream datasources, and the default view's web URL)
tableau-cli workbooks get <workbookId>

Projects

# List projects
tableau-cli projects list
tableau-cli projects list --filter "topLevelProject:eq:true" --format table

# Only projects you can publish into (requires REST API >= 3.30)
tableau-cli projects list --capability Write

Config

tableau-cli config set --server https://tableau.example.com
tableau-cli config show

Output

All commands output structured JSON to stdout by default. Use --format table for human-readable table output.

# JSON (default, for agent consumption)
tableau-cli ds list

# Table (for human reading)
tableau-cli ds list --format table

File Output

Commands that save files (ds download, views image -o, convert) output a JSON object with the file path to stdout, enabling agents to chain operations:

# Download and convert in one step
tableau-cli ds download <id> -o ./data/ --to parquet  # → {"filePath": ".../data.parquet"}

# Or as separate steps (useful for keeping the original .tdsx)
tableau-cli ds download <id> -o ./data/               # → {"filePath": ".../data.tdsx"}
tableau-cli convert ./data/data.tdsx -o ./data/        # → {"filePath": ".../data.parquet"}

Error Output

Errors are also structured JSON, designed to guide agents toward resolution:

{
  "isError": true,
  "errorType": "feature-disabled",
  "message": "The VizQL Data Service is disabled on this Tableau Server.",
  "hint": "To enable it, use TSM using the instructions at https://help.tableau.com/..."
}

Error types include: authentication-error, feature-disabled, workbook-datasource-not-enabled (embedded datasource querying is an opt-in site setting), tableau-api-error, config-error, validation-error, and translated VDS error codes with actionable hints.

API Coverage

Area APIs Used
Authentication REST API — PAT sign-in / sign-out, using the API version the server reports in serverinfo
Datasources REST API (list, get, download) + VizQL Data Service (metadata, model, query) + Metadata API (GraphQL enrichment)
Views REST API (list, get, data, image with view filters) + Metadata API (lineage enrichment)
Workbooks REST API (list, get with view enrichment) + Metadata API (lineage enrichment)
Projects REST API (list, optional capability filter)
Search Content Exploration API + Metadata API (lineage enrichment)
Convert Local file conversion: TDSX/HYPER → Parquet/CSV (optional dependencies)

Development

# Run directly
python -m tableau_cli.cli views list

# Install development and conversion dependencies
pip install -e ".[convert,dev]"

# Validate local exports and isolated uv execution
ruff check .
pytest

Acknowledgements

This project is derived from @tableau/mcp-server, adapting its Tableau REST API, VizQL Data Service, and Metadata API integrations into a CLI format.

License

Apache License 2.0

Metadata

Release files for tableau-cli 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tableau-cli 0.1.6
File Size Uploaded Provenance Actions
tableau_cli-0.1.6.tar.gz 41.9 kB With provenance Details for tableau_cli-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tableau-cli 0.1.6
File Interpreter ABI Platform Actions
tableau_cli-0.1.6-py3-none-any.whl Python 3 none any Details for tableau_cli-0.1.6-py3-none-any.whl

Total release size: 87.0 kB

Release files / tableau_cli-0.1.6.tar.gz

Download URL tableau_cli-0.1.6.tar.gz
Size 41.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6aba6ebae5fdd5c33a8f257c744a7c9321b461ba66775db9cc2e886168eee5f0
BLAKE2b-256 checksum
How to use checksums
1804c301481e509981b021a265dbd60511ed2994d4218f8db7bea23e42cca69f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / tableau_cli-0.1.6-py3-none-any.whl

Download URL tableau_cli-0.1.6-py3-none-any.whl
Size 45.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23d68fb564821f09b734d675762f4719df51744e827361cafae1c58036b8a119
BLAKE2b-256 checksum
How to use checksums
b16c49f7be9f4786ff1bbc444571b3aa6f6120b2a6569eff167439218f117b70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for tableau-cli 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tableau_cli-0.1.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page