Documentation
¶
Index ¶
- func BackupWalletCmd(cfg *config.Config, id string, opts BackupWalletOptions, u *ui.UI) error
- func CLI(cfg *config.Config, id string, args []string, u *ui.UI) error
- func Dashboard(cfg *config.Config, id string, opts DashboardOptions, onReady func(url string), ...) error
- func Delete(cfg *config.Config, id string, force bool, u *ui.UI) error
- func DeploymentPath(cfg *config.Config, id string) string
- func FindInstancesWithWallets(cfg *config.Config) []string
- func ImageRef() string
- func KeystoreVolumePath(cfg *config.Config, id string) string
- func List(cfg *config.Config, u *ui.UI) error
- func ListInstanceIDs(cfg *config.Config) ([]string, error)
- func ListWallets(cfg *config.Config, id string, u *ui.UI) error
- func Onboard(cfg *config.Config, opts OnboardOptions, u *ui.UI) error
- func PrintImportSummary(result *ImportResult)
- func PromptBackupBeforePurge(cfg *config.Config, u *ui.UI)
- func RegenerateToken(cfg *config.Config, id string, u *ui.UI) (string, error)
- func ResolveInstance(cfg *config.Config, args []string) (id string, remaining []string, err error)
- func ResolveInstanceNamespace(cfg *config.Config) (string, error)
- func ResolveWalletAddress(cfg *config.Config) (string, error)
- func RestoreWalletCmd(cfg *config.Config, id string, opts RestoreWalletOptions, u *ui.UI) error
- func Setup(cfg *config.Config, id string, _ SetupOptions, u *ui.UI) error
- func SetupDefault(cfg *config.Config, u *ui.UI) error
- func SkillAdd(cfg *config.Config, id string, args []string, u *ui.UI) error
- func SkillList(cfg *config.Config, id string, u *ui.UI) error
- func SkillRemove(cfg *config.Config, id string, args []string, u *ui.UI) error
- func SkillsSync(cfg *config.Config, id, skillsDir string, u *ui.UI) error
- func Sync(cfg *config.Config, id string, u *ui.UI) error
- func SyncOverlayModels(cfg *config.Config, models []string, u *ui.UI) error
- func Token(cfg *config.Config, id string, u *ui.UI) error
- func TranslateToOverlayYAML(result *ImportResult) string
- func WriteWalletMetadata(deploymentDir string, wallet *WalletInfo) error
- type BackupFile
- type BackupWallet
- type BackupWalletOptions
- type CloudProviderInfo
- type DashboardOptions
- type ImportResult
- type ImportedChannels
- type ImportedDiscord
- type ImportedModel
- type ImportedProvider
- type ImportedSlack
- type ImportedTelegram
- type OnboardOptions
- type RestoreWalletOptions
- type SetupOptions
- type WalletInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackupWalletCmd ¶ added in v0.8.1
BackupWallet creates a backup of the wallet for the given instance.
func CLI ¶
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), u *ui.UI) 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 DeploymentPath ¶ added in v0.8.1
DeploymentPath returns the path to a deployment directory.
func FindInstancesWithWallets ¶ added in v0.8.1
FindInstancesWithWallets returns instance IDs that have wallet metadata.
func ImageRef ¶ added in v0.8.1
func ImageRef() string
ImageRef returns the pinned OpenClaw image reference used by the local binary when it writes overlay values. Empty string means no explicit ref.
func KeystoreVolumePath ¶ added in v0.8.1
KeystoreVolumePath returns the host-side path where the remote-signer's PVC stores keystores. This follows the local-path-provisioner pattern: $DATA_DIR/<namespace>/<pvc-name>/
func ListInstanceIDs ¶
ListInstanceIDs returns the IDs of all installed OpenClaw instances by reading the deployment directories on disk.
func ListWallets ¶ added in v0.8.1
ListWallets displays wallet information for one or all instances.
func PrintImportSummary ¶
func PrintImportSummary(result *ImportResult)
PrintImportSummary prints a human-readable summary of detected config
func PromptBackupBeforePurge ¶ added in v0.8.1
PromptBackupBeforePurge checks for wallets and offers to back them up. Non-interactive (piped/scripted): prints a warning but does not block.
func RegenerateToken ¶ added in v0.8.1
RegenerateToken restarts the OpenClaw pod to generate a new gateway token, then retrieves and returns the new token.
func ResolveInstance ¶
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 ResolveInstanceNamespace ¶ added in v0.8.1
ResolveInstanceNamespace returns the Kubernetes namespace of the single OpenClaw instance. This is needed for port-forwarding to the remote-signer.
func ResolveWalletAddress ¶ added in v0.8.1
ResolveWalletAddress returns the wallet address from the single OpenClaw instance's remote-signer. It follows the same convention as ResolveInstance:
- 0 instances: error
- 1 instance: returns its wallet address
- 2+ instances: error listing available addresses
func RestoreWalletCmd ¶ added in v0.8.1
RestoreWalletCmd restores a wallet from a backup file.
func Setup ¶
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 ¶
SetupDefault deploys the default OpenClaw instance as part of stack setup. This is the single canonical instance that handles both user-facing inference and agent-mode monetize/heartbeat reconciliation. 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 ¶
SkillAdd adds a skill to a deployed OpenClaw instance by running the native openclaw CLI inside the pod via kubectl exec.
func SkillList ¶
SkillList lists skills installed on a deployed OpenClaw instance by running the native openclaw CLI inside the pod via kubectl exec.
func SkillRemove ¶
SkillRemove removes a skill from a deployed OpenClaw instance by running the native openclaw CLI inside the pod via kubectl exec.
func SkillsSync ¶
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 SyncOverlayModels ¶ added in v0.8.1
SyncOverlayModels updates all deployed OpenClaw instances to match the current LiteLLM model list. For each LiteLLM-routed instance it:
- Patches the overlay YAML model list (for helm consistency)
- Writes a clean per-agent models.json to the host PVC
- Patches the openclaw-config ConfigMap with the best primary model
Cloud models are promoted to primary (they're added because they're better than local defaults). The previous primary becomes a fallback.
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.
func WriteWalletMetadata ¶ added in v0.8.1
func WriteWalletMetadata(deploymentDir string, wallet *WalletInfo) error
WriteWalletMetadata writes the wallet address and UUID to a JSON file in the deployment directory for re-sync and display purposes.
Types ¶
type BackupFile ¶ added in v0.8.1
type BackupFile struct {
Version int `json:"version"`
Instance string `json:"instance"`
Wallets []BackupWallet `json:"wallets"`
}
BackupFile is the JSON structure of a wallet backup.
type BackupWallet ¶ added in v0.8.1
type BackupWallet struct {
Address string `json:"address"`
PublicKey string `json:"publicKey"`
KeystoreUUID string `json:"keystoreUUID"`
CreatedAt string `json:"createdAt"`
Keystore json.RawMessage `json:"keystore"`
KeystorePassword string `json:"keystorePassword"`
}
BackupWallet holds a single wallet's backup data.
type BackupWalletOptions ¶ added in v0.8.1
type BackupWalletOptions struct {
Output string // Output file path (empty = auto-generate)
Passphrase string // Encryption passphrase (empty = no encryption)
HasPassFlag bool // Whether --passphrase was explicitly set
}
BackupWalletOptions holds options for the backup command.
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 LiteLLM with the API key separately from the OpenClaw overlay (which routes through LiteLLM).
type DashboardOptions ¶
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 ¶
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 ¶
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
AgentMode bool // true = obol-agent singleton with heartbeat config
OllamaModels []string // Available Ollama models detected on host (nil = not queried)
}
OnboardOptions contains options for the onboard command
type RestoreWalletOptions ¶ added in v0.8.1
type RestoreWalletOptions struct {
Input string // Input file path
Passphrase string // Decryption passphrase
HasPassFlag bool // Whether --passphrase was explicitly set
Force bool // Overwrite existing wallet
}
RestoreWalletOptions holds options for the restore command.
type SetupOptions ¶
type SetupOptions struct {
Port int // kept for backward compat; currently unused
}
SetupOptions contains options for the setup command.
type WalletInfo ¶ added in v0.8.1
type WalletInfo struct {
Address string `json:"address"` // 0x-prefixed Ethereum address
PublicKey string `json:"publicKey"` // 0x-prefixed uncompressed public key (130 hex chars)
KeystoreUUID string `json:"keystore_uuid"` // UUID of the V3 keystore file
KeystorePath string `json:"keystore_path"` // Absolute host path to keystore JSON
CreatedAt string `json:"createdAt"` // ISO 8601 timestamp
Password string `json:"-"` // Keystore password (not serialized)
}
WalletInfo holds generated wallet metadata returned from GenerateWallet.
func GenerateWallet ¶ added in v0.8.1
GenerateWallet creates a new secp256k1 signing key, encrypts it as a V3 keystore, and provisions it to the host-side PVC path for the remote-signer.
func ReadWalletMetadata ¶ added in v0.8.1
func ReadWalletMetadata(deploymentDir string) (*WalletInfo, error)
ReadWalletMetadata reads existing wallet metadata from the deployment directory.