wrap

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package wrap implements `squoze wrap CMD`: run an agent command with its provider base URLs pointed at an in-process squoze proxy. The agent needs zero configuration — env injection is the whole trick.

Index

Constants

This section is empty.

Variables

View Source
var BaseURLEnvs = []string{
	"ANTHROPIC_BASE_URL",
	"OPENAI_BASE_URL",
	"OPENAI_API_BASE",
}

BaseURLEnvs lists the environment variables agents commonly honor for provider endpoints. Setting all of them covers Claude Code, OpenAI SDKs, Codex and most OpenAI-compatible clients.

Functions

func EnvVars

func EnvVars(addr string) []string

EnvVars returns the child-process environment entries pointing at addr.

func Run

func Run(ctx context.Context, opts Options) error

Run starts the proxy, launches the command with injected environment, streams stdio, and waits. Returns the command's exit error (if any).

Types

type Options

type Options struct {
	Command    []string // argv of the agent to run (required)
	Upstream   *url.URL // real provider base URL (required)
	OriginsDir string   // "" = memory-only originals
	ListenAddr string   // default "127.0.0.1:0" (ephemeral)
	Stdin      io.Reader
	Stdout     io.Writer
	Stderr     io.Writer
}

Options configures one wrap session.

Jump to

Keyboard shortcuts

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