Skip to main content

Tower CLI and runtime environment for Tower.

Project description

Tower CLI

The Tower CLI is one of the main ways to interact with the Tower environment. You can do basically everything you need inside the Tower CLI, including run your code locally or remotely in the Tower cloud.

Installing the Tower CLI

The main way to install the CLI is using the pip package manager.

$ pip install -U tower

You can also download the CLI directly from one of our releases.

Nix Flake

If you have Nix installed with flakes enabled, you can install the latest version of tower CLI with the following:

Profile

$ nix profile install github:tower/tower-cli#tower

NixOS/nix-darwin

If you are using NixOS/nix-darwin with flakes then you can add the following:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    tower-cli.url = "github:tower/tower-cli";
  };

  outputs = { self, nixpkgs, tower-cli, ... }@inputs: {
    # with nix-darwin:
    # darwinConfigurations.your-hostname = darwin.lib.darwinSystem {
    nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [{
        environment.systemPackages = [ tower-cli.packages.${system}.tower ];
      }];
    };
  };
}

Devenv

If you're using devenv, you can add tower-cli to your project:

# devenv.yaml
inputs:
  tower-cli:
    url: github:tower/tower-cli
# devenv.nix
{ inputs, pkgs, ... }:
{
  packages = [
    inputs.tower-cli.packages.${pkgs.stdenv.system}.tower
  ];
}

Using the Tower CLI

There are two big components in the Tower CLI reposiory: The CLI itself and the runtime environment for the Tower cloud. We host the runtime in this repository and pull it in to our internal code because we want to ensure that the environments behave exactly the same locally and in our cloud!

Using the CLI

It's pretty straight forward! But here's what it looks like right now.

$ tower
Tower is a compute platform for modern data projects

Usage: tower [OPTIONS] <COMMAND>

Commands:
  login    Create a session with Tower
  apps     Interact with the apps that you own
  secrets  Interact with the secrets in your Tower account
  deploy   Deploy your latest code to Tower
  run      Run your code in Tower or locally
  version  Print the current version of Tower
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help                   Print help

Optional Features

Tower supports several optional features that can be installed as needed:

AI/LLM Support

pip install "tower[ai]"

Provides integration with language models through:

  • tower.llms: Access to language model functionality

Apache Iceberg Support

pip install "tower[iceberg]"

Provides Apache Iceberg table support:

  • tower.create_table: Create Iceberg tables
  • tower.load_table: Load data from Iceberg tables
  • tower.tables: Access Iceberg table functionality

dbt Core Support

pip install "tower[dbt]"

Provides dbt Core integration for running dbt workflows:

import tower

# Configure and run a dbt workflow
workflow = tower.dbt(
    project_path="path/to/dbt_project",
    profile_payload=tower.dbt.load_profile_from_env("DBT_PROFILE_YAML"),
    commands="deps,seed,build",
)

results = workflow.run()

Available helper functions and classes:

  • tower.dbt.load_profile_from_env(): Load dbt profile from environment variables
  • tower.dbt.parse_command_plan(): Parse comma-separated commands into a command plan
  • tower.dbt.DbtCommand: Represents a dbt CLI command invocation
  • tower.dbt.DbtRunnerConfig: Low-level configuration class
  • tower.dbt.run_dbt_workflow(): Low-level execution function

For a complete example, see the dbt Core Ecommerce Analytics app.

Install All Optional Features

pip install "tower[all]"

Check Available Features

You can check which features are available in your installation:

import tower
import pprint

# Print information about all features
pprint.pprint(tower.get_available_features())

# Check if a specific feature is enabled
print(tower.is_feature_enabled("ai"))

MCP Server Integration

Tower CLI includes an MCP (Model Context Protocol) server that allows AI assistants and editors to interact with your Tower account directly. The MCP server provides tools for managing apps, secrets, teams, and deployments.

Prerequisites

Before using the MCP server, ensure you're logged into Tower:

tower login

The MCP server will use your existing Tower CLI authentication and configuration.

Available Tools

The MCP server exposes the following tools:

  • tower_apps_list - List all Tower apps in your account
  • tower_apps_create - Create a new Tower app
  • tower_apps_show - Show details for a Tower app and its recent runs
  • tower_apps_logs - Get logs for a specific Tower app run
  • tower_apps_delete - Delete a Tower app
  • tower_secrets_list - List secrets in your Tower account
  • tower_secrets_create - Create a new secret in Tower
  • tower_secrets_delete - Delete a secret from Tower
  • tower_teams_list - List teams you belong to
  • tower_teams_switch - Switch context to a different team
  • tower_deploy - Deploy your app to Tower cloud
  • tower_run - Run your app locally

Starting the MCP Server

The Tower MCP server uses Server-Sent Events (SSE) for communication and runs on port 34567 by default. Start the server:

tower mcp-server

Or specify a custom port:

tower mcp-server --port 8080

The server will display a message showing the URL it's running on:

SSE server running on http://127.0.0.1:34567

