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

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

Total release size: 475.1 MB

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

Download URL codebuddy_agent_sdk-0.3.304.dev202611181617-py3-none-win_amd64.whl
Size 74.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b1a0803a6ac0c7cd04447a9cb78b929d770e5f4ff7224ea9135876fe3cc76faf
BLAKE2b-256 checksum
How to use checksums
47a8b36034905e320880bfd4b1ed766f6e325f980ce96658bf0aa83779a94514
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.dev202611181617-py3-none-musllinux_1_1_x86_64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181617-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
76270a5c878e04b861530e93233a99aefa57fa42565d0fac2475ac6399b7191f
BLAKE2b-256 checksum
How to use checksums
0bf403e2a781e18651b99b6bce064de9e32a0acbd1870b269c591b0e0dffcb54
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.dev202611181617-py3-none-musllinux_1_1_aarch64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181617-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
1b19901af46e692d5fa01793bb5c0c03396ee93a7c24df2e2d83e9632f003b24
BLAKE2b-256 checksum
How to use checksums
1f9342127a21b1ad33ac0e92015806d30bb19699fca05a1dcfe748b782cfb20e
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.dev202611181617-py3-none-manylinux_2_17_x86_64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181617-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
f2b1667412e17641d843ac7aee0d7810f0dd774c538f03b87d0da1a83192af27
BLAKE2b-256 checksum
How to use checksums
fa63a832f333c477641892d0d4fa2098c1338c521dc85c9f17f56e678a128cb3
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.dev202611181617-py3-none-manylinux_2_17_aarch64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181617-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
86c5837d8bb30c47677ea339268c582f4c4c8cf4c90d2d8f7eb2cd1ca72d4594
BLAKE2b-256 checksum
How to use checksums
7b62a16eaccb43f95038de79affa90b57d185a9eea91d5332f1c586bfd072987
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.dev202611181617-py3-none-macosx_11_0_arm64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181617-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
ff1c996692a5ebc7507f7b31a9bf40c24896d9c336318c0096f5e9f9c6f690e4
BLAKE2b-256 checksum
How to use checksums
37a530b4ceb6dd512b560f01a79f54c64d7a79ccb7e1f2b486ca2584155ba4cf
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.dev202611181617-py3-none-macosx_10_12_x86_64.whl

Download URL codebuddy_agent_sdk-0.3.304.dev202611181617-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
33679a497bd92addbeaf3bf4bb530494d4d4ca076de468acee15784c2aecfc8d
BLAKE2b-256 checksum
How to use checksums
bccb4330974cb6f55b0d35df9ab0d3a89d7417026023449d4c5e51b83ad9ae4c
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.dev202611181617

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