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

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ i686

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

tower-0.3.37-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.37-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (7.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

Uploaded Python 3macOS 10.12+ x86-64

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tower-0.3.37.tar.gz
  • Upload date:
  • Size: 241.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"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.37.tar.gz
Algorithm Hash digest
SHA256 586d580ccb1ee06e94efd934e45facdad5ada1b5df0344990b6bd7322e2fa54e
MD5 ac88788226e917beedbb84b95e2e7be2
BLAKE2b-256 4dffdd6e3a81bf32d3fdc3754000af70767d634d59919efed973ed2d62a3f177

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.37-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.13 {"installer":{"name":"uv","version":"0.9.13"},"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.37-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 1c94cb65e236009fbf840e24d89ac04bc52949429710a40bd918fb77aeb2b8cc
MD5 fff4c38b688707232827fb48a3dd3036
BLAKE2b-256 9c4fa58d48309e281fed47e9ed3acaf2cd31a69e055b3b688efb0f6f816c4259

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.37-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.13 {"installer":{"name":"uv","version":"0.9.13"},"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.37-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 92999f07803d5a4a1810e9abcd4f3958039d220a86373e642e2a4b29f29de78b
MD5 fd7ac5d2153f673b7792b3efc018c7f6
BLAKE2b-256 18d0d9284b1925cfd2861fe31b1233b76a0c0f417dcc90d62460b81c7cedfd0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.37-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.13 {"installer":{"name":"uv","version":"0.9.13"},"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.37-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1d66f795fc7892cb2de83963038bb91f91751930db02b0706307219954ec6e29
MD5 7bb6f3b8ee28e5fd04af2c7885001a7a
BLAKE2b-256 e57c61337d82f37d37b9fdbb269ea5e8806c5d6ed90d0c4bbdcad1b6ba59f34f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.37-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.13 {"installer":{"name":"uv","version":"0.9.13"},"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.37-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 373aaa091f6ecc0a8915e751c46b39c45ffa094bed616059716d80c0d5709811
MD5 7c227c767c4cdd75c53955b7dd400c13
BLAKE2b-256 81dd16c9da29d5b55b3482af9313df308f94f5dc1c2a308ff82d76317751fa2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.37-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.13 {"installer":{"name":"uv","version":"0.9.13"},"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.37-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2d32eb878336d9bb010632dc42b6232551d48b68b6a77815c23f9a6f98448d07
MD5 fc6ac1865270fe56de3b0db0a78c3026
BLAKE2b-256 66585e760cd430d0b763f6aa7e8b422c84446a4e37248f41e17810c25d92b31d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.37-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.13 {"installer":{"name":"uv","version":"0.9.13"},"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.37-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3bb0e339b24ae9d03caaf133a135775314d537e5747d72e2847646ffa77c8082
MD5 e4d46788e4593c4f56cf80b6334d67b2
BLAKE2b-256 1865f0be3fa1b6d2aee237e18745719c71a458722ab433d718688fd623a2a4b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.37-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.13 {"installer":{"name":"uv","version":"0.9.13"},"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.37-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 f221cfaee071551b2f73e286e02d743fe94567c87b8c87996696e201ddf38e7c
MD5 4f6c16b554b83cfdc6585e116cfaec12
BLAKE2b-256 cda92f8a4bbccb1867cba56d565411fd2b5739011dfe7e31ef1a66097e831936

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.37-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.13 {"installer":{"name":"uv","version":"0.9.13"},"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.37-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dbc52914905153c01645a7ddb47c5688f79e8ae4d49c64c3c4136a9e4b50605b
MD5 378ac0603b12588482e4758e23026a5b
BLAKE2b-256 470bcab13eef6f73348187317f73c30adbb6b017800938a2c8f8c7c6b75a79de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.37-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.13 {"installer":{"name":"uv","version":"0.9.13"},"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.37-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 60027faa06fe679f0011719b6ae3f3976c740b70d0deaf1ef2dcdef071b6629e
MD5 f2a46237e322d7bb2488b9d0005d1f64
BLAKE2b-256 af9546924f6f5cae18b82ff02adfec3bbf94796ca55c8241254a74a049827986

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.37-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.13 {"installer":{"name":"uv","version":"0.9.13"},"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.37-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2079797e6ff62bc9743e3debaec428c53f069d377181c7eb347bdd316464b086
MD5 6fcb92af693ec3363cc31d1976b10297
BLAKE2b-256 dfbff10bec43028b467bcb60cf1d3511e8d7d9a2b9aebfb64a9e403d7a35dc4b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.37-py3-none-linux_armv6l.whl
  • Upload date:
  • Size: 7.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"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.37-py3-none-linux_armv6l.whl
Algorithm Hash digest
SHA256 60d76270c1017e581a48299d8c4821a068e0b9a19f9482d6cdeb7bd0ea262735
MD5 71b52f3bfa4772b485c175409d53e641
BLAKE2b-256 2560ad5e7d49d27a8ea75efcb76ddc5c1aa3e1751e712663dc34629139f45333

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