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.39.tar.gz (251.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.39-py3-none-win_arm64.whl (6.9 MB view details)

Uploaded Python 3Windows ARM64

tower-0.3.39-py3-none-win_amd64.whl (7.3 MB view details)

Uploaded Python 3Windows x86-64

tower-0.3.39-py3-none-musllinux_1_2_x86_64.whl (7.4 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

tower-0.3.39-py3-none-musllinux_1_2_i686.whl (7.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

tower-0.3.39-py3-none-musllinux_1_2_aarch64.whl (6.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

tower-0.3.39-py3-none-manylinux_2_24_x86_64.whl (7.3 MB view details)

Uploaded Python 3manylinux: glibc 2.24+ x86-64

tower-0.3.39-py3-none-manylinux_2_24_armv7l.whl (7.2 MB view details)

Uploaded Python 3manylinux: glibc 2.24+ ARMv7l

tower-0.3.39-py3-none-manylinux_2_24_aarch64.whl (7.0 MB view details)

Uploaded Python 3manylinux: glibc 2.24+ ARM64

tower-0.3.39-py3-none-macosx_11_0_arm64.whl (6.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

tower-0.3.39-py3-none-macosx_10_12_x86_64.whl (7.1 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

tower-0.3.39-py3-none-linux_armv6l.whl (7.3 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tower-0.3.39.tar.gz
  • Upload date:
  • Size: 251.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"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.39.tar.gz
Algorithm Hash digest
SHA256 1bed2421382f88ccfe624d47d2022950e483cb3a1d55752107e10f9af142ec49
MD5 65438a1e20d900230d217081f255dbb9
BLAKE2b-256 50102a19a5612beb6edd9e101f62594a73695f7037407672a1d2b8850237e504

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.39-py3-none-win_arm64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"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.39-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 7f0e6e6267b7fbe5731fc241b62ad91324e41ab9f8f853544aa180e26cbe8b63
MD5 e24c7832bff4c0c02837689ed1782cf7
BLAKE2b-256 b81668df2ddd38bdee91bb3ba8205aeef1757e16373dd3687ae15b063f0412c2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.39-py3-none-win_amd64.whl
  • Upload date:
  • Size: 7.3 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"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.39-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1f170e3803b7358745f0490b72d4989bc73f7cce61600292a4b3292c1a666d05
MD5 66e57613298b249e3429ebbe90e5b1a3
BLAKE2b-256 9a20415b90824336cd9b0f5abc94bf60dfa11b2166dc3b769b44690c7ab038e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.39-py3-none-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 7.4 MB
  • Tags: Python 3, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"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.39-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 488c8560c823d4bb59dbb3a964f48dfc9679795f7fdcc6d8bf763e4c350a4e25
MD5 afdeaffdfccfe13f1e08ac08369992bf
BLAKE2b-256 04431cb5b272fedd442d17ea0da47c293ac6105143bdc464d315fef8d6123105

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.39-py3-none-musllinux_1_2_i686.whl
  • Upload date:
  • Size: 7.9 MB
  • Tags: Python 3, musllinux: musl 1.2+ i686
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"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.39-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 02fa5bac1e1fccb4720201fa28613af69a3f4c432a2500e18269f2d28316fbf8
MD5 3b3ec90e717c5da44ebeb0049ce93a8e
BLAKE2b-256 84160a62d5404cfb9ea187692f0af2314166b1de7d4ccf10c94d04f7c5707b08

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.39-py3-none-musllinux_1_2_aarch64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: Python 3, musllinux: musl 1.2+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"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.39-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 4a97d47890d78f05939184dd22bc47debdbe650f0746a69a8ad2f855660589d2
MD5 db84e2e38f1aaa3dc4dc953afcdb3ea5
BLAKE2b-256 4515b38707c066c77b82c0a3ae3446cf11d05aab2ffcedf0748c301d77f46464

See more details on using hashes here.

File details

Details for the file tower-0.3.39-py3-none-manylinux_2_24_x86_64.whl.

File metadata

  • Download URL: tower-0.3.39-py3-none-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 7.3 MB
  • Tags: Python 3, manylinux: glibc 2.24+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"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.39-py3-none-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 17ba4ee849f9742f1776cd53ecbba3f2d509231d398b3f42d978c6ec9142b092
MD5 0ba331a8bd34753d55dc6cac3474a9d8
BLAKE2b-256 c351d218ccffa1a0795332f1d99a0332c34e49c344e18ff6d3eef56b66590b1b

See more details on using hashes here.

File details

Details for the file tower-0.3.39-py3-none-manylinux_2_24_armv7l.whl.

File metadata

  • Download URL: tower-0.3.39-py3-none-manylinux_2_24_armv7l.whl
  • Upload date:
  • Size: 7.2 MB
  • Tags: Python 3, manylinux: glibc 2.24+ ARMv7l
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"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.39-py3-none-manylinux_2_24_armv7l.whl
Algorithm Hash digest
SHA256 2bfbb6fb524438be6fd1b265e19b18b842347b037a930256dd09cf6a916910e4
MD5 b48ac72ecb8bd66d481889e442f68a5b
BLAKE2b-256 963e2bf0307f9f653abb2f4698790bfd5df9e9f6cf77b5de053f6c857d466159

See more details on using hashes here.

File details

Details for the file tower-0.3.39-py3-none-manylinux_2_24_aarch64.whl.

File metadata

  • Download URL: tower-0.3.39-py3-none-manylinux_2_24_aarch64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: Python 3, manylinux: glibc 2.24+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"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.39-py3-none-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 5991679d154bc7096ceb874a8c63064272edd2f6323286963441ec26f3eda4b0
MD5 7a676a11dabd8644ed8022a906c4f52b
BLAKE2b-256 7d215d38af1a603ef2b2cda71e9f3c67ad04998e0555ad2698191f89acef28d3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.39-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"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.39-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 181ecf3b829a8cd6f79b36b4b3ac339eb0c839eb932ffe9b0c49c332f9068e67
MD5 beee48093c83be490b67af9005ec66f3
BLAKE2b-256 a3e9ec610c44ad5543345cf606acfaa68ebe5d7cada1fe47e29329d2ce0b2731

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.39-py3-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 7.1 MB
  • Tags: Python 3, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"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.39-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 367d9ac00c12f7faa0a2d39f358291ee4a4b20a78d521422da89a01c2f29ada7
MD5 09dd04d1c31f50f38c57cf73928d7fce
BLAKE2b-256 a5b90aedd648c426f5f71bea97894381eaba5904dfec58c14d58fc6b3a0a39ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.39-py3-none-linux_armv6l.whl
  • Upload date:
  • Size: 7.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"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.39-py3-none-linux_armv6l.whl
Algorithm Hash digest
SHA256 ad55a898ab04a214ce1cb550560bd8325634e2c333fb014fdc9c94fc9a01acfe
MD5 1e53a56eda07564835feb92beab7a859
BLAKE2b-256 2c39d8349e32650859dcc7b8993d44d6a54db38899821429211013723a26f7bd

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