Skip to content

Introduction

Under Active Development

SDK/CLI commands are subject to change (2025)

tdx is a modern, AI-native command-line interface for Treasure Data, optimized for both humans and AI assistants.

Features

  • AI-Native Design: Consistent JSON output, predictable error codes, and structured responses designed for AI assistants
  • Claude Code Integration: Launch Claude Code with TD LLM API backend using tdx claude for AI-powered development
  • Multiple Profile Support: Manage multiple environments with profile-based authentication for different accounts and regions
  • Modern Distribution: Install via npx or npm without prior setup. Zero configuration to get started

Requirements

  • Node.js 22.0.0 or higher (Node.js 24 Active LTS recommended)
  • TD API key with appropriate permissions

Installing Node.js

If you don't have Node.js installed:

bash
# macOS (using Homebrew)
brew install node

# Or download from https://nodejs.org/

Alternative: Using Bun

Bun is a fast JavaScript runtime that works as a drop-in replacement:

bash
# macOS/Linux
curl -fsSL https://bun.sh/install | bash

# Windows
powershell -c "irm bun.sh/install.ps1 | iex"

Quick Start

bash
# Install globally
npm install -g @treasuredata/tdx

# Set up authentication (interactive)
tdx auth setup

# List databases
tdx databases

# Run a query
tdx query "SELECT * FROM mydb.users LIMIT 10"

# Chat with AI
tdx chat "Show me customer revenue trends"

Next Steps

Advanced: Running without Installation

For one-off usage or testing, you can run tdx directly without global installation:

bash
# Using npx (comes with Node.js)
npx @treasuredata/tdx databases

# Using bunx (comes with Bun)
bunx @treasuredata/tdx databases