Skip to main content

CLI for the Treadstone sandbox service.

Project description

Treadstone CLI

Command-line interface for the Treadstone sandbox service.

Installation

From PyPI

pip install treadstone

Pre-built binary

Download the latest release from GitHub Releases. The binary is self-contained and does not require Python.

# macOS / Linux
chmod +x treadstone
sudo mv treadstone /usr/local/bin/

Quick start

# Check that the server is reachable
treadstone health

# Register an account (first time only)
treadstone auth register

# Log in
treadstone auth login

# Create an API key for non-interactive use
treadstone api-keys create --name my-key
# Save the key — it is shown only once

# Store the key in config so you don't have to pass it every time
treadstone config set api_key ts_live_xxxxxxxxxxxx

# Create a sandbox
treadstone sandboxes create --template default --name my-sandbox

# List sandboxes
treadstone sb list

Configuration

The CLI reads configuration from three sources, in order of priority:

Priority Source Example
1 (highest) CLI flags --base-url https://... --api-key ts_...
2 Environment variables TREADSTONE_BASE_URL, TREADSTONE_API_KEY
3 (lowest) Config file ~/.config/treadstone/config.toml

Config file

Location: ~/.config/treadstone/config.toml

[default]
base_url = "https://your-server.example.com"
api_key  = "ts_live_xxxxxxxxxxxx"

You can manage this file with the config subcommand:

# Set a value
treadstone config set base_url https://your-server.example.com
treadstone config set api_key ts_live_xxxxxxxxxxxx

# View current settings (api_key is partially masked)
treadstone config get

# View a single key
treadstone config get base_url

# Remove a value
treadstone config unset api_key

# Show config file path
treadstone config path

Environment variables

Variable Description Default
TREADSTONE_BASE_URL Base URL of the Treadstone server https://api.treadstone-ai.dev
TREADSTONE_API_KEY API key for authentication (none)

Global flags

Flag Description
--base-url URL Override the server URL
--api-key KEY Override the API key
--json Output responses as JSON (useful for scripting)
--version Show CLI version
--help Show help message

Commands

health

Check if the server is reachable and healthy.

treadstone health
# Server is healthy

auth

Authentication and user management.

treadstone auth register                 # Create a new account
treadstone auth login                    # Log in interactively
treadstone auth logout                   # Log out
treadstone auth whoami                   # Show current user info
treadstone auth change-password          # Change your password
treadstone auth invite --email user@example.com   # Invite a user (admin)
treadstone auth users                    # List all users (admin)
treadstone auth delete-user <user-id>    # Delete a user (admin)

sandboxes (alias: sb)

Create and manage sandboxes.

treadstone sb create --template default --name my-box
treadstone sb create --template python --label env:dev --persist
treadstone sb list
treadstone sb list --label env:prod --limit 10
treadstone sb get <sandbox-id>
treadstone sb start <sandbox-id>
treadstone sb stop <sandbox-id>
treadstone sb delete <sandbox-id>
treadstone sb token <sandbox-id>                    # Get an access token
treadstone sb token <sandbox-id> --expires-in 7200  # Custom TTL

templates

List available sandbox templates.

treadstone templates list

api-keys

Manage long-lived API keys.

treadstone api-keys create --name ci-bot
treadstone api-keys create --name temp --expires-in 86400  # 24h
treadstone api-keys list
treadstone api-keys delete <key-id>

config

Manage local CLI configuration.

treadstone config set base_url https://...
treadstone config set api_key ts_...
treadstone config get
treadstone config get base_url
treadstone config unset api_key
treadstone config path

JSON output

Pass --json before any command to get machine-readable JSON output:

treadstone --json sb list
treadstone --json health
treadstone --json api-keys list

Error handling

The CLI displays user-friendly error messages instead of stack traces:

Error: Connection refused.
  Possible causes:
    - The Treadstone server is not running
    - The --base-url or TREADSTONE_BASE_URL is incorrect
    - A firewall or proxy is blocking the connection
  Detail: ...

Common errors:

Error Cause Fix
Connection refused Server not running or wrong URL Check treadstone config get base_url
Request timed out Server slow or unreachable Retry, or check network
No API key configured Missing authentication treadstone config set api_key <key>
HTTP 401 Invalid or expired API key Create a new key with treadstone api-keys create
HTTP 404 Resource not found Verify the ID is correct

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

treadstone_cli-0.2.1.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

treadstone_cli-0.2.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file treadstone_cli-0.2.1.tar.gz.

File metadata

  • Download URL: treadstone_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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

Hashes for treadstone_cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0274457f77ce4ed0f7dd372249fec6eca9430ccf9a5182aa96a563c3d72155ee
MD5 869581c1c761fa4f09f47d2b6f71db6e
BLAKE2b-256 3153ede4531ab7481c96655bc133cfeb0221dde2830bbe380ab79f76e662be22

See more details on using hashes here.

File details

Details for the file treadstone_cli-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: treadstone_cli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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

Hashes for treadstone_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 934e40bd813814290cc53abb660cdb1819bd9d498e8226d8df39a855841cea6b
MD5 0b8b540bcc78c0c53d5abc8293021fd2
BLAKE2b-256 b3c53897de0cbb03a601cbea789a0ef02fa9c8440f8828a166d8eecc8611e35e

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