Documentation
¶
Index ¶
- Variables
- func AddCommand(c *cobra.Command)
- func CustomApp(name, version, title, description string)
- func NewTool[T any, R any](name, desc string, f func(context.Context, T) (R, error)) *tools.Tool[T, R]
- func RemoveCommand(name string)
- func RemoveFlag(name string)
- func ResetCommands()
- func ResetFlags()
Constants ¶
This section is empty.
Variables ¶
var Clear = registry.Clear
Clear exposes the register submodule's Clear function.
var ErrCommandNotFound = fmt.Errorf("command not found in the root")
var Register = registry.Register
Register exposes the register submodule's Register function.
var Run = cmd.Execute
Run exposes the cmd submodule's Execute function.
Functions ¶
func AddCommand ¶
AddCommand adds command c to the Cobra root command.
This is useful for building custom binaries with default subcommands and also custom commands.
func CustomApp ¶
func CustomApp(name, version, title, description string)
CustomApp sets custom values for help messages in cmd.
func NewTool ¶
func NewTool[T any, R any](name, desc string, f func(context.Context, T) (R, error)) *tools.Tool[T, R]
NewTool exposes the tools submodule's NewTool function.
(We can't use a var for this because of the "generic" type.)
func RemoveCommand ¶
func RemoveCommand(name string)
RemoveCommand removes a command from the Cobra root command.
This is useful for building custom binaries with *less* functionality than the default.
Panics if the command is not found.
func RemoveFlag ¶
func RemoveFlag(name string)
RemoveFlag removes a flag from the Cobra root command.
This is useful for building binaries that have fewer options; however, take care that the options are not simply defined in a config file.
Panics if the flag does not exist.
func ResetFlags ¶
func ResetFlags()
ResetFlags resets the Cobra root command flags, disabling all persistent flags.
This is useful for building binaries that rely on a fixed configuration.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
ghd
|
|
|
agent
Package agent contains code for creating and operating individual Agents: LLM clients with tool-execution abilities.
|
Package agent contains code for creating and operating individual Agents: LLM clients with tool-execution abilities. |
|
api
Package api defines the Greenhead HTTP API.
|
Package api defines the Greenhead HTTP API. |
|
assets
Package assets manages compiled-in files.
|
Package assets manages compiled-in files. |
|
cmd
Package cmd holds the Cobra-based command definitions.
|
Package cmd holds the Cobra-based command definitions. |
|
cmd/ghd
command
|
|
|
examples/custom
command
examples/custom/main.go -- example of a custom tool.
|
examples/custom/main.go -- example of a custom tool. |
|
examples/external
command
examples/external/main.go -- example of an external tool baked in.
|
examples/external/main.go -- example of an external tool baked in. |
|
examples/external-config
command
examples/external-config/main.go -- example of a configured external tool.
|
examples/external-config/main.go -- example of a configured external tool. |
|
examples/lockdown
command
examples/lockdown/main.go -- a maximally locked-down custom binary.
|
examples/lockdown/main.go -- a maximally locked-down custom binary. |
|
examples/minimal
command
examples/minimal/main.go -- smallest meaningfully custom CLI.
|
examples/minimal/main.go -- smallest meaningfully custom CLI. |
|
registry
Package registry holds the registered tools.
|
Package registry holds the registered tools. |
|
rgxp
Package rgxp provides convenience wrappers for regexp.Regexp, primarily for use in configs.
|
Package rgxp provides convenience wrappers for regexp.Regexp, primarily for use in configs. |
|
runner
Package runner defines the logic to run ghd, the Greenhead CLI tool.
|
Package runner defines the logic to run ghd, the Greenhead CLI tool. |
|
tools
Package tools defines the types for tools (functions) available to the LLMs.
|
Package tools defines the types for tools (functions) available to the LLMs. |
|
tools/all
Package all loads all known tools.
|
Package all loads all known tools. |
|
tools/demo
Package demo defines a Demo extension that registers itself on init.
|
Package demo defines a Demo extension that registers itself on init. |
|
tools/tictactoe
Package tictactoe models (very simply) the game of Tic Tac Toe.
|
Package tictactoe models (very simply) the game of Tic Tac Toe. |
|
utils
Package utils includes miscellaneous utilities to reduce boilerplate code.
|
Package utils includes miscellaneous utilities to reduce boilerplate code. |
|
version
Package Version tracks the current version of the software.
|
Package Version tracks the current version of the software. |
