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
- Marketing as Code: Manage segments, workflows, and journeys as YAML files—testable locally, deployable safely. Learn with our AI-Native Marketing Book.
- Claude Code Integration: Launch Claude Code with TD LLM API backend using
tdx claudefor 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/Windows Users
For the best experience on Windows, we recommend using WSL2 (Windows Subsystem for Linux). See our Installation Guide for step-by-step instructions.
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
- Feature Roadmap - See current feature coverage and planned development
- Profile Management - Set up authentication and manage multiple environments
- Commands - Explore all available commands
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