Skip to main content

runtime-sdk

Python SDK and CLI for Runtime.

Install

Supported host OS for scriptable CLI commands: Windows, macOS, and Linux.

The interactive dashboard ships in native wheels for Windows ARM64/x64, macOS 13+ ARM64/x64, and 64-bit Linux with glibc 2.17+. Other supported environments receive the universal wheel with the complete scriptable CLI but without the OpenTUI dashboard.

uv tool install runtime-sdk

To upgrade an existing install:

uv tool upgrade runtime-sdk

Configure

The CLI talks to https://api.runruntime.dev by default.

For local or self-hosted Runtime, override it with:

export RUNTIME_BASE_URL=http://127.0.0.1:8080

Or pass --base-url per command.

Usage

# Auth
runtime                          # open the interactive dashboard; sign in first if needed
runtime login                    # WorkOS device login; opens the verification page
runtime login --no-open          # print the URL and code for a browserless host
runtime whoami
runtime logout
runtime login --api-key sk_...   # explicit headless credential mode
# Or set RUNTIME_API_KEY for one process without saving it.
runtime api-keys list
runtime api-keys create "my laptop"
runtime api-keys revoke key_01...
runtime integrate github
runtime github list
runtime github disconnect acme

# Computers
runtime switch --repo owner/repo feature/login      # open or create the branch workspace computer
runtime switch -c feature/login --repo owner/repo   # create a new branch workspace from the repo default branch
runtime checkout --repo owner/repo feature/login    # alias for switch
runtime create                       # creates a computer with the starter app already published
runtime create myapp --command "python3 app.py" --cwd /home/runtime --port 3000
runtime create locked --network allowlist --allow-host api.example.com
runtime enter <name-or-id>         # open an interactive shell; accepts slug/name or computer id
runtime enter <name-or-id> -- claude   # open a real TTY and run an interactive command
runtime enter <name-or-id> -- python   # use enter for REPLs, agents, prompts, and full-screen apps
runtime ssh <name-or-id>           # open SSH through Runtime's authenticated tunnel
runtime ssh <name-or-id> -- uptime # run a command with the local ssh client
runtime list                    # open the computer dashboard in a terminal
runtime list --json             # one JSON response for scripts and agents
runtime list --json --watch 2   # newline-delimited JSON updates
runtime info <id>
runtime share public <id>
runtime share private <id>
runtime start <id>
runtime run <id> "echo hello"      # one-shot foreground command only
runtime run <id> "apt install -y nodejs" --uid 0
runtime exec <id> -- bash -lc 'for i in 1 2 3; do echo $i; sleep 1; done'
printf 'hello' | runtime exec <id> --stdin -- cat
# Use runtime exec for automation and exact exit codes; use runtime enter -- <cmd> for interactive TTY commands.
runtime files ls <id> /home/runtime
runtime files read <id> /home/runtime/app.py --output app.py
runtime files write <id> /home/runtime/app.py --input app.py --mode 0644
runtime files mkdir <id> /home/runtime/data --parents
runtime files upload <id> ./local-app /home/runtime/app
runtime files download <id> /home/runtime/app ./downloaded-app
runtime files rm <id> /home/runtime/data --recursive
runtime startup show <id>
runtime startup set <id> --command "python3 app.py" --cwd /home/runtime --port 3000
runtime startup clear <id>          # low-level durable service config
runtime service show <id>           # user-facing alias for the durable published app
runtime service clear <id>
runtime publish <id> 3000 -- python3 app.py
runtime delete <id>

# Network policy
runtime network default show
runtime network default allowlist api.example.com '*.github.com'
runtime network show <id>
runtime network denials <id>
runtime network set <id> none
runtime network set <id> open

# Inside a running computer, the helper installed by Runtime can manage the
# durable app without leaving the sandbox:
#   runtime-env publish 3000 -- python3 app.py
#   runtime-env service show
#   runtime-env service clear

Private public URLs authenticate the browser before forwarding traffic. Apps behind a private URL receive trusted X-Runtime-Account-ID, X-Runtime-User-ID, and X-Runtime-User-Email headers. Runtime strips client-supplied versions of those headers from both public and private traffic; public URLs receive no Runtime identity headers.

Python

from runtime_sdk import RuntimeClient

client = RuntimeClient(base_url="https://api.runruntime.dev", credential="sk_...")

# Create a computer. New computers start with the starter app already published.
computer = client.create_computer()
print(computer["public_url"])  # https://goldbird.runruntime.dev

# Or create one with an explicit durable app command.
# That saved service is replayed after cold restore / start.
app = client.create_computer(
    slug="myapp",
    command="python3 app.py",
    cwd="/home/runtime",
    port=3000,
)

# Account defaults are copied only to computers created later.
client.set_default_network("allowlist", ["api.example.com"])
restricted = client.create_computer()
client.set_computer_network(restricted["id"], "none")

# Run a command
result = client.run_command(computer["id"], "echo hello")
print(result["stdout"])

client.write_file(computer["id"], "/home/runtime/hello.txt", b"hello\n")
print(client.read_file(computer["id"], "/home/runtime/hello.txt"))
print(client.list_files(computer["id"], "/home/runtime"))

# Wake a cold computer explicitly
client.start_computer(app["id"])

# Promote the running app on a local port to the durable public app.
# Runtime inspects the listening process and saves its command + cwd when possible.
client.publish_port(computer["id"], 3000)

# List, info, delete
computers = client.list_computers()
info = client.get_computer(computer["id"])
client.delete_computer(computer["id"])

Development

For fast local backend iteration:

make local-backend

For deploying and testing against the Hetzner production server:

make sync SERVER_IP=x.x.x.x SSH_USER=root
make smoke

Use make deploy instead of make sync when migrations, env files, Caddy, or systemd units changed.

Cold restore and explicit runtime start replay the saved published app command. New computers seed that durable app from the starter workspace. Later, runtime publish <id> <port> -- <command...> replaces the durable app command and starts it. Inside a running computer, runtime-env publish <port> -- <command...> does the same thing using a computer-scoped token installed by Runtime. runtime service show|clear and runtime-env service show|clear expose that same durable app state directly. The low-level runtime startup ... commands still map to the same durable state. A one-off runtime run stays one-shot: the filesystem is restored after going cold, but that ad-hoc process is not.

GitHub branch workspaces

runtime switch gives a repo branch its own Runtime computer so you can jump between parallel tasks without local worktrees.

runtime integrate github
runtime github list
runtime switch --repo owner/repo feature/login
runtime switch -c feature/search --repo owner/repo --from main

Rules:

  • GitHub must already be connected with runtime integrate github.
  • Run runtime integrate github again when you want to add another personal account or org.
  • New GitHub connects require user authorization during installation and GITHUB_APP_CLIENT_ID / GITHUB_APP_CLIENT_SECRET on the Runtime API. In GitHub App settings, enable user authorization during installation and set the callback URL to https://api.runruntime.dev/github/callback.
  • runtime switch opens an existing branch workspace, or creates the computer if the branch exists but the workspace does not yet.
  • runtime switch -c creates a new branch first, then opens that branch's workspace.
  • Each repo + branch maps to one dedicated computer.
  • The repo is cloned into /home/runtime/<repo> and new shells in that computer start there automatically.
  • runtime checkout ... is an alias for runtime switch ....

Run the SDK unit tests through the backend project environment:

uv run python -m unittest discover -s scripts/tests -p 'test_*.py'

Release

Set and commit the release version first:

cd backend
uv version <next-version>

Merge the release version to main, then run the Runtime SDK workflow with the exact committed version. The workflow tests the Python CLI and OpenTUI, builds all platform wheels, runs the installed Windows wheels against production, and only then publishes those same artifacts to PyPI.

VERSION="$(uv version --short)"
gh workflow run runtime-sdk.yml --ref main -f version="${VERSION}" -f publish=true

Preview the runner commands without building:

./scripts/release_runtime_sdk.sh --dry-run

RUNTIME_WINDOWS_SMOKE_API_KEY is the production smoke credential; UV_PUBLISH_TOKEN is used only by the publish job after every wheel and the Windows production smoke pass. The build script never publishes, changes the source version, or loads a local .env file.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

runtime_sdk-0.4.57-py3-none-win_arm64.whl (38.3 MB view details)

Uploaded Python 3Windows ARM64

runtime_sdk-0.4.57-py3-none-win_amd64.whl (39.7 MB view details)

Uploaded Python 3Windows x86-64

runtime_sdk-0.4.57-py3-none-manylinux_2_17_x86_64.whl (43.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

runtime_sdk-0.4.57-py3-none-manylinux_2_17_aarch64.whl (43.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

runtime_sdk-0.4.57-py3-none-macosx_13_0_x86_64.whl (28.2 MB view details)

Uploaded Python 3macOS 13.0+ x86-64

runtime_sdk-0.4.57-py3-none-macosx_13_0_arm64.whl (25.7 MB view details)

Uploaded Python 3macOS 13.0+ ARM64

runtime_sdk-0.4.57-py3-none-any.whl (61.3 kB view details)

Uploaded Python 3

File details

Details for the file runtime_sdk-0.4.57-py3-none-win_arm64.whl.

File metadata

  • Download URL: runtime_sdk-0.4.57-py3-none-win_arm64.whl
  • Upload date:
  • Size: 38.3 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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 runtime_sdk-0.4.57-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 d5c0ebcb310427f6b01ca68c5745b1d8f29cf7d2ed04500cc64a4981b6e9ba54
MD5 6d9683cd8108109c8cb58580248f22e3
BLAKE2b-256 21605e1749a97526b984b469f15845fd0fdcc7b7aa0d3b1b6c713a0e5fecc2ae

See more details on using hashes here.

File details

Details for the file runtime_sdk-0.4.57-py3-none-win_amd64.whl.

File metadata

  • Download URL: runtime_sdk-0.4.57-py3-none-win_amd64.whl
  • Upload date:
  • Size: 39.7 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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 runtime_sdk-0.4.57-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 be8fa7c5f63012567c4edd489810e627d969aa0760dccb298d4d1896b90f3976
MD5 c71ee99795d6861c84543d918dd6762d
BLAKE2b-256 e877b783d77da4225f7ff47439abdd08e4bfc3b834f603cd7827dc65624b8a76

See more details on using hashes here.

File details

Details for the file runtime_sdk-0.4.57-py3-none-manylinux_2_17_x86_64.whl.

File metadata

  • Download URL: runtime_sdk-0.4.57-py3-none-manylinux_2_17_x86_64.whl
  • Upload date:
  • Size: 43.6 MB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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 runtime_sdk-0.4.57-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d1f9de6baea965ff90296df1f38f734ff455a66cb224a789a488e55d9df03d82
MD5 963b92f130059d12bc11b627ce304fc7
BLAKE2b-256 f3127d416c7a8e6fcde300d147ab9e97cffb5839c19174ee2231b34e2631b825

See more details on using hashes here.

File details

Details for the file runtime_sdk-0.4.57-py3-none-manylinux_2_17_aarch64.whl.

File metadata

  • Download URL: runtime_sdk-0.4.57-py3-none-manylinux_2_17_aarch64.whl
  • Upload date:
  • Size: 43.6 MB
  • Tags: Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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 runtime_sdk-0.4.57-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 120ee16db5c49c72027cbf467c808e6a3038e8893d6d27fd295e77521b9bb809
MD5 39ea92e75f049ee9ea8d153703467ed3
BLAKE2b-256 ef1265f55f80b7a8e535a9ce69bb4bbe9f4ea3f9354554a3d7025b307fc308bc

See more details on using hashes here.

File details

Details for the file runtime_sdk-0.4.57-py3-none-macosx_13_0_x86_64.whl.

File metadata

  • Download URL: runtime_sdk-0.4.57-py3-none-macosx_13_0_x86_64.whl
  • Upload date:
  • Size: 28.2 MB
  • Tags: Python 3, macOS 13.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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 runtime_sdk-0.4.57-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a5a9a5f799c257abadf560d23f03d48b36f0a798bcca923c49293b773fce8d7a
MD5 04f68921d2de2f327ddc1fb0029a1ed5
BLAKE2b-256 1f7cd326a80e48d633b63d51d26daf0b8e5c1c53dbc92930fee7c5a2b1f1551a

See more details on using hashes here.

File details

Details for the file runtime_sdk-0.4.57-py3-none-macosx_13_0_arm64.whl.

File metadata

  • Download URL: runtime_sdk-0.4.57-py3-none-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 25.7 MB
  • Tags: Python 3, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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 runtime_sdk-0.4.57-py3-none-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 6303a4555c35dc9932eeed33e7c223badacb50369db8e782dc0a11f4cbc7e2f7
MD5 bf42bfdba474229e5237497e83dec576
BLAKE2b-256 29743a561c007325d0afde75cd73dbfa1bb9c78dddfb3dedb354055a11ccbc2e

See more details on using hashes here.

File details

Details for the file runtime_sdk-0.4.57-py3-none-any.whl.

File metadata

  • Download URL: runtime_sdk-0.4.57-py3-none-any.whl
  • Upload date:
  • Size: 61.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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 runtime_sdk-0.4.57-py3-none-any.whl
Algorithm Hash digest
SHA256 e3e4db586e61c5e97a246f1b051f3aaf38968dcdd121b03af3cd1e15eba5622d
MD5 e5fb2605b056988a2fe52502b447325e
BLAKE2b-256 65e62e4249627b04a43fd36253e3cdb6026b0f7ab172cf665dd36eff16cf510f

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