# Upgrade Commands Upgrade tdx to the latest version. Detects your package manager (npm or bun) and runs the appropriate install command. ## Usage ```bash tdx upgrade [version] [options] ``` ## Arguments | Argument | Description | | --- | --- | | `[version]` | Target version to install (e.g., `0.28.0` or `v0.28.0`). Defaults to latest. | ## Options | Option | Description | | --- | --- | | `--dry-run` | Check for updates without installing | | `--next` | Upgrade to the next (pre-release) channel | | `--method ` | Package manager to use (`npm`, `bun`, `pnpm`, `yarn`) | ## Examples ```bash # 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 4. 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. ## 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`)