cmd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(args []string) (err error)

func VersionString

func VersionString() string

Types

type AnswerCmd

type AnswerCmd struct {
	Query string `arg:"" required:"" help:"Question to answer"`
	Num   int    `help:"Number of source results" default:"5"`
}

func (*AnswerCmd) Run

func (cmd *AnswerCmd) Run(ctx context.Context) error

type AuthCmd

type AuthCmd struct {
	SetKey AuthSetKeyCmd `cmd:"" help:"Set API key (uses --stdin by default)"`
	Status AuthStatusCmd `cmd:"" help:"Show authentication status"`
	Remove AuthRemoveCmd `cmd:"" help:"Remove stored credentials"`
}

type AuthRemoveCmd

type AuthRemoveCmd struct{}

func (*AuthRemoveCmd) Run

func (cmd *AuthRemoveCmd) Run(ctx context.Context) error

type AuthSetKeyCmd

type AuthSetKeyCmd struct {
	Stdin bool   `help:"Read API key from stdin (default: true)" default:"true"`
	Key   string `arg:"" optional:"" help:"API key (discouraged; exposes in shell history)"`
}

func (*AuthSetKeyCmd) Run

func (cmd *AuthSetKeyCmd) Run(ctx context.Context) error

type AuthStatusCmd

type AuthStatusCmd struct{}

func (*AuthStatusCmd) Run

func (cmd *AuthStatusCmd) Run(ctx context.Context) error

type CLI

type CLI struct {
	RootFlags `embed:""`

	Version     kong.VersionFlag `help:"Print version and exit"`
	Auth        AuthCmd          `cmd:"" help:"Auth and credentials"`
	Search      SearchCmd        `cmd:"" help:"Search the web"`
	Contents    ContentsCmd      `cmd:"" help:"Search and retrieve page contents"`
	FindSimilar FindSimilarCmd   `cmd:"" name:"find-similar" help:"Find pages similar to a URL"`
	Answer      AnswerCmd        `cmd:"" help:"Get AI answers with citations"`
	VersionCmd  VersionCmd       `cmd:"" name:"version" help:"Print version"`
}

type ContentsCmd

type ContentsCmd struct {
	Query      string   `arg:"" required:"" help:"Search query"`
	Num        int      `help:"Number of results" default:"3"`
	MaxChars   int      `help:"Maximum characters of text per result" name:"max-chars" default:"3000"`
	Highlights bool     `help:"Include text highlights"`
	Summary    bool     `help:"Include AI summary of each result"`
	Domains    []string `help:"Include only these domains (comma-separated)" sep:","`
}

func (*ContentsCmd) Run

func (cmd *ContentsCmd) Run(ctx context.Context) error

type ExitError

type ExitError struct {
	Code int
	Err  error
}

ExitError wraps an error with an exit code.

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) Unwrap

func (e *ExitError) Unwrap() error

type FindSimilarCmd

type FindSimilarCmd struct {
	URL            string   `arg:"" required:"" help:"URL to find similar pages for"`
	Num            int      `help:"Number of results" default:"5"`
	Domains        []string `help:"Include only these domains (comma-separated)" sep:","`
	ExcludeDomains []string `help:"Exclude these domains (comma-separated)" name:"exclude-domains" sep:","`
}

func (*FindSimilarCmd) Run

func (cmd *FindSimilarCmd) Run(ctx context.Context) error

type RootFlags

type RootFlags struct {
	Color   string `help:"Color output: auto|always|never" default:"${color}"`
	JSON    bool   `help:"Output JSON to stdout (best for scripting)" default:"${json}"`
	Plain   bool   `help:"Output stable, parseable text to stdout (TSV; no colors)" default:"${plain}"`
	Force   bool   `help:"Skip confirmations for destructive commands"`
	NoInput bool   `help:"Never prompt; fail instead (useful for CI)"`
	Verbose bool   `help:"Enable verbose logging"`
}

type SearchCmd

type SearchCmd struct {
	Query          string   `arg:"" required:"" help:"Search query"`
	Num            int      `help:"Number of results" default:"5"`
	Type           string   `help:"Search type: auto, neural, keyword" default:"auto"`
	Domains        []string `help:"Include only these domains (comma-separated)" sep:","`
	ExcludeDomains []string `help:"Exclude these domains (comma-separated)" name:"exclude-domains" sep:","`
	StartDate      string   `help:"Start published date (YYYY-MM-DD)" name:"start-date"`
	EndDate        string   `help:"End published date (YYYY-MM-DD)" name:"end-date"`
}

func (*SearchCmd) Run

func (cmd *SearchCmd) Run(ctx context.Context) error

type VersionCmd

type VersionCmd struct{}

func (*VersionCmd) Run

func (cmd *VersionCmd) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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