It's important to keep the terminal with the MCP server open until you're finished. Alternatively, you can launch it in the background with:

tower mcp-server &

It's also important to be logged in. If you haven't already, you can open another terminal window and type tower login in order to open the login in a browser window.

Client Configuration

Claude Code

Add the Tower MCP server to Claude Code using SSE transport:

claude mcp add tower http://127.0.0.1:34567/sse --transport sse

Or with the JSON configuration directly:

{
  "mcpServers": {
    "tower": {
      "url": "http://127.0.0.1:34567/sse",
      "transport": "sse"
    }
  }
}

For custom ports, adjust the URL accordingly (e.g., http://127.0.0.1:8080/sse).

Cursor

Install MCP Server

If that doesn't work, try opening the following link in your browser or in your terminal with open on macOS, or xdg-open on Linux:

cursor://anysphere.cursor-deeplink/mcp/install?name=tower&config=eyJ1cmwiOiJodHRwOi8vMTI3LjAuMC4xOjM0NTY3L3NzZSJ9

Or manually, add this to your Cursor MCP settings (mcp.json):

{
  "mcpServers": {
    "tower": {
      "url": "http://127.0.0.1:34567/sse"
    }
  }
}
VS Code

In VS Code, first you should enable MCP integrations by setting Chat>MCP:Enabled to true in your settings.

For adding the server, you can try copying and pasting the following link into your URL bar:

vscode:mcp/install?%7B%22name%22%3A%22tower%22%2C%22type%22%3A%22sse%22%2C%22url%22%3A%22http%3A%2F%2F127.0.0.1%3A34567%2Fsse%22%7D

Alternatively, you can add the following to your mcp.json:

{
  "servers": {
    "tower": {
      "type": "sse",
      "url": "http://127.0.0.1:34567/sse"
    }
  }
}
Gemini CLI

In your settings.json, add the following:

{
  "mcpServers": {
    "tower": {
        "url": "http://127.0.0.1:34567/sse"
    }
  }
}

About the runtime environment

The tower-runtime crate has the Rust library that makes up the runtime environment itself. All the interfaces are defined in the main crate, and the local package contains the invokation logic for invoking tower packages locally.

To learn more about tower packages, see the tower-package crate.

Contributing

We welcome contributions to the Tower CLI and runtime environment! Please see the CONTRIBUTING.md file for more information.

Code of Conduct

All contributions must abide by our code of conduct. Please see CODE_OF_CONDUCT.md for more information.

Development

Here are a few handy tips and common workflows when developing the Tower CLI.

Getting Started

  1. Install development dependencies:

    uv sync --group dev
    
  2. Set up pre-commit hooks for code formatting:

    uv run --group dev pre-commit install
    

This will automatically run Black formatter on Python files before each commit.

Python SDK development

We use uv for all development. You can spawn a REPL in context using uv very easily. Then you can import tower and you're off to the races!

uv run python

To run tests:

uv sync --locked --all-extras --dev
uv run pytest tests

Code Formatting

We use Black for Python code formatting. The pre-commit hooks will automatically format your code, but you can also run it manually:

# Format all Python files in the project
uv run --group dev black .

# Check formatting without making changes
uv run --group dev black --check .

If you need to get the latest OpenAPI SDK, you can run ./scripts/generate-python-api-client.sh.

Testing

We use pytest to run tests. Copy pytest.ini.template to pytest.ini and replace the values of environment variables

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tower-0.3.33.tar.gz (242.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tower-0.3.33-py3-none-win_arm64.whl (6.5 MB view details)

Uploaded Python 3Windows ARM64

tower-0.3.33-py3-none-win_amd64.whl (6.8 MB view details)

Uploaded Python 3Windows x86-64

tower-0.3.33-py3-none-musllinux_1_2_x86_64.whl (7.1 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

tower-0.3.33-py3-none-musllinux_1_2_i686.whl (7.5 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

tower-0.3.33-py3-none-musllinux_1_2_aarch64.whl (6.5 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

tower-0.3.33-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

tower-0.3.33-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (6.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

tower-0.3.33-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

tower-0.3.33-py3-none-macosx_11_0_arm64.whl (6.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

tower-0.3.33-py3-none-macosx_10_12_x86_64.whl (6.8 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

tower-0.3.33-py3-none-linux_armv6l.whl (6.9 MB view details)

Uploaded Python 3

File details

Details for the file tower-0.3.33.tar.gz.

File metadata

  • Download URL: tower-0.3.33.tar.gz
  • Upload date:
  • Size: 242.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.7

File hashes

Hashes for tower-0.3.33.tar.gz
Algorithm Hash digest
SHA256 3938dab9327ec76f6a3a36befabf59ee9d08d45e5160d37e26adea6f31987ecb
MD5 57f5ea3aaf448cfd5a1e9ce00e02eb4f
BLAKE2b-256 84a947d613cdc4ca2a9bbc98d9f0d5d0ee9bb918244d242c546510b4decd98a4

See more details on using hashes here.

File details

Details for the file tower-0.3.33-py3-none-win_arm64.whl.

File metadata

  • Download URL: tower-0.3.33-py3-none-win_arm64.whl
  • Upload date:
  • Size: 6.5 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.7

File hashes

Hashes for tower-0.3.33-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 386455cb2658407d20b777babd02b582cfff732e5ca0bfb61f4c07d7741ea784
MD5 d36b9d2861401ce9a56089b3e1a41580
BLAKE2b-256 18c4430977d268ff36c111d94d64f3cd0875d433d98fcf6f8ae18fac55edaa9f

See more details on using hashes here.

File details

Details for the file tower-0.3.33-py3-none-win_amd64.whl.

File metadata

  • Download URL: tower-0.3.33-py3-none-win_amd64.whl
  • Upload date:
  • Size: 6.8 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.7

File hashes

Hashes for tower-0.3.33-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ab6cc99e5805e81395e695ede9d4351f71cd159fb0c3554b0e5c7a31f01bd1d5
MD5 eb05f63555d7651f8f670b35c7d453a9
BLAKE2b-256 78b7d5bf9521836baa6c7f70f6121737673ae486d5b66270a76053a50727eaae

See more details on using hashes here.

File details

Details for the file tower-0.3.33-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tower-0.3.33-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d616b907581815e7429ad1368433c40b59786b5adaf7da47c9f3855536eb3ba5
MD5 24664b7eaa51d4ec9aa8032acc4b1319
BLAKE2b-256 cd972e50d71324ee7e211cd308f38b8b94895e01135bd81ad97953490ea2d877

See more details on using hashes here.

File details

Details for the file tower-0.3.33-py3-none-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for tower-0.3.33-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 ec7b7b0be08edee9f1bde8d2cb96c1d9f96d44c37c639ddadd363dd9bdb75ad6
MD5 ae2d5c2f77c3f4aec8d174bf472fe2ae
BLAKE2b-256 612a694c45011abc6fdfc7398312f50f8d308b82e8c366b53a1c2324618f52db

See more details on using hashes here.

File details

Details for the file tower-0.3.33-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tower-0.3.33-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 f21da8010d5331980489c53eafbeffc5fb055b2567c4f103f7e95953f769cd4f
MD5 08beed23a0226c80368c2ac707df3fa4
BLAKE2b-256 49244d171e9a80dd0245f3c12372b93569e6bd23c519e99a7870afe36b5d5628

See more details on using hashes here.

File details

Details for the file tower-0.3.33-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tower-0.3.33-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2e651fecd397135c7dc3cae25e283df86e5a76593219ca9d54057080180e6a05
MD5 b1ad04ee491f982dd3d425d07b95631c
BLAKE2b-256 79b882223f8db7eb7b90708bee6a42c3f60be015416001c806042a49f95f75e7

See more details on using hashes here.

File details

Details for the file tower-0.3.33-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for tower-0.3.33-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 2ac7c75e48ef1e21f87ebe80846a476de2e83b0130475c24969e9fc455c00b9a
MD5 f8bd2fd83e97903774cd450fe63b4eb1
BLAKE2b-256 782110aa97fbee3ea1851c3f5af8313a09e6934985a7519f404eb70a378426f6

See more details on using hashes here.

File details

Details for the file tower-0.3.33-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tower-0.3.33-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 891d706c1c9dc18eee5951dc7de9c4f1bcb9ea0a808fcd41e7f1c6ce6db3e608
MD5 1bcd1ae58f51774ff1654762969ddf08
BLAKE2b-256 987a222569596807201d053b46462765e1898f7b683eca8945dce03310761da9

See more details on using hashes here.

File details

Details for the file tower-0.3.33-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tower-0.3.33-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c7bce73c4280095af43ed28fad660bb81ea6dcc43a0894af8b28f0deb9405f34
MD5 f07e941b261eca4eb558c45c94a8750f
BLAKE2b-256 8497e06a72b667c9fd9b81f1c9f8ba460410088457ed3c74656e1661bf9a364a

See more details on using hashes here.

File details

Details for the file tower-0.3.33-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tower-0.3.33-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b43ee47eca2116954afd73f0b91295a112f695c8e66ff326354d0a463ec39850
MD5 55921bc8eb8a1b1dde321f681dace4ce
BLAKE2b-256 df3bacf019337047c5b9135e3bc23d42866eb3ab26d68dfd4c84aab9a5fb3443

See more details on using hashes here.

File details

Details for the file tower-0.3.33-py3-none-linux_armv6l.whl.

File metadata

File hashes

Hashes for tower-0.3.33-py3-none-linux_armv6l.whl
Algorithm Hash digest
SHA256 b099ba69ba958581b4e55cac5d687070adddd9e5af783ff24237d2959c6c81d8
MD5 51e17b50de8ca92aaee828f39ace7a98
BLAKE2b-256 2d79a87e3b7a661b9fd92ed18043bb6a419f01e7d24072ff576ad2df0cc7f960

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page