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

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.dev202611182005

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

Total release size: 333.0 MB

Release files / codebuddy_agent_sdk-0.3.304.dev202611182005-py3-none-musllinux_1_1_aarch64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611182005-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
de46c78f5ad502bec9e603dc59197b766aa5c78f8ac2945628bd086888a3eccd
BLAKE2b-256 checksum
How to use checksums
c52f9e43e3db4a70d92af2f0fb8dad6cf787a9f58e3d2825ef844802e02111cb
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.dev202611182005-py3-none-manylinux_2_17_x86_64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611182005-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
1b001cd8c79ee8b806fc67720488e30370c1e01bb4e336529c317e2f52ff3de0
BLAKE2b-256 checksum
How to use checksums
1bb05465d975cd58f966207279ed61b5a033910bbf70c3caf3485f7d7dd97143
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.dev202611182005-py3-none-manylinux_2_17_aarch64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611182005-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
e0f9b2b85ee5e6f4f2ae69fd617b816d48fcd8ad49ff8a02d5479483256bbca5
BLAKE2b-256 checksum
How to use checksums
d559c55e1d255ffe7a0ac132e8a572d038f1d321e70beacf31e5af794ad1b48f
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.dev202611182005-py3-none-macosx_11_0_arm64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611182005-py3-none-macosx_11_0_arm64.whl
Size 60.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
87221c051556397f378420ad869a60e4eabd6fa7480b4b0e7233aa8f9d559154
BLAKE2b-256 checksum
How to use checksums
8a5b8209a1f3e2442948d31bd566b597809f4e216b4984fb2b8ce93f5719fcf4
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.dev202611182005-py3-none-macosx_10_12_x86_64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611182005-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
8877c190bacd72151d164dfd05d594fa5e8392f1fd26d601e20558f385c02530
BLAKE2b-256 checksum
How to use checksums
054fe856170bfa1f4def346572c8865a8b41dc500b15986996b7c163332acbbf
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.dev202611182005

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