types

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneThroughJSON

func CloneThroughJSON(oldConfig, newConfig any)

Types

type Command added in v1.8.2

type Command struct {
	// Description is shown in completion dialogs and help text.
	// For simple format commands, this is empty and the instruction is used for display.
	Description string `json:"description,omitempty"`

	// Instruction is the prompt sent to the agent.
	// Supports:
	// - Bang commands: !`command` (executed and output inserted)
	// - Positional arguments: $1, $2, etc.
	Instruction string `json:"instruction,omitempty"`
}

Command represents an agent command with optional metadata. It supports two YAML formats:

Simple format (string value):

fix-lint: "Fix the lint issues"

Advanced format (object value):

fix-lint:
  description: "Fix linting errors in the codebase"
  instruction: |
    Fix the lint issues reported by: !`golangci-lint run`
    Focus on files: $1

func (Command) DisplayText added in v1.8.2

func (c Command) DisplayText() string

DisplayText returns the text to show in completion dialogs. Returns Description if available, otherwise truncates the Instruction.

type Commands added in v1.6.6

type Commands map[string]Command

Commands represents a set of named prompts for quick-starting conversations. It supports multiple YAML formats:

Map of simple strings:

commands:
  df: "check disk space"
  ls: "list files"

List of singleton maps (simple strings):

commands:
  - df: "check disk space"
  - ls: "list files"

Map of advanced objects:

commands:
  fix-lint:
    description: "Fix linting errors"
    instruction: "Fix the lint issues"

Mixed format (simple and advanced):

commands:
  simple: "A simple command"
  advanced:
    description: "An advanced command"
    instruction: "Do something complex"

func (*Commands) UnmarshalYAML added in v1.6.6

func (c *Commands) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML supports both map and list-of-singleton-maps syntaxes, with values being either simple strings or Command objects.

type StringOrList

type StringOrList []string

func (*StringOrList) UnmarshalYAML

func (sm *StringOrList) UnmarshalYAML(unmarshal func(any) error) error

Jump to

Keyboard shortcuts

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