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

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.

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

Editor 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 using JSON configuration with SSE:

{
  "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

Add this to your Cursor settings (settings.json):

{
  "mcp.servers": {
    "tower": {
      "url": "http://127.0.0.1:34567/sse",
      "transport": "sse"
    }
  }
}
Windsurf

Configure in Windsurf settings:

{
  "mcp": {
    "servers": {
      "tower": {
        "url": "http://127.0.0.1:34567/sse",
        "transport": "sse"
      }
    }
  }
}
Zed

Add to your Zed settings.json:

{
  "assistant": {
    "mcp_servers": {
      "tower": {
        "url": "http://127.0.0.1:34567/sse",
        "transport": "sse"
      }
    }
  }
}
VS Code

For VS Code with MCP extensions, add to your settings.json:

{
  "mcp.servers": {
    "tower": {
      "url": "http://127.0.0.1:34567/sse",
      "transport": "sse"
    }
  }
}

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.

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.32.tar.gz (237.1 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.32-py3-none-win_arm64.whl (5.9 MB view details)

Uploaded Python 3Windows ARM64

tower-0.3.32-py3-none-win_amd64.whl (6.2 MB view details)

Uploaded Python 3Windows x86-64

tower-0.3.32-py3-none-musllinux_1_2_x86_64.whl (6.6 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

tower-0.3.32-py3-none-musllinux_1_2_i686.whl (6.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

tower-0.3.32-py3-none-musllinux_1_2_aarch64.whl (6.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

tower-0.3.32-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

tower-0.3.32-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (6.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

tower-0.3.32-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

tower-0.3.32-py3-none-macosx_11_0_arm64.whl (6.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

tower-0.3.32-py3-none-macosx_10_12_x86_64.whl (6.2 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

tower-0.3.32-py3-none-linux_armv6l.whl (6.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tower-0.3.32.tar.gz
  • Upload date:
  • Size: 237.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.24

File hashes

Hashes for tower-0.3.32.tar.gz
Algorithm Hash digest
SHA256 48630dd8a33415fa8eeab5484dada738380cc1bcfde3825d2543c26db98352f0
MD5 c3cad26b531157b1914588eb69e89a83
BLAKE2b-256 15989c2df26e66ece996232827b6513d8c51e2013e48c3648cab18ef6f9f0c1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.32-py3-none-win_arm64.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.24

File hashes

Hashes for tower-0.3.32-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 ff44ef5ad4fe49359529860a45af4ad8b6ff6653d56d8435f7540789ffd7a746
MD5 5b4395bfdacf062ca0190213a7dd8269
BLAKE2b-256 9ee51c0a8a91c87eac15132c8073af8b2061cf42093d1ddacdb260b84fd16cb0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.32-py3-none-win_amd64.whl
  • Upload date:
  • Size: 6.2 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.24

File hashes

Hashes for tower-0.3.32-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 798d853e2bc0693f52a0a22d90f23f94d440e2e0cd9f5b14861fb5d82a6daf59
MD5 242f7e2952ab0db4b42ea5a338eb5f77
BLAKE2b-256 2ed0eba4dff9b2f41699f541419562a32f4102050195a1a6f7876c1060176dd8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.32-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ba4ad9faaf1aec2e8b00aea7880a777eabd327a0466f37c23ed8c271cc6cf382
MD5 16e23be99bcbae18c18122f464ed4a04
BLAKE2b-256 3d6a25c2e7c216ca6b3769b9145147b2f50e7f79a227561d9c86573afbf4e661

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.32-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 207300aa1700222db37417c832ce2f26e4ed201ee872ec974bbad168c9ec2277
MD5 0affef6a96707f34c5176b6c75e50fe6
BLAKE2b-256 d32a2cdc1b1f3d94fa338c610bce970d849214386e454f067db67a4e85335f33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.32-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 3a666b8cfdb86d9bb2bd391e227b789b0730e9b4a1d162c307a0376f722703f9
MD5 14db6e67fbdcc04b2b6e35c45c321b4a
BLAKE2b-256 9f019c7cb8e903df79eaa5b8c0c340443558365dbc4c7b35baa3159aef4ce85d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.32-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d161ba9f96a0406b6e1652137b2fc8c74c1bbad0a3202a8a3fdd72b365953884
MD5 28ce3a7c16c384436b46433ba1a54504
BLAKE2b-256 d41f7287f37fe13cb6f8065be5f202b58dd59f24726f1e8ac98daefb552d64aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.32-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 268a0fff3aec14a9aa1ad5bd77273cc7df61424ead07aad5b6569376605344b7
MD5 c9bcd82c5a85b8be7df93957bc7f2a98
BLAKE2b-256 b6382c76d6af9b708f6855c8e0eadfa73c89fb8043e593f38bc0ea0f52d2f26d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.32-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3cfbad22d6d1ca35777a25bcac49dff292c71d11b70091b6eb65b0399647302c
MD5 918960d93b84947a8df8660cae0cf1fc
BLAKE2b-256 193324b9982351ee5f5eee68fff0f3386b06fffc502067bfd5eab0423270f7cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.32-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ac3a96c46afa5b04a654ae1ce5ea98cec8bb95cb9cc66e84a0be37259362c78
MD5 3690c7595499e87e43314172caf6b29a
BLAKE2b-256 78461e0d274bb300443d654a26274d365a03e581d6315926255fb7ddbc8ffc06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.32-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 38ac9ea3b6d48d88aec8dd4c00b55ab81f203b8504443751e84b463b335a2dc9
MD5 f0e46c1df2a449ec087e1dd623a80bf2
BLAKE2b-256 eecd5b387f0aff988908c8a460f2e8cdd1394483229924c6fd2ec6a17a285a75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.32-py3-none-linux_armv6l.whl
Algorithm Hash digest
SHA256 48d50bc8b9ef324ad690372d71ee28bc82b2c9640120ce3cd98e9b35cd2baa4e
MD5 43ab8b26d58ef6b2b8ac9ded5df62809
BLAKE2b-256 950c72f9fcec2f93e867fd2729edc487a7fbd97437d40f858d307eca3135b9f7

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