Skip to content

Command Reference

This page provides detailed information about all available commands in Tsuru.

Command Overview

Tsuru provides the following main commands:

  • install - Download and install SDK versions
  • use - Set a specific SDK version as the current one
  • postinstall - Configure post-installation scripts/commands
  • config - Configure tsuru settings
  • help - Display help information

The general syntax for Tsuru commands is:

bash
tsuru <action> [parameters]

Common Options

The following options are available for multiple commands:

  • -f, --force - Force the action even if it would overwrite existing installations
  • -g, --global - Apply the action globally (system-wide) rather than just for the current session

install

The install command downloads and installs a specific SDK version.

Syntax

bash
tsuru install <provider> [vendor] <version> [options]

Parameters

  • provider - The type of SDK to install (e.g., jdk, nodejs)
  • vendor - (Optional for some providers) The vendor of the SDK (e.g., zulu, graalcommunity)
  • version - The version to install

Options

  • -f, --force - Force installation even if the version is already installed

Examples

INFO

Installing JDK (Java Development Kit) requires specifying a vendor

bash
# Install Zulu JDK 21
tsuru install jdk zulu 21

# Install GraalVM Community Edition JDK 24
tsuru install jdk graalcommunity 24

# Force reinstallation of NodeJS 22
tsuru install nodejs 22 --force

use

The use command sets a specific SDK version as the current one, updating environment variables accordingly.

Syntax

bash
tsuru use <provider> [vendor] <version> [options]

Parameters

  • provider - The type of SDK to use (e.g., jdk, nodejs)
  • vendor - (Optional for some providers) The vendor of the SDK (e.g., zulu, graalcommunity)
  • version - The version to use

Options

  • -g, --global - Apply the change globally (system-wide)
  • -f, --force - Force using the version even if it requires installation

Examples

bash
# Use Zulu JDK 21 for the current session
tsuru use jdk zulu 21

# Use NodeJS 22 globally (system-wide)
tsuru use nodejs 22 -g

# Use and install (if necessary) GraalVM Community Edition JDK 24
tsuru use jdk graalcommunity 24 -f

postinstall

The postinstall command configures scripts or commands to be executed after SDK installation.

Syntax

bash
tsuru postinstall <provider> [vendor] <script_path|command>

Parameters

  • provider - The type of SDK the post-install script is for (e.g., jdk, nodejs)
  • vendor - (Optional for some providers) The vendor of the SDK (e.g., zulu, graalcommunity)
  • script_path|command - Either a path to an executable script or a direct command to run

Examples

bash
# Add a post-install script for JDK
tsuru postinstall jdk zulu /path/to/my-java-setup.sh

# Add a post-install command for NodeJS
tsuru postinstall nodejs "npm install -g yarn"

config

The config command allows you to view and set configuration values.

Syntax

bash
tsuru config <key> [value]

Parameters

  • key - The configuration key to view or set
  • value - (Optional) The value to set for the configuration key

Examples

bash
# View a configuration value
tsuru config download.path

# Set a configuration value
tsuru config download.path /custom/download/path

help

The help command displays usage information.

Syntax

bash
tsuru help

Output

The help command displays:

  • Basic usage syntax
  • Available actions
  • Examples of common commands

Example

bash
$ tsuru help
Usage
-----
  tsuru <action> [parameters]

Actions
-------
  install <provider> [vendor] <version>     Download the provider tool with specified version
  use <provider> [vendor] <version>         Set the provider tool with specified version as the current one

Examples
--------
  tsuru install jdk zulu 21
  tsuru install nodejs 22