Documentation
¶
Overview ¶
Package oneshot is the UNIX-tool entrypoint: accept a prompt (positional arg or stdin), hand it to a Backend, write the result to stdout. The CLI command in cmd/fenster/main.go composes this with backend selection and flag parsing.
Modes:
- default: print Content followed by "\n"
- --stream: print content deltas as they arrive (no final newline if we already wrote one)
- --json: emit a single OpenAI-compatible chat.completion JSON object
The DRY rule: this module never speaks HTTP. It uses Backend directly. The HTTP server in internal/server is a separate consumer of Backend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Prompt string
System string
JSON bool
Stream bool
Quiet bool
Backend backend.Backend
Stdin io.Reader // optional; defaults to os.Stdin when nil
Stdout io.Writer // defaults to os.Stdout when nil
Stderr io.Writer // defaults to os.Stderr when nil
}
Options configures a one-shot invocation.
Click to show internal directories.
Click to hide internal directories.