console

package
v0.8.13 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package console provides the extension interface and bootstrap entry point for the OpenClaw Console server.

External consumers (e.g. a private wrapper repo) import this package to register Extension implementations and start the server via Bootstrap.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(cfg Config, extensions ...Extension) error

Bootstrap initialises all core services, starts extensions, and runs the HTTP server. It blocks until the server exits and returns any error.

The caller is responsible for configuring the global logger before calling Bootstrap (e.g. setting zerolog's log.Logger).

func RunCLI added in v0.5.2

func RunCLI(ctx context.Context, bin string, args ...string) ([]byte, error)

RunCLI executes an openclaw CLI command with automatic device pairing recovery. If the command fails with "pairing required", the latest pending device is auto-approved and the command is retried once.

Types

type Config

type Config struct {
	Addr                  string
	AuthToken             string
	ModelCatalogProviders []ModelCatalogProvider
}

Config holds configuration for the console server.

type Extension

type Extension interface {
	// ID returns a unique identifier for this extension (e.g. "updater").
	ID() string

	// DisplayName returns a human-readable name for sidebar display.
	DisplayName() string

	// Icon returns a Lucide icon name (e.g. "refresh-cw").
	Icon() string

	// BasePath returns the frontend route path (e.g. "/system-updates").
	BasePath() string

	// Handler returns an http.Handler whose routes are mounted
	// at /api/v1/extensions/{ID}/.
	Handler() http.Handler

	// Start launches background tasks. The provided context is cancelled
	// on server shutdown. Must be non-blocking.
	Start(ctx context.Context) error
}

Extension defines a pluggable module that adds API routes, background tasks, and a navigation entry to the console UI.

type ModelCatalogEntry added in v0.5.0

type ModelCatalogEntry = openclaw.ModelCatalogEntry

ModelCatalogEntry is a type alias for the internal ModelCatalogEntry type.

type ModelCatalogProvider added in v0.5.0

type ModelCatalogProvider = openclaw.ModelCatalogProvider

ModelCatalogProvider is a type alias for the internal ModelCatalogProvider interface, allowing external consumers to implement it.

Jump to

Keyboard shortcuts

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