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 tablestower.load_table: Load data from Iceberg tablestower.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 variablestower.dbt.parse_command_plan(): Parse comma-separated commands into a command plantower.dbt.DbtCommand: Represents a dbt CLI command invocationtower.dbt.DbtRunnerConfig: Low-level configuration classtower.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 accounttower_apps_create- Create a new Tower apptower_apps_show- Show details for a Tower app and its recent runstower_apps_logs- Get logs for a specific Tower app runtower_apps_delete- Delete a Tower apptower_secrets_list- List secrets in your Tower accounttower_secrets_create- Create a new secret in Towertower_secrets_delete- Delete a secret from Towertower_teams_list- List teams you belong totower_teams_switch- Switch context to a different teamtower_deploy- Deploy your app to Tower cloudtower_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
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
-
Install development dependencies:
uv sync --group dev
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tower-0.3.48.tar.gz.
File metadata
- Download URL: tower-0.3.48.tar.gz
- Upload date:
- Size: 268.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
487a174d4cf6843157f2ad01db90186b948b8ec1cac18278025b71686c6a7c29
|
|
| MD5 |
a6f13f055199329f71234f1c7668fd2b
|
|
| BLAKE2b-256 |
bbb6e53056b11fb2fae8e4bd5606a6216387abc6632bc34d138b5efe3df7da98
|
File details
Details for the file tower-0.3.48-py3-none-win_arm64.whl.
File metadata
- Download URL: tower-0.3.48-py3-none-win_arm64.whl
- Upload date:
- Size: 7.1 MB
- Tags: Python 3, Windows ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33627507ec00d707c7842c3da3929688cc8a3d1cf4a02c7423907e4e8c8a666d
|
|
| MD5 |
f55b3988140532d625e076486cd1599c
|
|
| BLAKE2b-256 |
09dd83e575be467976a0d3dc5913c11c548d869e26465539bb3bd778c202b4d8
|
File details
Details for the file tower-0.3.48-py3-none-win_amd64.whl.
File metadata
- Download URL: tower-0.3.48-py3-none-win_amd64.whl
- Upload date:
- Size: 7.5 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c49af9086349037d95481b163508ab5d619a1fb32b316ff4c41b977e2e760e2
|
|
| MD5 |
0fd332a9a1f5d6b3e70e49c3593ac94e
|
|
| BLAKE2b-256 |
18c9fd12e96e4ff1a7a357ca6abaafb83ce2de8062c8d094f5a60be7ac711d09
|
File details
Details for the file tower-0.3.48-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: tower-0.3.48-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 7.7 MB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da4b42c762078df8d8a9f2b49959492bcbfa4f7c2ad0350ab04d168fbd0505ed
|
|
| MD5 |
61746eb2173e54398cf4f551d4b7188a
|
|
| BLAKE2b-256 |
ef2e75d5cda1003da0a971cf9ffc5df3af17c0ba194d6fbedbf0a3c41aae54db
|
File details
Details for the file tower-0.3.48-py3-none-musllinux_1_2_i686.whl.
File metadata
- Download URL: tower-0.3.48-py3-none-musllinux_1_2_i686.whl
- Upload date:
- Size: 8.0 MB
- Tags: Python 3, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04900cd0ff524c37aafd1a64c59faaea06507808f8bbb5ed8acbfc23a5e016f0
|
|
| MD5 |
b4b52fb4076078c70ac6de148d539b93
|
|
| BLAKE2b-256 |
8b97ddd5641d287fd3c20fe028b585256a50d4a02b4b31d015baebde0e604b3e
|
File details
Details for the file tower-0.3.48-py3-none-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: tower-0.3.48-py3-none-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 7.1 MB
- Tags: Python 3, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1d7cffde631106152b8d8ed3eb97dafc888fe7544b0a8b3f9685de4c5abdef1
|
|
| MD5 |
145d0fea7d9d3b84be8fc9bc1852558c
|
|
| BLAKE2b-256 |
4992e15521c07f9c36655f7495a0e40430cd134918c421badd30a1083f40fd1e
|
File details
Details for the file tower-0.3.48-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: tower-0.3.48-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 7.6 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b29ce6b338dd06997f3c6dac52a4b7efeddd789a7949e3850bec8f44b9fab6fb
|
|
| MD5 |
12fd67843f50b61c356f8d2119ea73d5
|
|
| BLAKE2b-256 |
a33e2796b7fc129de94974dcd21e96d0b9ab4d22fbc9a70427c61133c8605d4b
|
File details
Details for the file tower-0.3.48-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: tower-0.3.48-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 7.4 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f64428f74963e6cbe77ce24c4d45d0746d0e8716a936f343ff1e1a046205496
|
|
| MD5 |
b2e810b101456308bacba87bea030d3e
|
|
| BLAKE2b-256 |
6b5fa861062bc453ab68d9023ea5bb52ba039de7f8afe42bb677087670cba879
|
File details
Details for the file tower-0.3.48-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: tower-0.3.48-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 7.3 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aabce731f34da09c8ae5a1002fe59db902f2905ad957372e836ea9b7b9cd586
|
|
| MD5 |
f8e7eb3ccd04e2271cf5aadc54857ec5
|
|
| BLAKE2b-256 |
afebd9724a0064cc54c12f271700f0fbf2604d58038265e067714d956d97fd2f
|
File details
Details for the file tower-0.3.48-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: tower-0.3.48-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 7.1 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2120868671d387b5ee73cff8a843d72e271aa9b4ad72df5e599374b851259ba
|
|
| MD5 |
5eea88430bfe0022be07399b4e2a4672
|
|
| BLAKE2b-256 |
7b4644ec107a01cafdcc0187adc36eb41087efcd7ba1d733732bdf89574a41e9
|
File details
Details for the file tower-0.3.48-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: tower-0.3.48-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 7.3 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4c63cacc573f53abf49120dc77350c63a6b36ff687c5c5de64cb1ec98110c38
|
|
| MD5 |
14ca3fe5e2c149bdcdb55feaa68e5746
|
|
| BLAKE2b-256 |
3bd77a228483732bbc751a78abdef9a04e4fe8e19f06437bc9096842a357ce8e
|
File details
Details for the file tower-0.3.48-py3-none-linux_armv6l.whl.
File metadata
- Download URL: tower-0.3.48-py3-none-linux_armv6l.whl
- Upload date:
- Size: 7.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
704f9838ebe3a24781dcb4e6c553ea125e2f7fcdeba1b5c6684ce645431426b7
|
|
| MD5 |
8f17e8015dcbbaed159b5dd04174892e
|
|
| BLAKE2b-256 |
e6ec704148fd56a68c66bf3bbe0ccb78f220885fdd03cde01444f59aa858dbca
|