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

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

tower-0.3.31-py3-none-musllinux_1_2_x86_64.whl (6.5 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ i686

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

tower-0.3.31-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

Uploaded Python 3macOS 10.12+ x86-64

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tower-0.3.31.tar.gz
Algorithm Hash digest
SHA256 e9434b5e47789c0bd8ad215794833d43a1a16889debaf2d7c16b9bcd1061df34
MD5 a0ddeba9cc4da4aa3d98286dc3c35140
BLAKE2b-256 c4cf0c5745274fff2f8f02ecac1c0c6b682b635e455aabd9bbb4c0fb7e9113fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.31-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.22

File hashes

Hashes for tower-0.3.31-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 b2d650f7af42a4d3c3e01c59c78a1680e52f9eb6be80d7b5a4fceb11df9566bf
MD5 71f849984ae3d5ddf861d8b5f45b2468
BLAKE2b-256 5fc2be2bb5331b737ea6d7af646e2475abf2024df52c2e6f166b69eeaa1d62cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tower-0.3.31-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.22

File hashes

Hashes for tower-0.3.31-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4845eb81aac52c034169987014ec51713d59a207ba0c2c31ba804d83d526d717
MD5 7450651a4970442e79e0655361a95c44
BLAKE2b-256 08cebdf74e02790f34bb4f279bfa508ddd65c284f5e4a8b9a09fbfb7ff17ddb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.31-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 038b8a0ff3bffbc187e46cd24b958cb779daf95b2cf3961c089926d755e27968
MD5 fba89c0b860b43624cce2fbfb950f992
BLAKE2b-256 5dc449e8dce33682c8256702abab8c76754643ab20a1c267c65ddb94050c41a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.31-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 2290c40cea1dde0b767496b2c6b24065a1e049247d4613eebd7c94873c6d8603
MD5 12598d6310250e990f9eb3ff7044f49c
BLAKE2b-256 454b9f57ffe99e969dcf3c7d238575ed1814587b4edebae47927bab87967d5b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.31-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7d1ca649db05eadae116f598fe59a540bb6ff91df93e2ef97628dd913390ac6c
MD5 8a16f0a3845c3819b869eea902ca2cd5
BLAKE2b-256 4152197d2199eaad31beedd8c75c7c817bc73439e2363275ce93900d8c0410fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.31-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e0d33d0996731356686496e3e4f19e5a10bac955d3084078582fcbdf5c9b0bcf
MD5 b35ea8298ac93d61b1cf3bf985bd75ec
BLAKE2b-256 a13c007373271efc91020c726ee4e90885e691f7e36ec28682a48ec6c8df68df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.31-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 161f1c572237790b8aae0bfe7f09c55cac73a8350afa0789fe92158b2f7520ad
MD5 beb7d581603a8c53d90fee051c644b9a
BLAKE2b-256 a5ad7c5e0575fa36f389f524445e59f6d04b04f8e09a57d9181814108f0bddc7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.31-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f1a03a16bf81d3305fe9b4250ed25f51ba179c8814492d1405f219284d148792
MD5 bf917df7ddd95a4d716210ed27a7a8bf
BLAKE2b-256 367bb63bc92a563b50db5de3ba664633146615235df52b5bbae2ed2b10a7913c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.31-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 62bce2bac823f3eb80a29bb83c0b5b5ac8e4fb538cfa2b1e4e790e4e4a2fc644
MD5 df8afb22d91922bb1232488264bc3d6c
BLAKE2b-256 a4f835fb93d02e0b20797195d2f534ab8dcd6caf29f1f8c74aee4e6b04055b1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.31-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ed3a845347474e637bd74101b2ba0bb7f9e61d0f550ab08edb534483b643861d
MD5 b799ebce9103681839c6914e215e96ca
BLAKE2b-256 9eea8e109c2ec2280f46b70a2dda1d146c537e5bd9dceb5caa8c53f6d817a903

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tower-0.3.31-py3-none-linux_armv6l.whl
Algorithm Hash digest
SHA256 47d0999d159905cc10862a8e693a51f21ce47fc1e3e02c29cbe0d4fc9f1f4f6a
MD5 46201742840e835e5c97ecdd3dcae1df
BLAKE2b-256 66253d52bfb313507e4bb67ef275e3358937130ebaf67fa6f159d74c4fb29525

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