openclaw

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CLI

func CLI(cfg *config.Config, id string, args []string) error

CLI runs an openclaw CLI command against a deployed instance. Commands that support --url/--token are executed locally with a port-forward; others are executed via kubectl exec into the pod.

func Dashboard

func Dashboard(cfg *config.Config, id string, opts DashboardOptions, onReady func(url string)) error

Dashboard port-forwards to the OpenClaw instance and opens the web dashboard. The onReady callback is invoked with the dashboard URL; the CLI layer uses it to open a browser.

func Delete

func Delete(cfg *config.Config, id string, force bool) error

Delete removes an OpenClaw instance

func List

func List(cfg *config.Config) error

List displays installed OpenClaw instances

func ListInstanceIDs

func ListInstanceIDs(cfg *config.Config) ([]string, error)

ListInstanceIDs returns the IDs of all installed OpenClaw instances by reading the deployment directories on disk.

func Onboard

func Onboard(cfg *config.Config, opts OnboardOptions) error

Onboard creates and optionally deploys an OpenClaw instance

func PrintImportSummary

func PrintImportSummary(result *ImportResult)

PrintImportSummary prints a human-readable summary of detected config

func ResolveInstance

func ResolveInstance(cfg *config.Config, args []string) (id string, remaining []string, err error)

ResolveInstance determines which OpenClaw instance to target based on how many instances are installed:

  • 0 instances: returns an error prompting the user to create one
  • 1 instance: auto-selects it, returns args unchanged
  • 2+ instances: expects args[0] to be a known instance name; consumes it from args and returns the rest. Errors if no match.

func Setup

func Setup(cfg *config.Config, id string, _ SetupOptions) error

Setup reconfigures model providers for a deployed OpenClaw instance. It runs the interactive provider prompt, regenerates the overlay values, and syncs via helmfile so the pod picks up the new configuration.

func SetupDefault

func SetupDefault(cfg *config.Config) error

SetupDefault deploys a default OpenClaw instance as part of stack setup. It is idempotent: if a "default" deployment already exists, it re-syncs. When Ollama is not detected on the host and no existing ~/.openclaw config is found, it skips provider setup gracefully so the user can configure later with `obol openclaw setup`.

func SkillAdd

func SkillAdd(cfg *config.Config, id string, args []string) error

SkillAdd adds a skill to a deployed OpenClaw instance by running the native openclaw CLI inside the pod via kubectl exec.

func SkillList

func SkillList(cfg *config.Config, id string) error

SkillList lists skills installed on a deployed OpenClaw instance by running the native openclaw CLI inside the pod via kubectl exec.

func SkillRemove

func SkillRemove(cfg *config.Config, id string, args []string) error

SkillRemove removes a skill from a deployed OpenClaw instance by running the native openclaw CLI inside the pod via kubectl exec.

func SkillsSync

func SkillsSync(cfg *config.Config, id, skillsDir string) error

SkillsSync copies a local skills directory to the host-side PVC path that maps to /data/.openclaw/skills/ inside the OpenClaw container. OpenClaw's file watcher detects changes automatically — no pod restart needed.

func Sync

func Sync(cfg *config.Config, id string) error

Sync deploys or updates an OpenClaw instance

func Token

func Token(cfg *config.Config, id string) error

Token retrieves the gateway token for an OpenClaw instance and prints it.

func TranslateToOverlayYAML

func TranslateToOverlayYAML(result *ImportResult) string

TranslateToOverlayYAML maps imported config fields to chart values YAML fragment. The returned string is appended to the base overlay.

Types

type CloudProviderInfo

type CloudProviderInfo struct {
	Name    string // "anthropic" or "openai"
	APIKey  string
	ModelID string // e.g. "claude-sonnet-4-5-20250929"
	Display string // e.g. "Claude Sonnet 4.5"
}

CloudProviderInfo holds the cloud provider selection from interactive setup. This is used to configure llmspy with the API key separately from the OpenClaw overlay (which routes through llmspy).

type DashboardOptions

type DashboardOptions struct {
	Port      int
	NoBrowser bool
}

DashboardOptions contains options for the dashboard command.

type ImportResult

type ImportResult struct {
	Providers    []ImportedProvider
	AgentModel   string
	Channels     ImportedChannels
	WorkspaceDir string // path to ~/.openclaw/workspace/ if it exists and contains marker files
}

ImportResult holds the parsed configuration from ~/.openclaw/openclaw.json

func DetectExistingConfig

func DetectExistingConfig() (*ImportResult, error)

DetectExistingConfig checks for ~/.openclaw/openclaw.json and parses it. Returns nil (not an error) if the file does not exist.

type ImportedChannels

type ImportedChannels struct {
	Telegram *ImportedTelegram
	Discord  *ImportedDiscord
	Slack    *ImportedSlack
}

ImportedChannels holds detected channel configurations

type ImportedDiscord

type ImportedDiscord struct {
	BotToken string
}

ImportedDiscord holds Discord bot config

type ImportedModel

type ImportedModel struct {
	ID   string
	Name string
}

ImportedModel represents a model entry

type ImportedProvider

type ImportedProvider struct {
	Name         string
	BaseURL      string
	API          string
	APIKey       string // literal only; empty if env-var reference
	APIKeyEnvVar string // env var name for apiKey interpolation (e.g. OLLAMA_API_KEY)
	Models       []ImportedModel
	Disabled     bool // when true, emit only enabled: false (used to override chart defaults)
}

ImportedProvider represents a model provider extracted from openclaw.json

type ImportedSlack

type ImportedSlack struct {
	BotToken string
	AppToken string
}

ImportedSlack holds Slack bot config

type ImportedTelegram

type ImportedTelegram struct {
	BotToken string
}

ImportedTelegram holds Telegram bot config

type OnboardOptions

type OnboardOptions struct {
	ID           string   // Deployment ID (empty = generate petname)
	Force        bool     // Overwrite existing deployment
	Sync         bool     // Also run helmfile sync after install
	Interactive  bool     // true = prompt for provider choice; false = silent defaults
	IsDefault    bool     // true = use fixed ID "default", idempotent on re-run
	OllamaModels []string // Available Ollama models detected on host (nil = not queried)
}

OnboardOptions contains options for the onboard command

type SetupOptions

type SetupOptions struct {
	Port int // kept for backward compat; currently unused
}

SetupOptions contains options for the setup command.

Jump to

Keyboard shortcuts

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