cli

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package cli wires the aikido command-line tool. The exported NewApp returns a *cli.Command (urfave/cli v3) parameterized by a ClientFactory so tests can substitute a stub llm.Client for the real OpenRouter client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadDotEnv

func LoadDotEnv(path string) error

LoadDotEnv reads simple KEY=VALUE lines from path and sets each key in the process environment if it isn't already set. Lines starting with '#' and blank lines are skipped. Quoted values ("..." or '...') are unwrapped. A missing file is not an error.

func NewApp

func NewApp(factory ClientFactory) *urfavecli.Command

NewApp returns the root *cli.Command tree. factory runs only when a subcommand needs a client, so --help and --version work without a key.

func NewOpenRouterClient

func NewOpenRouterClient() (llm.Client, error)

NewOpenRouterClient is the default ClientFactory: it reads the API key from the environment and constructs an openrouter.Client. It returns an error if OPENROUTER_API_KEY is unset. OPENROUTER_BASE_URL, when set, replaces openrouter.DefaultBaseURL: a proxy, or the end-to-end suite's fake server.

Types

type ClientFactory

type ClientFactory func() (llm.Client, error)

ClientFactory builds the llm.Client used by every subcommand.

Production wiring uses NewOpenRouterClient (reads OPENROUTER_API_KEY from the env after .env is loaded). Tests inject a stub.

Jump to

Keyboard shortcuts

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