sdk

command
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Command sdk-example is a minimal demonstration of embedding the pig coding agent as a Go library via the public `coding` package.

What it does:

  1. Constructs a coding.Services dependency container pointed at a temporary working directory.
  2. Builds a coding.Runtime over that container (no extensions, no custom tools).
  3. Creates a fresh coding.Session and sends a single user prompt.
  4. Prints the assistant's reply.

Prerequisites:

  • You must have authed at least once with the standalone pig binary so a valid auth.json exists at $PIG_HOME/agent/auth.json (or ~/.pig/agent/auth.json on macOS/Linux).
  • The model "github-copilot/gpt-4o-mini" must be available in your environment. Adjust the modelID const below to use a different provider/model combo.

Run from the repo root:

go run ./examples/sdk

Library consumers writing their own integrations can use this program as a starting template. See coding/doc.go for the full public API reference.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL