Installation
-
Download the latest version for your OS from the CLI GitHub repository.
-
Rename the file and and make it executable:
mv tw-* tw
chmod +x ./tw -
Move the file to a directory accessible to your
$PATH
variable:sudo mv tw /usr/local/bin/
Configuration
The CLI requires an access token to interact with your Seqera Platform instance. Select User tokens from the user menu in the Platform UI, then select Add token to create a new token.
Copy the access token value and use it with the CLI in one of two ways:
-
Environment variable:
- Export the token as a shell variable directly into your terminal:
export TOWER_ACCESS_TOKEN=<your access token>
- Add the
export
command to your.bashrc
,.zshrc
, or.bash_profile
file for it to be permanently added to your environment.
-
tw command flag:
Provide the access token directly in your
tw
command with--access-token
:tw --access-token=<your access token> <other options>
If required, configure the following optional environment variables using the same methods above:
TOWER_WORKSPACE_ID
: Workspace ID. Default: Your user workspace.TOWER_API_ENDPOINT
: Seqera API URL. Default:api.cloud.seqera.io
.
Find your TOWER_WORKSPACE_ID
from the Workspaces tab on your organization page. Alternatively, list all the workspaces your token can access with tw workspaces list
and copy the workspace ID from the command output.
Health check
Confirm the installation, configuration, and connection:
tw info
Details
-------------------------+----------------------
Tower API endpoint | <TOWER_API_ENDPOINT>
Tower API version | 1.25.0
Tower version | 24.2.0_cycle22
CLI version | 0.9.4 (f3e846e)
CLI minimum API version | 1.15
Authenticated user | <username>
System health status
---------------------------------------+------------------
Remote API server connection check | OK
Tower API version check | OK
Authentication API credential's token | OK
Commands
See Commands for detailed instructions to use the CLI.
Autocompletion
Activate autocompletion in your current session with this command:
source <(tw generate-completion)
Custom SSL certificate authority store
If you are using a Private CA SSL certificate not recognized by the default Java certificate authorities, use a custom cacerts
store:
tw -Djavax.net.ssl.trustStore=/absolute/path/to/cacerts info
You can rename the binary to tw-binary
and create a tw
script to automatically include the custom cacerts
store in every session:
#!/usr/bin/env bash
tw-binary -Djavax.net.ssl.trustStore=/absolute/path/to/cacerts $@
Build binary development versions
tw CLI is a platform binary executable created by a native compilation from Java GraalVM. To compile and build a development version of the binary:
-
If necessary, install SDKMan!
-
From the root of the tower-cli project, install GraalVM:
sdk env install
This ensures that SDKMan uses the tower-cli project-specific
.sdkmanrc
configuration. -
Install
native-image
:gu install native-image
-
Export your Github credentials. Github requires authentication for public packages (the token only requires the
read:packages
scope):export GITHUB_USERNAME=...
export GITHUB_TOKEN=... -
Create the native client:
./gradlew nativeCompile
This will install a locally compiled version of
tw
in the nativeCompile directory:Produced artifacts:
<tower-cli-repository-root>/build/native/nativeCompile/tw (executable)
========================================================================================================================
Finished generating 'tw' in 1m 6s.
[native-image-plugin] Native Image written to: <tower-cli-repository-root>/build/native/nativeCompile
BUILD SUCCESSFUL in 1m 8s
6 actionable tasks: 2 executed, 4 up-to-date -
Run
tw
:./build/native/nativeCompile/tw
Non-binary development versions
Run a non-binary development version by executing the ./tw
script in the root of the CLI repository.