SDK Examples
These examples demonstrate how to use the Kit SDK (pkg/kit) to build agents programmatically in Go.
Examples
Shows core SDK usage: creating a Kit instance, sending prompts, overriding the model, subscribing to events (tool calls, streaming), and session management.
go run ./examples/sdk/basic
A minimal script-friendly wrapper that takes a prompt from the command line and prints the response — useful for piping and automation.
go run ./examples/sdk/scripting "Explain what this repo does"
A background agent that checks Bitcoin and Ethereum prices every 30 minutes and sends desktop notifications via notify-send (dbus). Demonstrates using the SDK for a long-running autonomous task with a single tool.
go run ./examples/sdk/crypto-monitor
# Override the check interval:
CRYPTO_INTERVAL=5m go run ./examples/sdk/crypto-monitor
Getting Started
import kit "github.com/mark3labs/kit/pkg/kit"
host, err := kit.New(ctx, nil) // uses ~/.kit.yml defaults
defer host.Close()
response, err := host.Prompt(ctx, "Hello!")
Or use the functional-options constructor for quick setups (streaming defaults on):
host, err := kit.NewAgent(ctx,
kit.WithModel("anthropic/claude-sonnet-4-5-20250929"),
kit.WithSystemPrompt("You are a helpful assistant."),
kit.Ephemeral(),
)
See the SDK README for the full API reference.