Ona Python SDK
The public Python SDK exposes stable workflows from ona_sdk. For lower-level access, generated protobuf modules are available under gitpod.* and generated Connect service clients are available from client.services.
Install the package with pip install gitpod-sdk.
Run a Codex task in a repository with one call:
from gitpod.v1 import agent_pb2
from ona_sdk import create_client_from_env
ona = create_client_from_env()
run = ona.run_codex(
repository_url="https://github.com/gitpod-io/template-golang-cli",
task="Inspect the repository and improve its README.",
model=agent_pb2.CODEX_OPEN_AI_MODEL_GPT_5_6_SOL,
reasoning_effort=agent_pb2.CODEX_REASONING_EFFORT_HIGH,
)
for chunk in run.message_stream():
print(chunk, end="")
result = run.watch_result()
run.delete_environment(force=True)
Omit repository_url for an empty scratch workspace. The message stream is live-only, and the caller must explicitly stop or delete the created environment.
from ona_sdk import create_client_from_env
ona = create_client_from_env()
env = ona.environments().create("https://github.com/gitpod-io/template-golang-cli")
result = env.run_command(
command="pwd && git status --short",
working_directory=env.workspace_dir(),
)
print(result.stdout)
create_client_from_env() reads ONA_API_KEY and falls back to GITPOD_API_KEY. If both are set, ONA_API_KEY takes precedence. It uses https://app.ona.com/api by default and accepts ONA_BASE_URL for a custom management-plane domain, local development, or replay verification. Use create_client(api_key=..., base_url=...) to pass values explicitly.
Use client.services when an operation is not covered by a high-level workflow:
from gitpod.v1.environment_pb2 import ListEnvironmentsRequest
from ona_sdk import create_client_from_env
client = create_client_from_env()
response = client.services.environment.list_environments(
ListEnvironmentsRequest(),
)
The generated clients include every RPC in the public protobuf API and inherit the SDK's authentication, base URL, user agent, and default timeout. Direct calls raise connectrpc.errors.ConnectError; high-level workflows continue to raise the SDK error types documented below.
Pass new_debug_logger() to the client to get human-readable SDK debug logs. The formatter uses ANSI colors by default and honors NO_COLOR; pass no_color=True when writing plain logs.
The SDK is structured as:
create_client*creates an SDK client for production Connect API calls.client.servicesprovides typed, direct access to public API services.client.environments()returns environment workflows.client.run_codex()creates a workspace and starts an initial Codex task in one call.environments.create/get/list/start/stop/deletemanages environments.Environment.run_command/read_file/write_file/git_changesperforms environment ops.Environment.start_codexstarts Codex in that environment.AgentSession.send_message/message_stream/watch_resultinteracts with the agent execution.
Runnable examples live in examples/.
High-level workflows and direct API access use the official Connect Python runtime and generated clients. Supervisor environment-ops calls use a small private Connect transport because generated supervisor service clients are not available. The package does not ship generated gRPC clients.
Release files for gitpod-sdk 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gitpod_sdk-1.2.0.tar.gz | 359.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gitpod_sdk-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 761.6 kB
Release files / gitpod_sdk-1.2.0.tar.gz
| Download URL | gitpod_sdk-1.2.0.tar.gz |
|---|---|
| Size | 359.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aad61f296d51d3a502b7cb68a96a6701018b601a66c228bfa64128ba0f4cd427
|
|
BLAKE2b-256 checksum How to use checksums |
2cba58359ff5c81ccc7f30dac52daa63a2abe6e84930ee51f6e659f940b75b58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.
Transparency logRelease files / gitpod_sdk-1.2.0-py3-none-any.whl
| Download URL | gitpod_sdk-1.2.0-py3-none-any.whl |
|---|---|
| Size | 402.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2110627cde400ced2685b5740c5ebc86b7711a3ae3f075c0e89c9907297e8b59
|
|
BLAKE2b-256 checksum How to use checksums |
d7636efd0ea00625b621167d35ea5848dc186a31bb4fef768095187d211db9b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.
Transparency log