Skip to main content

Tower CLI

The Tower CLI is one of the primary ways to interact with the Tower service. It lets you deploy apps to Tower, run them, and then manage them. It also lets you set up the runtime environment for apps (e.g. define secrets). Additionally, you can create and manage teams that hold your apps.

tower deploy

Deploys a new version of an app to Tower using the Towerfile in your local directory. This command should be run from a directory containing a Towerfile. Before deploying an app, you should first create the app in Tower by using the tower apps create command. If you forget to create the app first, the CLI will offer you to create an app based on your Towerfile.

Options

  • --help shows a help message and exits

Example

tower deploy
✔ Building package... Done!
Deploying to Tower... [00:00:01] [████████████████████████████████████████] 2.13 MiB/2.13 MiB (0s)
Success! Version `v11` of your code has been deployed to Tower!

tower run

Runs a Tower app, either locally or remotely. This command should be run from a directory containing a Towerfile.

Options

  • --help shows a help message and exits
  • --local runs the app locally instead of in the Tower cloud
  • --environment is the environment configuration to use for this run. This only applies to remote runs.

Example

tower run --local
✔ Getting secrets... Done!
✔ Building package... Done!
Success! App `hello-world` has been launched
2024-11-20 08:32:42 | Hello, world!
2024-11-20 08:32:43 | Hello, world!
2024-11-20 08:32:44 | Hello, world!
2024-11-20 08:32:45 | Hello, world!
2024-11-20 08:32:46 | Hello, world!
Success! Your app exited cleanly.

tower apps

The primary interface in to manaing your apps. This command supports multiple subcommands.

tower apps list

List all of your Tower apps.

Options

  • --help shows a help message and exits

Example

tower apps list
 * my-first-app
No description

* my-second-app
A simple 'Hello, world!' app for demonstrating Tower.

tower apps create

Create a new app in Tower.

Options

  • --help shows a help message and exits
  • --name (required) the name for the new app
  • --description (optional) a short description for the app

Example

tower apps create --name=my-new-app --description="An example app to show off Tower"
✔ Creating app Done!
Success! App "my-new-app" was created

tower apps show <app name>

Shows the details of an app as well as the latest run status.

Arguments

  • <app name> is the name of the app to show details for

Options

  • --help shows a help message and exits

Example

tower apps show
hello-world                                                                                                                                                                                     130 ↵
Name: hello-world
Description:
A simple 'Hello, world!' app for demonstrating Tower.

Recent runs:
# Status Start Time Elapsed Time
------------------------------------------------
11 exited 2024-11-19 20:14:46 9s
10 exited 2024-11-19 20:14:20 5s
9 crashed 2024-11-19 20:13:36 3s
8 exited 2024-11-19 19:46:01 7s
7 exited 2024-11-16 15:31:23 7s
6 exited 2024-11-15 15:40:23 7s
5 exited 2024-11-15 11:07:51 5s
4 exited 2024-11-15 08:44:23 10s
3 exited 2024-11-14 16:02:31 8s
2 exited 2024-11-13 20:37:03 7s

tower apps delete <app name>

Delete an app in Tower. Once an app is deleted, it cannot be recovered.

Arguments

  • <app name> is the name of the app to delete

Options

  • --help shows a help message and exits

Example

tower apps delete my-new-app
✔ Deleting app... Done!
Success! App "my-new-app" was deleted

tower apps logs <app name>#<run number>

Fetches and displays the logs for a specific Tower app run. To address a specific run, you have to supply the app name and a run number. You can get the latest runs from tower apps show. See the example below for a detailed example.

Arguments

  • <app name> is the name of the app to get logs for
  • <run number> is the run sequence number to get logs for

Options

  • --help shows a help message and exits

Example

tower apps logs hello-world#11
✔ Fetching logs... Done!
2024-11-19 20:14:46 | Hello, world!
2024-11-19 20:14:47 | Hello, world!
2024-11-19 20:14:48 | Hello, world!
2024-11-19 20:14:49 | Hello, world!
2024-11-19 20:14:50 | Hello, world!

tower secrets

Secrets are sensitive data that gets injected into the runtime environment at runtime, but can be managed externally. The secrets can be used in multiple environments, and even locally! It's a great way to share data with your colleagues. See the documentation on Secrets for more details on how they behave.

tower secrets list

List all the secrets that you have configured in Tower. By default, only a preview of the secrets is shown. You can supply the --show (or -s) option to see the secrets in plain text. For more details on how your secrets are secured, see the documentation on secrets.

By default, when you run tower secrets list with no options, you will show all secrets in your default environment only.

Options

  • --help shows a help message and exits
  • --environment shows how secrets would appear in a certain environment
  • --all shows all secrets
  • --show shows the secrets in plain text

Example

tower secrets list
 Secret     Environment  Preview
------------------------------------
my_secret default XXXXXXXXXX

tower secrets create

Create a new secret in Tower. For more details on how your secrets are secured, see the documentation on Secrets.

Options

  • --help shows a help message and exits
  • --name is the name of the secret to create
  • --value is the plain text value to create
  • --environment is the environment this secret value should be used in

Example

tower secrets create --name=my_secret --value=its_a_secret
✔ Creating secret... Done!
Success! Secret "my_secret" was created

tower secrets delete <secret name>

Delete a secret in Tower.

Options

  • --help shows a help message and exits

Example

tower secrets delete my_secret
✔ Deleting secret... Done!
Success! Secret "my_secret" was deleted

tower teams

By creating a team in Tower you are setting up a group to collaboratively work on developing and making modifications to apps. Teams also allow you controlling who can deploy and run shared apps. Teams encompass apps, their runtime environments (secrets) and members.

See the Working in Teams guide for more details on how they behave.

tower teams list

Lists all teams you are member of and includes your personal account. Indicates with an asterisk which team or personal account is currently active.

Options

  • --help shows a help message and exits

Example

tower teams list
    Slug            Team Name
-----------------------------------------
team-1 Team 1
team-2 Team 2
* account-123 First Last

* indicates currently active team

tower teams switch <team or personal slug>

Make the specified team or personal account active in the Tower CLI session. All further commands that relate to apps and secrets will be executed in the context of the selected team or personal account.

Options

  • --help shows a help message and exits

Example

tower teams switch team-1
Success! Switched to team: Team 1