Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

CodeBuddy Agent SDK for Python

SDK for building AI agents with CodeBuddy Code's capabilities. Programmatically interact with AI to build autonomous agents that can understand codebases, edit files, and execute workflows.

Installation

# Using uv (recommended)
uv add codebuddy-agent-sdk

# Using pip
pip install codebuddy-agent-sdk

Quick Start

import asyncio
from codebuddy_agent_sdk import query

async def main():
    async for message in query(
        prompt="What files are in this directory?",
        permission_mode="bypassPermissions",
    ):
        if message.type == "assistant":
            for block in message.content:
                if hasattr(block, "text"):
                    print(block.text)

asyncio.run(main())

API Reference

query(prompt, **options)

Create a query to interact with the agent.

async for message in query(
    prompt="Your prompt here",
    model="sonnet",                    # Model to use
    permission_mode="bypassPermissions",  # Permission mode
    max_turns=10,                      # Maximum conversation turns
    cwd="/path/to/project",            # Working directory
):
    # Handle message
    pass

Model listing

CodeBuddySDKClient can fetch the model catalog from the CLI:

from codebuddy_agent_sdk import CodeBuddySDKClient, CodeBuddyAgentOptions

async def main():
    async with CodeBuddySDKClient(options=CodeBuddyAgentOptions()) as client:
        # Live catalog (one control request each):
        models = await client.get_available_models()    # [{model_id, name, description}]
        raw = await client.get_available_models_raw()   # full configs (url/apiKey stripped)

        # Snapshot captured during the initialize handshake:
        snapshot = await client.supported_models()      # [ModelInfo(value, display_name, description)]

get_available_models() / get_available_models_raw() work right after connect(); supported_models() is a read-only metadata read (a bare initialize control request) that never touches the session handshake.

Message Types

  • system - Session initialization info
  • assistant - Agent responses (text, tool calls)
  • result - Query completion status
  • task_started / task_notification - Background task lifecycle events (TaskStartedMessage / TaskNotificationMessage, both subclasses of SystemMessage). Emitted when a tool runs a command with run_in_background: true. Concurrent tasks are told apart by task_id.

Background tasks

Background task completion can arrive after the first ResultMessage, so use CodeBuddySDKClient with receive_messages() (which keeps reading) rather than query() / receive_response() (which stop at the first result):

from codebuddy_agent_sdk import (
    CodeBuddySDKClient,
    CodeBuddyAgentOptions,
    TaskStartedMessage,
    TaskNotificationMessage,
)

async def main():
    options = CodeBuddyAgentOptions(permission_mode="bypassPermissions")
    async with CodeBuddySDKClient(options=options) as client:
        await client.query("Run a background command and report when it finishes")
        async for msg in client.receive_messages():
            if isinstance(msg, TaskStartedMessage):
                print("started", msg.task_id, msg.description)
            elif isinstance(msg, TaskNotificationMessage):
                print("done", msg.task_id, msg.status, msg.output_file)

Feedback

Metadata

Release files for codebuddy-agent-sdk 0.3.307.dev202612011932

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for codebuddy-agent-sdk 0.3.307.dev202612011932
File Actions
codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-win_amd64.whl
codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-musllinux_1_1_x86_64.whl Python 3 none Linux musl 1.1+ x86-64 Details for codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-musllinux_1_1_x86_64.whl
codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-musllinux_1_1_aarch64.whl Python 3 none Linux musl 1.1+ ARM64 Details for codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-musllinux_1_1_aarch64.whl
codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-manylinux_2_17_x86_64.whl
codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-manylinux_2_17_aarch64.whl
codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-macosx_11_0_arm64.whl
codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-macosx_10_12_x86_64.whl

Total release size: 488.1 MB

Release files / codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-win_amd64.whl

Download URL codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-win_amd64.whl
Size 76.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
65c6838ebdfea85d45f3205fbdbf546401d43e18ad3ab047b90deb5af8d7de6b
BLAKE2b-256 checksum
How to use checksums
de9f4efed3e52607e68573624307e0b7422dfc4ec45fa7bddf3d936288f6acd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-musllinux_1_1_x86_64.whl

Download URL codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-musllinux_1_1_x86_64.whl
Size 69.2 MB
Tags Linux musl 1.1+ x86-64 Python 3
SHA-256 checksum
How to use checksums
4a1e2987d83862e40e0c6f945ddedc4637e44709915ecb4cb63bc46b3086682f
BLAKE2b-256 checksum
How to use checksums
a8982168a8d7aa372f8660877cea579325739de6e3a61026573a7c27c44232f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-musllinux_1_1_aarch64.whl

Download URL codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-musllinux_1_1_aarch64.whl
Size 68.7 MB
Tags Linux musl 1.1+ ARM64 Python 3
SHA-256 checksum
How to use checksums
b233f636c072d400fb985ab2f0be4a5fc8e777e8ab1c39cca45c2a34aa8cd6d9
BLAKE2b-256 checksum
How to use checksums
69d3d3ccc7fd5ddebefe25eac5074e33ee207373428a30169ae320bb428831d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-manylinux_2_17_x86_64.whl

Download URL codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-manylinux_2_17_x86_64.whl
Size 72.7 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
e63e42b43c6062a47cf58487c83e9e6770a53f6f1626d21f2da215fdf7a2c57f
BLAKE2b-256 checksum
How to use checksums
951d2858bdcb46919a9103d83285ecd3801cec2c9479cf050c009dc47d6b4e10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-manylinux_2_17_aarch64.whl

Download URL codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-manylinux_2_17_aarch64.whl
Size 72.5 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
3ef4b3295fc56097e43fa90b5c25b428fa103ebd0f828a652f468d798b131aa0
BLAKE2b-256 checksum
How to use checksums
6f790594957a0abda6f25725f486a29ae2f6809eb7b7670e4de6d963df2373fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-macosx_11_0_arm64.whl

Download URL codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-macosx_11_0_arm64.whl
Size 62.8 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
449aaaf5258ef3029f6c4de9aa76c611abec3ce26639f9d6fd7e077bc30e72af
BLAKE2b-256 checksum
How to use checksums
3454419a9d6f3bdb5dc22862909155ded7cd79940e67d6778761450c3faca0f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-macosx_10_12_x86_64.whl

Download URL codebuddy_agent_sdk-0.3.307.dev202612011932-py3-none-macosx_10_12_x86_64.whl
Size 65.5 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ab4916abf05a766a2a99a10436d259c4a2a0ee1e95867bd1fb0785623e878086
BLAKE2b-256 checksum
How to use checksums
b3d28504c88409a91618704d7db358092a5ab9b10c0b5772457d763133dc6601
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for codebuddy-agent-sdk 0.3.307.dev202612011932

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page