cli

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package cli implements the command-line interface for godoctor using Cobra.

Index

Constants

View Source
const (
	ToolNameEdit      = "edit"
	ToolNameBuild     = "build"
	ToolNameTest      = "test"
	ToolNameDocs      = "docs"
	ToolNameSelene    = "selene"
	ToolNameTestQuery = "testquery"
	ToolNameTQ        = "tq"
	AppName           = "godoctor"
	CommandMCP        = "mcp"
	CommandInit       = "init"
	CommandCheck      = "check"
	CommandList       = "list"
)

CLI tool name and command constants

View Source
const DefaultConfigFileTemplate = `` /* 5805-byte string literal not displayed */

DefaultConfigFileTemplate is the master .godoctor.yaml configuration template matching RFC-0001 (Section 3.1).

View Source
const MinimalConfigFileTemplate = `` /* 403-byte string literal not displayed */

MinimalConfigFileTemplate is a concise configuration template for minimal setups.

Variables

This section is empty.

Functions

func ExecuteInstall

func ExecuteInstall(ctx context.Context, opts InstallOptions, stdout, stderr io.Writer) error

ExecuteInstall performs the installation according to the given options.

func ExecuteUninstall

func ExecuteUninstall(ctx context.Context, opts UninstallOptions, stdout, stderr io.Writer) error

ExecuteUninstall performs the uninstallation according to the given options.

func NewRootCmd added in v0.34.0

func NewRootCmd(version string, stdin io.Reader, stdout, stderr io.Writer) *cobra.Command

NewRootCmd constructs the main Cobra command tree.

func Run

func Run(ctx context.Context, version string, args []string, stdin io.Reader, stdout, stderr io.Writer) error

Run executes the CLI with the given arguments and streams.

Types

type GlobalOptions added in v0.34.0

type GlobalOptions struct {
	ConfigPath string
	Verbose    bool
	Quiet      bool
}

GlobalOptions holds global CLI flags.

type InstallOptions

type InstallOptions struct {
	InstallAll    bool
	InstallMCP    bool
	InstallSkills bool
	Workspace     bool
	Global        bool
	Force         bool
	Quiet         bool
	ConfigPath    string
	SkillsDir     string
}

InstallOptions holds parsed options for the install command.

type ToolDef

type ToolDef struct {
	Name        string
	Aliases     []string
	Description string
	Usage       string
	Invoke      func(ctx context.Context, rawArgs []string, stdin io.Reader) (*mcp.CallToolResult, error)
}

ToolDef represents metadata and invoker for a tool.

func FindTool

func FindTool(name string) *ToolDef

FindTool looks up a tool by name or alias.

func GetTools

func GetTools() []ToolDef

GetTools returns the list of all registered tools.

type UninstallOptions

type UninstallOptions struct {
	UninstallAll    bool
	UninstallMCP    bool
	UninstallSkills bool
	Workspace       bool
	Global          bool
	Quiet           bool
	ConfigPath      string
	SkillsDir       string
}

UninstallOptions holds parsed options for the uninstall command.

Jump to

Keyboard shortcuts

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