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.304.dev202611181959

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.304.dev202611181959
File Actions
codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-win_amd64.whl
codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-musllinux_1_1_x86_64.whl Python 3 none Linux musl 1.1+ x86-64 Details for codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-musllinux_1_1_x86_64.whl
codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-musllinux_1_1_aarch64.whl Python 3 none Linux musl 1.1+ ARM64 Details for codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-musllinux_1_1_aarch64.whl
codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-manylinux_2_17_x86_64.whl
codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-manylinux_2_17_aarch64.whl
codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-macosx_11_0_arm64.whl
codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-macosx_10_12_x86_64.whl

Total release size: 475.1 MB

Release files / codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-win_amd64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-win_amd64.whl
Size 74.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
9d1f4d51d7ea06a546737c0fca3cde9b98808f30d5ff188aa5216ec5f6b71e89
BLAKE2b-256 checksum
How to use checksums
e991f865f9178ff35489869d079cedf8ae9636ffe91da37cf88219aa3907626e
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.304.dev202611181959-py3-none-musllinux_1_1_x86_64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-musllinux_1_1_x86_64.whl
Size 67.3 MB
Tags Linux musl 1.1+ x86-64 Python 3
SHA-256 checksum
How to use checksums
b485bf14a1210fd53fd70addff14293be7e4c55313fad707e519ba16befef212
BLAKE2b-256 checksum
How to use checksums
ffd0477aaf202dc7663d22ea0dea2fc8faec15900c3f1ff3ded660ac5bc6ceee
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.304.dev202611181959-py3-none-musllinux_1_1_aarch64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-musllinux_1_1_aarch64.whl
Size 66.9 MB
Tags Linux musl 1.1+ ARM64 Python 3
SHA-256 checksum
How to use checksums
f957079f9a001a872ba102e47ac4dbe6c506873a483c1e23e41179b273fe286d
BLAKE2b-256 checksum
How to use checksums
c1d499c9401b658abc73c91f4c865f4b586891ff53a9f99f6f9d9f82b2cc6269
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.304.dev202611181959-py3-none-manylinux_2_17_x86_64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-manylinux_2_17_x86_64.whl
Size 70.9 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
7f3e4ba42ad52e6a21cc74b1dc7d7be789ee51172d1b19498316a9f86da03f43
BLAKE2b-256 checksum
How to use checksums
448b3dc22e1497c52c193d8e3e4a337ef633ef4f97783db89ac877af2fcd490e
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.304.dev202611181959-py3-none-manylinux_2_17_aarch64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-manylinux_2_17_aarch64.whl
Size 70.7 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
6a9acf745e094c87f5cb796e4d8035debd3be8acf5186ee388b9801e09e70ecd
BLAKE2b-256 checksum
How to use checksums
0ec3f8b55baef1c354b7470d5ed09d4cabed5b24ef58613bfb0448adf8227e8e
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.304.dev202611181959-py3-none-macosx_11_0_arm64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-macosx_11_0_arm64.whl
Size 61.0 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6098c0805b14bce8c880121b6c507694f2f777faf04cce48c25815bd26526177
BLAKE2b-256 checksum
How to use checksums
95eb718fe37cc321e5673df0da0debb555312ac66a065891273ec0467cbad29a
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.304.dev202611181959-py3-none-macosx_10_12_x86_64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181959-py3-none-macosx_10_12_x86_64.whl
Size 63.6 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ba733d4ba26166baa7d2ae993fc566eb7452228bf062f03c31690d0451b1724a
BLAKE2b-256 checksum
How to use checksums
fedab3e472655a9d249c18c571f8c566f357fa035b5a98652e1680598cc056a1
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.304.dev202611181959

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