Using the Trino command-line interface

The Trino command-line interface (CLI) provides a terminal-based, interactive shell for running queries. The CLI is a self-executing JAR file and acts like a normal UNIX executable.

  • Ensure you have generated and copied a valid AWC access token (JWT token) from the API Explorer, as this will be required to authenticate your connection. For more details, see Create a new access key.
  • Make sure Java 11 or later is installed and configured in your system's path.
  1. Log in to the instance.
  2. In the Overview page of , click See More in the Resources and Downloads tile.
  3. In the Trino CLI, click to download the trino-cli-executable.jar file.
  4. Save the trino-cli-executable.jar file and make it an executable file by running the following command:
    chmod +x trino-cli-executable.jar
  5. To connect the to the client, click Actions > Copy Trino URL.
  6. Paste the copied Trino URL in a text file, to be used in later steps.
  7. Open a terminal window to start Trino CLI. You can run the following command to check the version of the CLI:
    ./trino-cli-executable.jar --version
    Run the CLI with --help or -h to see all available options.
  8. To start the Trino CLI in an interactive mode, specify the URL of the Trino coordinator that you copied earlier:
    ./trino-cli-executable.jar https://trino.example.com --user <user-name> --access-token <jwt-token>
    This starts an interactive shell where you can connect to Trino and run SQL queries.