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

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ i686

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

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

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

Uploaded Python 3macOS 10.12+ x86-64

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tower-0.3.35.tar.gz
  • Upload date:
  • Size: 241.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"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.35.tar.gz
Algorithm Hash digest
SHA256 3d8677d60d56bb1385fcb14311fdf05aef2a1c1ca99edd612e545a418ffe051b
MD5 6cdaf99d7af35a1038134b8b20035539
BLAKE2b-256 cf4b1976adedd1776bcd45c03aa3a8c3fce7a25e5f78ed0550ace4308cf76d47

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.35-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.10 {"installer":{"name":"uv","version":"0.9.10"},"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.35-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 2240928b850fa7adf1fa079d753b535a9a1cb00fbe927b041cc09c874f451339
MD5 74a0483b8d41cb581948331c56872fe0
BLAKE2b-256 e24eb861fc912970a92eb44ad78024f093a46e175c19e236e8f019c8e9e733d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.35-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.10 {"installer":{"name":"uv","version":"0.9.10"},"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.35-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 e5216fc1d32d39d3850497c6b5c7e911d37735208a20c79cb9a08c0643bc78da
MD5 8805b3c4895314ce12a9e26036bac5c4
BLAKE2b-256 0a0516682115ed337dcfb912f33c05c854c0002ccb550c842d34ced34f39d491

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.35-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.10 {"installer":{"name":"uv","version":"0.9.10"},"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.35-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5dce2fa013b945be929a6d5360232b4a8d356162389848ed45cf7c7a74584186
MD5 4fb5d1191319d88cafa0b1d0eb75a01f
BLAKE2b-256 c91e59254ad0215c87de2a49c43d32fc7f0997d29291d1d21da8882c4923d40d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.35-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.10 {"installer":{"name":"uv","version":"0.9.10"},"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.35-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 b47d6e83cd1ec1c76d64fa748f1adc8700ebe3880445c378fc6bef75941f206e
MD5 20e046d2c1980e4caef2e60b69d70410
BLAKE2b-256 78274fd4c161e8d596faadf715ad348424efabb1e1b45c8041186a2bb9cf9107

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.35-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.10 {"installer":{"name":"uv","version":"0.9.10"},"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.35-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 77c54091ce197ab40140acca7b4ee6f5bec14d2f409c785966b5009923fd27ca
MD5 f624c2415dc8361d973161d3a464fe97
BLAKE2b-256 19c1759e0b907d38ea8069d4be3c04cd7aae51943b22b5c7722b9c7234f1b845

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.35-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.10 {"installer":{"name":"uv","version":"0.9.10"},"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.35-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 876b45f71b9724c8a4afbe45e7c471e75e46051bfb2535ba8cedc83684eea364
MD5 c7fd3bf77ded6b54c76a5517ab7ac570
BLAKE2b-256 607d7ceb6cd07cfc6927348ddd18a5e6466c750c1de82d67419bf63030a82374

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.35-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.10 {"installer":{"name":"uv","version":"0.9.10"},"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.35-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 ac7e1c4f92a00bf5067ce520a887a6bee66ce33955eed1dff20548d6bc3ec92a
MD5 95f3a4e628e842179bb3c7850dd617f2
BLAKE2b-256 834d76239b7e9eac9380d700b78da8039720d21bf330c6d855506bb43a912dfa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.35-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.10 {"installer":{"name":"uv","version":"0.9.10"},"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.35-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 82d498ac3ab8eb95070f11e66d56ce4de98330668050fc23d33d8b764effdc43
MD5 b6ec47267c1b1156591e9ddf42d11715
BLAKE2b-256 57e1209d5f66558a9507ae217b2c8e6f08cd8a4881dacca616db1d533e9bf2bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.35-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.10 {"installer":{"name":"uv","version":"0.9.10"},"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.35-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ee7313e7f7a9a0db3f2dcf168559fbd5d14aa62736e16398cd515df325e22554
MD5 d87f821e64946e2c4bad2a61aab71f59
BLAKE2b-256 f95f844c0ea30e8cbd4f21ad40ab7e864a6f529f36983cef04a30d3170ee94e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.35-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.10 {"installer":{"name":"uv","version":"0.9.10"},"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.35-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3c030f2e52ba495cd738ddbec9b3cfdb3516cedf448a075ca3acb0cc40f4e58e
MD5 48f548214796ebc1ab7fdafd3b069cb4
BLAKE2b-256 b2b6f2c435d5634474b0e97a8a056f4ae2abd75f4f00657227fc55737ef74f7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.35-py3-none-linux_armv6l.whl
  • Upload date:
  • Size: 7.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"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.35-py3-none-linux_armv6l.whl
Algorithm Hash digest
SHA256 c3cef3361a37fa3724b4e9fa9a95ce56a0ed69208ed8f2c923149f7283f15df3
MD5 81fbd75715b4f7519f2f917a28379566
BLAKE2b-256 bf89734fe28c497b3f1146cdb3b6d55bc3e795b927b6ef75105a6fd896fa7200

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