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.34.tar.gz (241.3 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.34-py3-none-win_arm64.whl (6.8 MB view details)

Uploaded Python 3Windows ARM64

tower-0.3.34-py3-none-win_amd64.whl (7.2 MB view details)

Uploaded Python 3Windows x86-64

tower-0.3.34-py3-none-musllinux_1_2_x86_64.whl (7.3 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

tower-0.3.34-py3-none-musllinux_1_2_i686.whl (7.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

tower-0.3.34-py3-none-musllinux_1_2_aarch64.whl (6.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

tower-0.3.34-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

tower-0.3.34-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (7.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

tower-0.3.34-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

tower-0.3.34-py3-none-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

tower-0.3.34-py3-none-macosx_10_12_x86_64.whl (7.0 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

tower-0.3.34-py3-none-linux_armv6l.whl (7.2 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tower-0.3.34.tar.gz
  • Upload date:
  • Size: 241.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tower-0.3.34.tar.gz
Algorithm Hash digest
SHA256 d2084a6be45a8152cc77bb444aea027046c435f0125a1205163d3267d0bdf437
MD5 bf58dea09e08c809cd8211dc0e02e0d0
BLAKE2b-256 0e7c533bd9e412ac72301076c29afee94c2d97f504cb1442a8d6fa2c7bac36c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.34-py3-none-win_arm64.whl
  • Upload date:
  • Size: 6.8 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tower-0.3.34-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 a68af2f1b270cfe51ebad5b2356d8c4c46c9b1340b1fcb8518c0e45619ce2a02
MD5 1d76879943f46948f2bcd87c3294f4e7
BLAKE2b-256 2351accb3a37f57666fc017d0d9371b05569729db0852a30734600b798d84aff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.34-py3-none-win_amd64.whl
  • Upload date:
  • Size: 7.2 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tower-0.3.34-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4547cafe34d7972f34f4bf07e95dc3b79db7eab0ca0f0fdf27d292f55ef7c488
MD5 e8bdfe3b51acc4ff9745ff753c7a21a9
BLAKE2b-256 6155e96a69cbb52b2ee2dc1d6ee2185f4bfcaad3c7911f4d1723ffb4c98d14c4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.34-py3-none-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 7.3 MB
  • Tags: Python 3, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tower-0.3.34-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 08c9fc42a701c207cb75a3e7d511a080458bad816ba1d9894eece56bc1ed4b0c
MD5 31fb746134150cd12f85d141e391abae
BLAKE2b-256 2fd564850b6e143e0f7afa861c261aa281adb0487861ac9a507ddbf1187c2a36

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.34-py3-none-musllinux_1_2_i686.whl
  • Upload date:
  • Size: 7.7 MB
  • Tags: Python 3, musllinux: musl 1.2+ i686
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tower-0.3.34-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 8720470905a2833b37c2c8912f42a0f155db2ef1885476d552fe9e6e8cafc313
MD5 17a2f38cb67f9ef9861c61dbcf599d02
BLAKE2b-256 080a58dc2aebda997d914d87a0f9f512a433b60c450faf88a59fc3165d1f810b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.34-py3-none-musllinux_1_2_aarch64.whl
  • Upload date:
  • Size: 6.8 MB
  • Tags: Python 3, musllinux: musl 1.2+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tower-0.3.34-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a87399aad2954e7c9cd4ad6f24e949d8fbe1ec937b199ff988361e6c3b494f63
MD5 b2a2726d8d15b9c7be40b84d5ab142ac
BLAKE2b-256 d92592994f31b96935aeae2eda46be9dcfea41739186fea5f664d28236b44079

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.34-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 7.2 MB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tower-0.3.34-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c53df00e6ed980638a28c08e4a5965163170741ef849c6dcfd1d49ffcbc9ae0f
MD5 cb2aa15843a0e1c16b4bd31595df3d76
BLAKE2b-256 e5c4be6a6eae747eedc98729f5b7bbc57dd71d3ce563275b72753ed93aee9224

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.34-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
  • Upload date:
  • Size: 7.1 MB
  • Tags: Python 3, manylinux: glibc 2.17+ ARMv7l
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tower-0.3.34-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 2e3e42e9dbbe12cba8a658464cb324c2dd8de749696d73040081b78d8ebd6cb1
MD5 e1fcb0f22ebbc99ab0546c704687bf66
BLAKE2b-256 0b1ba480c44c8bafd7dfb2aa6e04e4b3105e19b26abde2480e15759998514b06

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.34-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tower-0.3.34-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 11a05a8347f3c938b33743b7c2e61eb9280199f47fae153ff95de842a4d5594d
MD5 f9fb71476e882de36d0a4100e1db3a6b
BLAKE2b-256 6cc8474409dfa98fa6020c6f13de0eaabfa81d8ee2c52610413737b2ec27268e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.34-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 6.8 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tower-0.3.34-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f2dfa60d35d49a2c1e3fdcd373e89ab3174a55e55651cd0156a4c5e97574f543
MD5 bbfdcf0dcf153acb19a8a64f51a8aa5a
BLAKE2b-256 511cbabd6572586e50e979dadabe982b0e38d2dfc2f0b40dc02d1f3c75117212

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.34-py3-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: Python 3, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tower-0.3.34-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1be1c2ea865aa3f132f1fca4ea3f167852da0466dfd107627afa67cc6bafb6fa
MD5 236470866ac2eff13dc0ae697b3616e5
BLAKE2b-256 fe970d167c1cc9656033168ed5458280fa353929fe0e5a62e81405148a9f72dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.34-py3-none-linux_armv6l.whl
  • Upload date:
  • Size: 7.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tower-0.3.34-py3-none-linux_armv6l.whl
Algorithm Hash digest
SHA256 36a41589cb024308fdb4b274bec481557144d6f2fd7409238ab7593452469032
MD5 68f8e1ccbb3768054189fd84c99878ac
BLAKE2b-256 316ea05a70babed4e740d5b5f0d32662965c8ed8d0110b667210fcdc106cca49

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