{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Installation Guide - tdx | Treasure Data","description":"Install tdx CLI on macOS, Windows, and Linux. Supports npm, Homebrew, nvm, and WSL2 installation methods.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]},"image":"/assets/og-image.ba836864a30434f560a4f7720f8a09019ad30ff828b20c5052ae933ba7121524.d7ef4821.png"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"installation","__idx":0},"children":["Installation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide covers installing tdx on all platforms."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"requirements","__idx":1},"children":["Requirements"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Node.js 22.0.0 or higher"]}," (Node.js 24 Active LTS recommended)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TD API key with appropriate permissions"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"quick-install","__idx":2},"children":["Quick Install"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you already have Node.js installed:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"npm install -g @treasuredata/tdx\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"macos","__idx":3},"children":["macOS"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"using-homebrew","__idx":4},"children":["Using Homebrew"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Install Node.js\nbrew install node\n\n# Install tdx\nnpm install -g @treasuredata/tdx\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"using-nvm-recommended-for-version-management","__idx":5},"children":["Using nvm (recommended for version management)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Install nvm\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\n\n# Load nvm\n\\. \"$HOME/.nvm/nvm.sh\"\n\n# Install Node.js 24\nnvm install 24\n\n# Install tdx\nnpm install -g @treasuredata/tdx\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"linux","__idx":6},"children":["Linux"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"using-nvm-recommended","__idx":7},"children":["Using nvm (recommended)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Install nvm\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\n\n# Load nvm\n\\. \"$HOME/.nvm/nvm.sh\"\n\n# Install Node.js 24\nnvm install 24\n\n# Install tdx\nnpm install -g @treasuredata/tdx\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"secret-manager-for-credential-storage","__idx":8},"children":["Secret Manager (for credential storage)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["tdx stores API keys securely using your system's secret manager. Install libsecret:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Ubuntu/Debian\nsudo apt update\nsudo apt install -y libsecret-1-0 gnome-keyring\n\n# Fedora/RHEL\nsudo dnf install libsecret gnome-keyring\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"windows","__idx":9},"children":["Windows"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["tdx works natively on Windows with PowerShell and Node.js. Choose the option that best fits your workflow:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PowerShell"]}," — Native Windows experience, recommended for most users"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["WSL2"]}," — Linux environment within Windows, useful if you prefer bash/zsh"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"option-a-powershell-recommended","__idx":10},"children":["Option A: PowerShell (Recommended)"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"step-1-install-nodejs","__idx":11},"children":["Step 1: Install Node.js"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Download and install Node.js from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://nodejs.org/"},"children":["nodejs.org"]},", or use Windows Package Manager:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"powershell","header":{"controls":{"copy":{}}},"source":"# Using winget (Windows 10/11)\nwinget install OpenJS.NodeJS.LTS\n\n# Verify installation\nnode -v   # Should print v22.x.x or higher\nnpm -v    # Should print 10.x.x or higher\n","lang":"powershell"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"step-2-install-tdx","__idx":12},"children":["Step 2: Install tdx"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"powershell","header":{"controls":{"copy":{}}},"source":"npm install -g @treasuredata/tdx\n\n# Verify installation\ntdx --version\n","lang":"powershell"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success","name":"Credential Storage"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Windows uses the built-in Credential Manager for secure API key storage. No additional setup required."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"option-b-wsl2-alternative","__idx":13},"children":["Option B: WSL2 (Alternative)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["WSL2 provides a full Linux environment within Windows. This is useful if you:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Prefer bash/zsh over PowerShell"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Want an environment matching Linux production servers"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Work with Linux-specific tooling"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"step-1-install-wsl2","__idx":14},"children":["Step 1: Install WSL2"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open PowerShell as Administrator and run:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"powershell","header":{"controls":{"copy":{}}},"source":"wsl --install\n","lang":"powershell"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This installs WSL2 with Ubuntu as the default distribution. Restart your computer when prompted."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After restart, Ubuntu will launch automatically to complete setup. Create a username and password when prompted."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more details, see the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://learn.microsoft.com/en-us/windows/wsl/"},"children":["official WSL documentation"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"step-2-install-nodejs-using-nvm","__idx":15},"children":["Step 2: Install Node.js (using nvm)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open your WSL terminal (Ubuntu) and run:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Install nvm\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\n\n# Load nvm\n\\. \"$HOME/.nvm/nvm.sh\"\n\n# Install Node.js 24\nnvm install 24\n\n# Verify installation\nnode -v  # Should print v22.x.x or higher\nnpm -v   # Should print 10.x.x or higher\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"step-3-install-secret-manager","__idx":16},"children":["Step 3: Install Secret Manager"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo apt update\nsudo apt install -y libsecret-1-0 libsecret-1-dev gnome-keyring dbus-x11\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To initialize the keyring:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Start D-Bus if not running\neval $(dbus-launch --sh-syntax)\n\n# Initialize keyring (you'll be prompted for a password)\ngnome-keyring-daemon --unlock\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"step-4-install-tdx","__idx":17},"children":["Step 4: Install tdx"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"npm install -g @treasuredata/tdx\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"verify-installation","__idx":18},"children":["Verify Installation"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"tdx --version\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-up-authentication","__idx":19},"children":["Set Up Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Run the interactive setup:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"tdx auth setup\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This will prompt you for:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Region"]}," — Where your Treasure AI account lives (US, JP, EU, or AP)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Key"]}," — Your personal API key from Treasure AI"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Verify your setup with:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"tdx status\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This shows your authentication status, user info, current context, and configuration files all in one view."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"install-claude-code-optional","__idx":20},"children":["Install Claude Code (Optional)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To use AI-powered development:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"npm install -g @anthropic-ai/claude-code\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Launch Claude Code with Treasure AI skills:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"tdx claude\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"alternative-using-bun","__idx":21},"children":["Alternative: Using Bun"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://bun.sh/"},"children":["Bun"]}," is a fast JavaScript runtime that works as a drop-in replacement:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# macOS/Linux\ncurl -fsSL https://bun.sh/install | bash\n\n# Windows (PowerShell)\npowershell -c \"irm bun.sh/install.ps1 | iex\"\n\n# Install tdx\nbun install -g @treasuredata/tdx\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"troubleshooting","__idx":22},"children":["Troubleshooting"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"command-not-found-tdx","__idx":23},"children":["\"Command not found: tdx\""]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The npm global bin folder might not be in your PATH."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["macOS/Linux:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Add to ~/.bashrc or ~/.zshrc\nexport PATH=\"$PATH:$(npm config get prefix)/bin\"\n\n# Reload your shell\nsource ~/.bashrc\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Windows (PowerShell):"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"powershell","header":{"controls":{"copy":{}}},"source":"# Check if npm global bin is in PATH\nnpm config get prefix\n\n# The bin folder should be at: C:\\Users\\<username>\\AppData\\Roaming\\npm\n# If tdx still isn't found, restart your terminal or re-login\n","lang":"powershell"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"keychain-errors-on-linuxwsl2","__idx":24},"children":["Keychain errors on Linux/WSL2"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you see errors about the keychain being unavailable:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ensure libsecret is installed:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo apt install -y libsecret-1-0 gnome-keyring\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Start the D-Bus daemon:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"eval $(dbus-launch --sh-syntax)\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["As a fallback, use environment variables:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"export TDX_API_KEY=your-api-key-here\n","lang":"bash"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"wsl2-network-issues","__idx":25},"children":["WSL2 network issues"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you have trouble connecting to Treasure AI APIs from WSL2:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Check your DNS settings\ncat /etc/resolv.conf\n\n# If needed, override DNS\nsudo sh -c 'echo \"nameserver 8.8.8.8\" > /etc/resolv.conf'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"windows-execution-policy-errors","__idx":26},"children":["Windows: Execution policy errors"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you see \"running scripts is disabled on this system\":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"powershell","header":{"controls":{"copy":{}}},"source":"# Run PowerShell as Administrator and execute:\nSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser\n","lang":"powershell"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":27},"children":["Next Steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/treasure-code/guide/profile-management"},"children":["Profile Management"]}," — Set up multiple profiles for different environments"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/treasure-code/guide/proxy"},"children":["Proxy Configuration"]}," — Configure an HTTP proxy for corporate networks"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/treasure-code/commands"},"children":["Commands Reference"]}," — Explore all available commands"]}]}]},"headings":[{"value":"Installation","id":"installation","depth":1},{"value":"Requirements","id":"requirements","depth":2},{"value":"Quick Install","id":"quick-install","depth":2},{"value":"macOS","id":"macos","depth":2},{"value":"Using Homebrew","id":"using-homebrew","depth":3},{"value":"Using nvm (recommended for version management)","id":"using-nvm-recommended-for-version-management","depth":3},{"value":"Linux","id":"linux","depth":2},{"value":"Using nvm (recommended)","id":"using-nvm-recommended","depth":3},{"value":"Secret Manager (for credential storage)","id":"secret-manager-for-credential-storage","depth":3},{"value":"Windows","id":"windows","depth":2},{"value":"Option A: PowerShell (Recommended)","id":"option-a-powershell-recommended","depth":3},{"value":"Step 1: Install Node.js","id":"step-1-install-nodejs","depth":4},{"value":"Step 2: Install tdx","id":"step-2-install-tdx","depth":4},{"value":"Option B: WSL2 (Alternative)","id":"option-b-wsl2-alternative","depth":3},{"value":"Step 1: Install WSL2","id":"step-1-install-wsl2","depth":4},{"value":"Step 2: Install Node.js (using nvm)","id":"step-2-install-nodejs-using-nvm","depth":4},{"value":"Step 3: Install Secret Manager","id":"step-3-install-secret-manager","depth":4},{"value":"Step 4: Install tdx","id":"step-4-install-tdx","depth":4},{"value":"Verify Installation","id":"verify-installation","depth":2},{"value":"Set Up Authentication","id":"set-up-authentication","depth":2},{"value":"Install Claude Code (Optional)","id":"install-claude-code-optional","depth":2},{"value":"Alternative: Using Bun","id":"alternative-using-bun","depth":2},{"value":"Troubleshooting","id":"troubleshooting","depth":2},{"value":"\"Command not found: tdx\"","id":"command-not-found-tdx","depth":3},{"value":"Keychain errors on Linux/WSL2","id":"keychain-errors-on-linuxwsl2","depth":3},{"value":"WSL2 network issues","id":"wsl2-network-issues","depth":3},{"value":"Windows: Execution policy errors","id":"windows-execution-policy-errors","depth":3},{"value":"Next Steps","id":"next-steps","depth":2}],"frontmatter":{"seo":{"title":"Installation Guide - tdx | Treasure Data","description":"Install tdx CLI on macOS, Windows, and Linux. Supports npm, Homebrew, nvm, and WSL2 installation methods.","image":"/assets/og-image.ba836864a30434f560a4f7720f8a09019ad30ff828b20c5052ae933ba7121524.d7ef4821.png"}},"lastModified":"2026-05-18T01:25:54.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/treasure-code/guide/installation","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}