opscli

package
v0.70.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package opscli builds hive commands from catalog operations: one `<resource> <verb>` command per operation, with flags from its input fields, help from its summary and guidance, and the enum and range checks of its constraints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DesktopCommands

func DesktopCommands(list []ops.Op, call Call, caller Caller, reserved ...string) ([]*cli.Command, error)

DesktopCommands builds `<resource-kebab> <verb>` groups for every desktop-owned op. It fails on an op whose input has a field the CLI cannot spell, so a bad spec fails the first test rather than a user's call.

reserved names the flags of the parent command. urfave/cli resolves a flag name from the nearest command first, so a field flag with a reserved name would hide the parent's flag from the command.

func Kebab

func Kebab(s string) string

Kebab spells a json or resource name the way a flag or command is spelled: profileId is profile-id and canvas_block is canvas-block.

func Path

func Path(info ops.Info) []string

Path is the command path of an op below its parent: resource, then verb.

Types

type Call

type Call func(ctx context.Context, c *cli.Command, mcpPath, tool string, args map[string]any) (any, error)

Call sends one tool call to the desktop and returns its result.

type Caller

type Caller func(c *cli.Command) (string, error)

Caller resolves the caller field of an input.

Jump to

Keyboard shortcuts

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