Documentation
¶
Index ¶
- Variables
- func ConfirmPrompt(prompt string) (bool, error)
- func ConfirmPromptWithOptions(prompt string, options ConfirmOptions) (bool, error)
- func EnsureIntegrationInstalled(name string, runner Runner) error
- func IsIntegrationInstalled(name string) bool
- func LaunchCmd(checkServerHeartbeat func(cmd *cobra.Command, args []string) error, ...) *cobra.Command
- func LaunchIntegration(ctx context.Context, req IntegrationLaunchRequest) error
- func OpenBrowser(url string)
- func ResolveRunModel(ctx context.Context, req RunModelRequest) (string, error)
- type Claude
- type ClaudeDesktop
- func (c *ClaudeDesktop) AutodiscoveredModel() string
- func (c *ClaudeDesktop) AutodiscoveryConfigured() bool
- func (c *ClaudeDesktop) ConfigurationSuccessMessage() string
- func (c *ClaudeDesktop) ConfigureAutodiscovery() error
- func (c *ClaudeDesktop) Onboard() error
- func (c *ClaudeDesktop) Paths() []string
- func (c *ClaudeDesktop) RequiresInteractiveOnboarding() bool
- func (c *ClaudeDesktop) Restore() error
- func (c *ClaudeDesktop) RestoreHint() string
- func (c *ClaudeDesktop) RestoreSuccessMessage() string
- func (c *ClaudeDesktop) Run(_ string, args []string) error
- func (c *ClaudeDesktop) SkipModelReadiness() bool
- func (c *ClaudeDesktop) String() string
- func (c *ClaudeDesktop) Supported() error
- type Cline
- type Codex
- type ConfigurationSuccessIntegration
- type ConfirmOptions
- type Copilot
- type Droid
- type Editor
- type Hermes
- func (h *Hermes) Configure(model string) error
- func (h *Hermes) CurrentModel() string
- func (h *Hermes) Onboard() error
- func (h *Hermes) Paths() []string
- func (h *Hermes) RefreshRuntimeAfterConfigure() error
- func (h *Hermes) RequiresInteractiveOnboarding() bool
- func (h *Hermes) Run(_ string, args []string) error
- func (h *Hermes) String() string
- type IntegrationInfo
- type IntegrationInstallSpec
- type IntegrationLaunchRequest
- type IntegrationSpec
- type Kimi
- type LaunchConfirmMode
- type LaunchMissingModelMode
- type LaunchPolicy
- type LauncherIntegrationState
- type LauncherState
- type ManagedAutodiscoveryCloudIntegration
- type ManagedAutodiscoveryIntegration
- type ManagedInteractiveOnboarding
- type ManagedModelListConfigurer
- type ManagedModelReadinessSkipper
- type ManagedOnboardingValidator
- type ManagedRuntimeRefresher
- type ManagedSingleModel
- type ModelInfo
- type ModelItem
- type MultiSelector
- type OpenCode
- type Openclaw
- type Pi
- type Poolside
- type RestorableIntegration
- type RestoreHintIntegration
- type RestoreSuccessIntegration
- type RunModelRequest
- type Runner
- type SingleSelector
- type SupportedIntegration
- type VSCode
- func (v *VSCode) Edit(models []string) error
- func (v *VSCode) FocusVSCode()
- func (v *VSCode) IsRunning() bool
- func (v *VSCode) Models() []string
- func (v *VSCode) Paths() []string
- func (v *VSCode) Quit()
- func (v *VSCode) Run(model string, args []string) error
- func (v *VSCode) ShowInModelPicker(models []string) error
- func (v *VSCode) String() string
Constants ¶
This section is empty.
Variables ¶
var DefaultConfirmPrompt func(prompt string, options ConfirmOptions) (bool, error)
DefaultConfirmPrompt provides a TUI-based confirmation prompt. When set, ConfirmPrompt delegates to it instead of using raw terminal I/O.
var DefaultSignIn func(modelName, signInURL string) (string, error)
DefaultSignIn provides a TUI-based sign-in flow. When set, ensureAuth uses it instead of plain text prompts. Returns the signed-in username or an error.
var ErrCancelled = errors.New("cancelled")
ErrCancelled is returned when the user cancels a selection.
Functions ¶
func ConfirmPrompt ¶
ConfirmPrompt is the shared confirmation gate for launch flows (integration edits, missing-model pulls, sign-in prompts, OpenClaw install/security, etc). Behavior is controlled by currentLaunchConfirmPolicy, typically scoped by withLaunchConfirmPolicy in LaunchCmd (e.g. auto-approve with --yes).
func ConfirmPromptWithOptions ¶ added in v0.20.5
func ConfirmPromptWithOptions(prompt string, options ConfirmOptions) (bool, error)
ConfirmPromptWithOptions is the shared confirmation gate for launch flows that need custom yes/no labels in interactive UIs.
func EnsureIntegrationInstalled ¶
EnsureIntegrationInstalled installs auto-installable integrations when missing.
func IsIntegrationInstalled ¶
IsIntegrationInstalled checks if an integration binary is installed.
func LaunchCmd ¶
func LaunchCmd(checkServerHeartbeat func(cmd *cobra.Command, args []string) error, runTUI func(cmd *cobra.Command)) *cobra.Command
LaunchCmd returns the cobra command for launching integrations. The runTUI callback is called when the root launcher UI should be shown.
func LaunchIntegration ¶
func LaunchIntegration(ctx context.Context, req IntegrationLaunchRequest) error
LaunchIntegration runs the canonical launcher flow for one integration.
func ResolveRunModel ¶
func ResolveRunModel(ctx context.Context, req RunModelRequest) (string, error)
ResolveRunModel returns the model that should be used for interactive chat.
Types ¶
type ClaudeDesktop ¶ added in v0.23.0
type ClaudeDesktop struct{}
ClaudeDesktop configures and launches Claude Desktop in third-party inference mode using Ollama Cloud as the gateway.
func (*ClaudeDesktop) AutodiscoveredModel ¶ added in v0.23.0
func (c *ClaudeDesktop) AutodiscoveredModel() string
func (*ClaudeDesktop) AutodiscoveryConfigured ¶ added in v0.23.0
func (c *ClaudeDesktop) AutodiscoveryConfigured() bool
func (*ClaudeDesktop) ConfigurationSuccessMessage ¶ added in v0.23.0
func (c *ClaudeDesktop) ConfigurationSuccessMessage() string
func (*ClaudeDesktop) ConfigureAutodiscovery ¶ added in v0.23.0
func (c *ClaudeDesktop) ConfigureAutodiscovery() error
func (*ClaudeDesktop) Onboard ¶ added in v0.23.0
func (c *ClaudeDesktop) Onboard() error
func (*ClaudeDesktop) Paths ¶ added in v0.23.0
func (c *ClaudeDesktop) Paths() []string
func (*ClaudeDesktop) RequiresInteractiveOnboarding ¶ added in v0.23.0
func (c *ClaudeDesktop) RequiresInteractiveOnboarding() bool
func (*ClaudeDesktop) Restore ¶ added in v0.23.0
func (c *ClaudeDesktop) Restore() error
func (*ClaudeDesktop) RestoreHint ¶ added in v0.23.0
func (c *ClaudeDesktop) RestoreHint() string
func (*ClaudeDesktop) RestoreSuccessMessage ¶ added in v0.23.0
func (c *ClaudeDesktop) RestoreSuccessMessage() string
func (*ClaudeDesktop) Run ¶ added in v0.23.0
func (c *ClaudeDesktop) Run(_ string, args []string) error
func (*ClaudeDesktop) SkipModelReadiness ¶ added in v0.23.0
func (c *ClaudeDesktop) SkipModelReadiness() bool
func (*ClaudeDesktop) String ¶ added in v0.23.0
func (c *ClaudeDesktop) String() string
func (*ClaudeDesktop) Supported ¶ added in v0.23.0
func (c *ClaudeDesktop) Supported() error
type ConfigurationSuccessIntegration ¶ added in v0.23.0
type ConfigurationSuccessIntegration interface {
ConfigurationSuccessMessage() string
}
ConfigurationSuccessIntegration can print a short message after launcher successfully switches an app into a launch-managed mode.
type ConfirmOptions ¶ added in v0.20.5
ConfirmOptions customizes labels for confirmation prompts.
type Copilot ¶ added in v0.21.0
type Copilot struct{}
Copilot implements Runner for GitHub Copilot CLI integration.
type Hermes ¶ added in v0.21.0
type Hermes struct{}
Hermes is intentionally not an Editor integration: launch owns one primary model and the local Ollama endpoint, while Hermes keeps its own discovery and switching UX after startup.
func (*Hermes) CurrentModel ¶ added in v0.21.0
func (*Hermes) RefreshRuntimeAfterConfigure ¶ added in v0.21.0
func (*Hermes) RequiresInteractiveOnboarding ¶ added in v0.21.0
type IntegrationInfo ¶
IntegrationInfo contains display information about a registered integration.
func ListIntegrationInfos ¶
func ListIntegrationInfos() []IntegrationInfo
ListIntegrationInfos returns the registered integrations in launcher display order.
type IntegrationInstallSpec ¶
type IntegrationInstallSpec struct {
CheckInstalled func() bool
EnsureInstalled func() error
URL string
Command []string
}
IntegrationInstallSpec describes how launcher should detect and guide installation.
type IntegrationLaunchRequest ¶
type IntegrationLaunchRequest struct {
Name string
ModelOverride string
ForceConfigure bool
ConfigureOnly bool
Restore bool
ExtraArgs []string
Policy *LaunchPolicy
}
IntegrationLaunchRequest controls the canonical integration launcher flow.
type IntegrationSpec ¶
type IntegrationSpec struct {
Name string
Runner Runner
Aliases []string
Hidden bool
Description string
Install IntegrationInstallSpec
}
IntegrationSpec is the canonical registry entry for one integration.
func ListVisibleIntegrationSpecs ¶
func ListVisibleIntegrationSpecs() []IntegrationSpec
ListVisibleIntegrationSpecs returns the canonical integrations that should appear in interactive UIs.
func LookupIntegrationSpec ¶
func LookupIntegrationSpec(name string) (*IntegrationSpec, error)
LookupIntegrationSpec resolves either a canonical integration name or alias to its spec.
type Kimi ¶ added in v0.21.1
type Kimi struct{}
Kimi implements Runner for Kimi Code CLI integration.
type LaunchConfirmMode ¶
type LaunchConfirmMode int
LaunchConfirmMode controls confirmation behavior across launch flows.
const ( // LaunchConfirmPrompt prompts the user for confirmation. LaunchConfirmPrompt LaunchConfirmMode = iota // LaunchConfirmAutoApprove skips prompts and treats confirmation as accepted. LaunchConfirmAutoApprove // LaunchConfirmRequireYes rejects confirmation requests with a --yes hint. LaunchConfirmRequireYes )
type LaunchMissingModelMode ¶
type LaunchMissingModelMode int
LaunchMissingModelMode controls local missing-model handling in launch flows.
const ( // LaunchMissingModelPromptToPull prompts to pull a missing local model. LaunchMissingModelPromptToPull LaunchMissingModelMode = iota // LaunchMissingModelAutoPull pulls a missing local model without prompting. LaunchMissingModelAutoPull // LaunchMissingModelFail fails immediately when a local model is missing. LaunchMissingModelFail )
type LaunchPolicy ¶
type LaunchPolicy struct {
Confirm LaunchConfirmMode
MissingModel LaunchMissingModelMode
}
LaunchPolicy controls launch behavior that may vary by caller context.
type LauncherIntegrationState ¶
type LauncherIntegrationState struct {
Name string
DisplayName string
Description string
Installed bool
AutoInstallable bool
Selectable bool
Changeable bool
CurrentModel string
ModelUsable bool
InstallHint string
Editor bool
}
LauncherIntegrationState is the launch-owned status for one launcher integration.
type LauncherState ¶
type LauncherState struct {
LastSelection string
RunModel string
RunModelUsable bool
Integrations map[string]LauncherIntegrationState
}
LauncherState is the launch-owned snapshot used to render the root launcher menu.
func BuildLauncherState ¶
func BuildLauncherState(ctx context.Context) (*LauncherState, error)
BuildLauncherState returns the launch-owned root launcher menu snapshot.
type ManagedAutodiscoveryCloudIntegration ¶ added in v0.23.0
type ManagedAutodiscoveryCloudIntegration interface {
UsesOllamaCloud() bool
}
ManagedAutodiscoveryCloudIntegration marks an autodiscovery integration whose discovered model catalog depends on the user's local Ollama Cloud auth state.
type ManagedAutodiscoveryIntegration ¶ added in v0.23.0
type ManagedAutodiscoveryIntegration interface {
Paths() []string
AutodiscoveredModel() string
AutodiscoveryConfigured() bool
ConfigureAutodiscovery() error
Onboard() error
}
ManagedAutodiscoveryIntegration is for managed integrations that do not need a launcher-selected model because the app discovers available models itself.
type ManagedInteractiveOnboarding ¶ added in v0.21.0
type ManagedInteractiveOnboarding interface {
RequiresInteractiveOnboarding() bool
}
ManagedInteractiveOnboarding lets a managed integration declare whether its onboarding step really requires an interactive terminal. Hermes does not.
type ManagedModelListConfigurer ¶ added in v0.23.0
type ManagedModelListConfigurer interface {
ConfigureWithModels(primary string, models []string) error
}
ManagedModelListConfigurer lets managed single-model integrations receive the launcher's model list while still preserving one primary selected model.
type ManagedModelReadinessSkipper ¶ added in v0.23.0
type ManagedModelReadinessSkipper interface {
SkipModelReadiness() bool
}
ManagedModelReadinessSkipper lets managed integrations opt out of local Ollama model readiness checks when the configured runtime is not the local daemon.
type ManagedOnboardingValidator ¶ added in v0.21.0
type ManagedOnboardingValidator interface {
OnboardingComplete() bool
}
ManagedOnboardingValidator lets managed integrations re-check saved onboarding state when launcher needs a stronger live readiness signal.
type ManagedRuntimeRefresher ¶ added in v0.21.0
type ManagedRuntimeRefresher interface {
RefreshRuntimeAfterConfigure() error
}
ManagedRuntimeRefresher lets managed integrations refresh any long-lived background runtime after launch rewrites their config.
type ManagedSingleModel ¶ added in v0.21.0
type ManagedSingleModel interface {
Paths() []string
Configure(model string) error
CurrentModel() string
Onboard() error
}
ManagedSingleModel is the narrow launch-owned config path for integrations like Hermes that have one primary model selected by launcher, need launcher to persist minimal config, and still keep their own model discovery and onboarding UX. This stays separate from Runner-only integrations and the multi-model Editor flow so Hermes-specific behavior stays scoped to one path.
type ModelInfo ¶
type ModelInfo = modelInfo
ModelInfo re-exports launcher model inventory details for callers.
type ModelItem ¶
type ModelItem struct {
Name string
Description string
Recommended bool
VRAMBytes int64
ContextLength int
MaxOutputTokens int
}
ModelItem represents a model for selection UIs.
func IntegrationSelectionItems ¶
IntegrationSelectionItems returns the sorted integration items shown by launcher selection UIs.
type MultiSelector ¶
MultiSelector is a function type for multi item selection.
var DefaultMultiSelector MultiSelector
DefaultMultiSelector is the default multi-select implementation.
type OpenCode ¶
type OpenCode struct {
// contains filtered or unexported fields
}
OpenCode implements Runner and Editor for OpenCode integration. Config is passed via OPENCODE_CONFIG_CONTENT env var at launch time instead of writing to opencode's config files.
type Poolside ¶ added in v0.22.0
type Poolside struct{}
Poolside implements Runner for Poolside's CLI.
type RestorableIntegration ¶ added in v0.23.0
type RestorableIntegration interface {
Restore() error
}
RestorableIntegration lets integrations switch back from a launch-managed mode to the application's normal/default mode.
type RestoreHintIntegration ¶ added in v0.23.0
type RestoreHintIntegration interface {
RestoreHint() string
}
RestoreHintIntegration can provide a short restore command after launch switches an app into a launch-managed mode.
type RestoreSuccessIntegration ¶ added in v0.23.0
type RestoreSuccessIntegration interface {
RestoreSuccessMessage() string
}
RestoreSuccessIntegration can print a short message after launcher restores an app back to its default mode.
type RunModelRequest ¶
type RunModelRequest struct {
ForcePicker bool
Policy *LaunchPolicy
}
RunModelRequest controls how the root launcher resolves the chat model.
type SingleSelector ¶
SingleSelector is a function type for single item selection. current is the name of the previously selected item to highlight; empty means no pre-selection.
var DefaultSingleSelector SingleSelector
DefaultSingleSelector is the default single-select implementation.
type SupportedIntegration ¶ added in v0.23.0
type SupportedIntegration interface {
Supported() error
}
SupportedIntegration lets an integration report platform support separately from whether the underlying app binary is installed.
type VSCode ¶ added in v0.18.3
type VSCode struct{}
VSCode implements Runner and Editor for Visual Studio Code integration.
func (*VSCode) FocusVSCode ¶ added in v0.18.3
func (v *VSCode) FocusVSCode()
FocusVSCode brings VS Code to the foreground.
func (*VSCode) IsRunning ¶ added in v0.18.3
IsRunning reports whether VS Code is currently running. Each platform uses a pattern specific enough to avoid matching Cursor or other VS Code forks.
func (*VSCode) Quit ¶ added in v0.18.3
func (v *VSCode) Quit()
Quit gracefully quits VS Code and waits for it to exit so that it flushes its in-memory state back to the database.
func (*VSCode) ShowInModelPicker ¶ added in v0.18.3
ShowInModelPicker ensures the given models are visible in VS Code's Copilot Chat model picker. It sets the configured models to true in the picker preferences so they appear in the dropdown. Models use the VS Code identifier format "ollama/Ollama/<name>".