Skip to content
Last updated

Upgrade Commands

Upgrade tdx to the latest version. Detects your package manager (npm, bun, pnpm, or yarn) and runs the appropriate install command, targeting the same location as the running tdx.

Usage

tdx upgrade [version] [options]

Arguments

ArgumentDescription
[version]Target version to install (e.g., 0.28.0 or v0.28.0). Defaults to latest.

Options

OptionDescription
--dry-runCheck for updates without installing
--nextUpgrade to the next (pre-release) channel
--method <pm>Package manager to use (npm, bun, pnpm, yarn)

Examples

# Upgrade to latest stable version
tdx upgrade

# Upgrade to a specific version
tdx upgrade 0.28.0

# Check what would happen without installing
tdx upgrade --dry-run

# Upgrade to the pre-release channel
tdx upgrade --next

# Override the detected package manager
tdx upgrade --method pnpm

# Combine version and method
tdx upgrade 0.28.0 --method bun

Behavior

  1. Checks the npm registry for the latest version
  2. Compares with the currently installed version
  3. If an update is available, runs the install command into the location of the running tdx (see Install Location)
  4. For npm with an exact version, checks that the installed package reports it
  5. Reports success or failure

When a specific [version] is provided, the registry check and version comparison are skipped — the command installs the requested version directly.

When using --dry-run, the command shows the version comparison and the install command that would be executed, without actually running it.

Package Manager Detection

The command automatically detects whether tdx was installed via npm, bun, pnpm, or yarn and uses the corresponding package manager for the upgrade. Use --method to override auto-detection.

Install Location

tdx upgrade installs into the same npm prefix or pnpm global directory as the running tdx. For example, a tdx installed with npm install -g --prefix ~/.local upgrades in ~/.local. --dry-run shows the location.

Troubleshooting

"Upgrade did not replace the running tdx" (npm): the install finished, but the location still has the old version. Run tdx upgrade --dry-run to see the location, then install into it directly:

npm install -g --prefix <location> @treasuredata/tdx@<version>

For pnpm, use pnpm add -g --global-dir <location> @treasuredata/tdx@<version>.

Notes

  • Not available for development versions (local builds from source)
  • The --next flag overrides the release channel configured in ~/.config/tdx/tdx.json
  • Leading v prefix is stripped from version arguments (v0.28.0 → 0.28.0)