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

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ i686

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

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

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

Uploaded Python 3macOS 10.12+ x86-64

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tower-0.3.36.tar.gz
  • Upload date:
  • Size: 241.7 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.36.tar.gz
Algorithm Hash digest
SHA256 5ff129a30b80a50e8f7e03e41d9a14ba6990f29b6bbcdda061b34c40c3270d98
MD5 d7467f8a62c2d9cef761891f151bab4a
BLAKE2b-256 d9524c56bd7d340881bae04ea0adb1fd933ab5e82403f73e30d1ad1053960599

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.36-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.36-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 edbc399ccf145f6db56abef17b77a93bf83cd345b70c0124347ab6c36fdafc53
MD5 7b0f411f4531b1029c50ae8510c25edf
BLAKE2b-256 124eb558768e92b00d2f191fbb3ee498eaebb4f32c27d999f57c453eeb4c6956

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.36-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.36-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9fa0acd69c19d9c65ae10796e7d5a801eb9d568741c4dab2f1a8b10124f8ef07
MD5 1848878335b13b2ba110133b400d3e77
BLAKE2b-256 3d53589341e6133370dc833c718502a711583e4d22c1479172fd751b40a44091

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.36-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.36-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 18a1caf872caba0c2e2e74dec0e98a66e59e145b489656b0bb5268775abbb205
MD5 6bad5dea045fef5e661840e0581d9313
BLAKE2b-256 2ea6557d5deb8186a49e0180e5224a6685447350f8103ff38affe1dd5d812557

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.36-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.36-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 bcd90a6cf95f783d93f51a010cb3291ed46f5d07ae2700ab7cf7179dbea53541
MD5 08f6367a97253fd9797e4c68e72a7ee7
BLAKE2b-256 9a5b2162d5d74cda2588eb6b523d6dd7c1b62b086046744abba09203558eaced

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.36-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.36-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a2773b1ddf24893285448455dab2d75d61793635f6556069c86588297defc643
MD5 79d97df62d2cc30530eacddad715bffb
BLAKE2b-256 05a6316f7d5884462164e9779fd3eba136a741f5d69e5181fa41de23a1646498

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.36-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.36-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ec5c038b7b0d5b8d30d9510468e52e50ad5e5369427dfb89f096648fdeddc69a
MD5 c651233d1970e4d06e32aa367956f532
BLAKE2b-256 cc8f06c7b05e3f952020a1662b4d2e6c7c13e8c95fdbbc2263140af67110a5cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.36-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.36-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 5f5a765532eebc047dcbaa4972ae35961ce03e20b808e577bfadfca6c16f1a40
MD5 f04798bc87dbb042839b9c78161f60c9
BLAKE2b-256 325f112dddff0aadb311d320fed567f98e94710fd8840b20c828f6a89200be3b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.36-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.36-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 513aefe9d1ce7e5e8ebda0ea3906516fe777271cf6080eccfbc91470a8941ed4
MD5 c9f89b4a45f8f77f6013c96f79c4bbf3
BLAKE2b-256 7b230bbe3585fda79bc5a10a3e813c3c6fa1d388cc52ca7bdd1557d50e6f13eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.36-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.36-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ad2e089884134b8355c9a0ff52faa23c2568d59931440985dd57654a6795914
MD5 b95b2a50bf199191c29029c10607aa08
BLAKE2b-256 da8aeee8082a7d27500685647de3dfcf9c7c0c7502bddf2eb8c2aacbc1aa58fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.36-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.36-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2449320cede7962895a113c4e998a10a8c42f1123e58728cf8fcf11eaeb1e0cb
MD5 f2ff464e501d62622184274d826101b5
BLAKE2b-256 65cef06612ad5e5fe2dfe18da6eae6795831216859ce1687e054c4ed0e36b31b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.36-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.36-py3-none-linux_armv6l.whl
Algorithm Hash digest
SHA256 ea35e4e16dec3df7b56f533ce38db8bb1dc64fb253abcf5124715fcc857242c8
MD5 335bc6f1adfb40fb13728edb54e87886
BLAKE2b-256 df455dec45c9ab4af119be3fd5ec31732113da5509f620b02dcde672cad02dfc

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