opencode

package
v0.14.4-dev.53 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoginMethods = []base.LoginMethod{
	{ID: "openai", Label: "ChatGPT Plus/Pro"},
	{ID: "github-copilot", Label: "GitHub Copilot"},
}

LoginMethods are the subscriptions OpenCode signs in to with a browser link. The first login method each offers is its browser sign-in, so the method menu is answered with Enter.

Functions

func Account added in v0.14.1

func Account(ctx context.Context) base.Account

Account lists the providers OpenCode holds credentials for: v2 reports them as JSON, v1 keeps them as the keys of its auth.json.

func AttributionData added in v0.9.0

func AttributionData(seed []byte) ([]byte, error)

func Capability

func Capability() map[string]string

Capability describes validated OpenCode observation support for this revision.

func CredentialFile added in v0.14.1

func CredentialFile() string

CredentialFile is OpenCode's provider sign-ins, shared with other machines by the gateway.

func Login added in v0.14.1

func Login(method string) (base.LoginFlow, error)

Login runs `opencode auth login` for one provider. OpenAI redirects to localhost, so the landed-on address is pasted (and replayed on the machine); Copilot is a device code for GitHub.com. Anthropic is absent: OpenCode 1.19 takes only an API key for it.

func MergeLSP

func MergeLSP(path string, servers map[string]json.RawMessage) error

func MergeLSPData added in v0.9.0

func MergeLSPData(seed []byte, servers map[string]json.RawMessage) ([]byte, []string, []string, error)

func MergeMCP

func MergeMCP(path string, entries mcp.Entries) error

func MergeMCPData added in v0.9.0

func MergeMCPData(data []byte, entries mcp.Entries) ([]byte, []string, []string, error)

func NativeConfigFingerprint added in v0.9.6

func NativeConfigFingerprint(project, workspace string) (string, error)

NativeConfigFingerprint includes substitutions that can change server names without changing the containing config file.

func NativeUserConfigRoots added in v0.9.6

func NativeUserConfigRoots() ([]string, error)

NativeUserConfigRoots lists the user directories the selected runtime reads.

func New

func New() base.Harness

func ProbeConfigDir

func ProbeConfigDir(ctx context.Context, configDir, workspace, sourceID, lockDigest, mode string, expected ...string) (environment.Receipt, error)

ProbeConfigDir samples which file OpenCode resolves for each packaged skill name in a session started in the checkout. expected names the packaged skills of the plan.

func ReadLimits added in v0.10.0

func ReadLimits(ctx context.Context) base.LimitSnapshot

ReadLimits reads OpenCode's usage-limit operation from the signed-in local server. It only reads usage and sends no inference turns.

func Support

func Support(event hooks.Event, handler hooks.Handler) hooks.Support

Types

type HookRenderer

type HookRenderer struct{}

func (HookRenderer) Render

func (HookRenderer) Render(bundle hooks.Bundle, context hooks.RenderContext) (hooks.RenderOutput, error)

func (HookRenderer) Target

func (HookRenderer) Target() harness.Target

Jump to

Keyboard shortcuts

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