opencode

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package opencode implements the OpenCode usage provider.

Auth: Usage Buttons Helper extension with the user's opencode.ai browser session. Endpoints: POST/GET https://opencode.ai/_server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WorkspaceID

func WorkspaceID(ctx context.Context, envName string) (string, error)

WorkspaceID returns an override or discovers the first OpenCode workspace.

Types

type Provider

type Provider struct{}

Provider fetches OpenCode usage data.

func (Provider) BrandBg

func (Provider) BrandBg() string

BrandBg returns the background color used on button faces.

func (Provider) BrandColor

func (Provider) BrandColor() string

BrandColor returns the accent color used on button faces.

func (Provider) Fetch

Fetch returns the latest OpenCode usage snapshot.

func (Provider) ID

func (Provider) ID() string

ID returns the provider identifier used by the registry.

func (Provider) MetricIDs

func (Provider) MetricIDs() []string

MetricIDs enumerates the metrics this provider can emit.

func (Provider) Name

func (Provider) Name() string

Name returns the human-readable provider name.

Jump to

Keyboard shortcuts

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