opencode-py 0.8.0: Python SDK for the Opencode AI Coding Agent

LinkTool

Version 0.8.0 of opencode-py provides a dedicated Python SDK for Opencode, an open-source AI coding agent. It automates binary downloads, supports sync and async workflows, and features agentic tool execution alongside typed SSE event handling.

Key points

  1. Automated binary management: Automatically fetches required OS binaries (Windows, macOS, Linux on x64/arm64) to ~/.opencode/bin/ if not present on PATH.
  2. Flexible API: Provides a CLI, one-shot convenience methods, context managers, and SSE-based streaming with automatic duplicate and reasoning filtering.
  3. Agentic tooling: Supports tools like bash, write, edit, read, glob, and grep, complete with sandboxing and fine-grained permissions via ToolExecutor.
  4. Type-safe events and resilience: Exposes typed Pydantic models for stream events and implements exponential backoff retries across a clear exception hierarchy.

Why it matters

The SDK removes friction when embedding Opencode into Python projects, abstracting away process management and server lifecycle details while supporting safe tool execution.

Analysis

opencode-py balances beginner usability with low-level developer control. High-level helpers handle quick scripts and multi-turn chats, while low-level client classes expose the complete underlying REST and SSE APIs, structured output schemas, and custom permission handling suitable for automated agent pipelines.

Found in

Summary generated by AI (Gemini 3.8 Flash, 27 September 2026). It may contain errors – the original source is authoritative.

Similar in content, found by the AI search.

  • Link:Anomaly

    OpenCode: Open-source AI coding agent

    OpenCode is an open-source AI coding agent running across terminals, IDEs, and desktop environments, offering integration with over 75 model providers.

    AI & LLMs· Tool

  • Repository:anomalyco/opencode

    OpenCode: Open-Source AI Coding Agent

    OpenCode is an open-source AI coding agent available via a terminal interface and a standalone desktop application. Built with TypeScript, the project provides a free alternative to proprietary AI programming assistants.

    204.4kstarsTypeScript

    AI & LLMs· Tool

  • Repository:github/spec-kit

    Spec Kit: Open-Source Toolkit for Spec-Driven Development with AI Agents

    GitHub's Spec Kit is an open-source framework designed for Spec-Driven Development (SDD). It helps software teams define requirements clearly before implementation, guiding AI coding agents through structured workflows.

    133.6kstarsPython

    AI & LLMs· Tool

  • Repository:openai/codex

    OpenAI Codex CLI: Local Terminal Coding Agent Built in Rust

    Codex CLI is an open-source, lightweight coding agent developed by OpenAI that runs locally in your terminal. Written in Rust, it connects directly to ChatGPT plans or standard API keys.

    121.7kstarsRust

    AI & LLMs· Tool

Let's talk about your project

Locations

  • Mattersburg
    Johann Nepomuk Bergerstraße 7/2/14
    7210 Mattersburg, Austria
  • Vienna
    Ungargasse 64-66/3/404
    1030 Wien, Austria

Parts of this content were created with the assistance of AI.