Documentation
¶
Index ¶
- func BuildArgs(cli, prompt string) (string, []string)
- func DefaultPrompt(reportType, extra string) string
- func DetectCLI() (string, error)
- func DetectCLIWith(lookup LookupFunc) (string, error)
- func Generate(ctx context.Context, cli string, jsonData []byte, extraInstructions string) (string, error)
- func PrepareDocument(jsonData []byte) (string, string, error)
- func SupportedCLIs() []string
- type LookupFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildArgs ¶
BuildArgs returns the command name and argument slice for a non-interactive invocation of the given CLI with the provided prompt. For codex, the prompt is not passed as an argument — it is piped via stdin (using "-" to read from stdin) because codex exec ignores stdin when a prompt argument is present.
func DefaultPrompt ¶
DefaultPrompt returns the built-in prompt for the given report type. reportType should be "standard" or "trends". If extra is non-empty it is appended as additional instructions.
func DetectCLIWith ¶
func DetectCLIWith(lookup LookupFunc) (string, error)
DetectCLIWith finds the first supported AI CLI using the provided lookup function. It iterates the supported CLIs in order and returns the first one the lookup finds. Returns an error if none of the supported CLIs are found.
func Generate ¶
func Generate(ctx context.Context, cli string, jsonData []byte, extraInstructions string) (string, error)
Generate pre-processes the JSON data into a complete markdown document with tables and computed metrics, then runs the AI CLI to generate narrative paragraphs which are inserted into the document at the {{NARRATIVE}} placeholder.
func PrepareDocument ¶
PrepareDocument parses JSON report data and generates a complete markdown document with all tables and computed metrics. The document contains a {{NARRATIVE}} placeholder where AI-generated analysis should be inserted. Returns the document, the report type ("standard" or "trends"), and any error.
func SupportedCLIs ¶
func SupportedCLIs() []string
SupportedCLIs returns the list of supported AI CLI tool names.
Types ¶
type LookupFunc ¶
LookupFunc resolves a command name to its path. Compatible with exec.LookPath.