summaryrefslogtreecommitdiff
path: root/internal/hexaicli/run.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-07 17:58:32 +0300
committerPaul Buetow <paul@buetow.org>2025-09-07 17:58:32 +0300
commit3246ebcc5246ed357f45ac32234d5cd34922b9f3 (patch)
treec594f2fd2ebc01689574c721f4e85e1065a124c4 /internal/hexaicli/run.go
parent77e41a1018715fa5ac4e6156354710b3b224b4fc (diff)
test+docs: add editor tests; document HEXAI_EDITOR/EDITOR and Custom prompt; seam client in CLI for tests
Diffstat (limited to 'internal/hexaicli/run.go')
-rw-r--r--internal/hexaicli/run.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/hexaicli/run.go b/internal/hexaicli/run.go
index 98e4c40..6017e51 100644
--- a/internal/hexaicli/run.go
+++ b/internal/hexaicli/run.go
@@ -25,7 +25,7 @@ func Run(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.
// Load configuration with a logger so file-based config is respected.
logger := log.New(stderr, "hexai ", log.LstdFlags|log.Lmsgprefix)
cfg := appconfig.Load(logger)
- client, err := llmutils.NewClientFromApp(cfg)
+ client, err := newClientFromApp(cfg)
if err != nil {
fmt.Fprintf(stderr, logging.AnsiBase+"hexai: LLM disabled: %v"+logging.AnsiReset+"\n", err)
return err
@@ -154,6 +154,7 @@ func printProviderInfo(errw io.Writer, client llm.Client) {
}
// newClientFromConfig is kept for tests; delegates to llmutils.
-func newClientFromConfig(cfg appconfig.App) (llm.Client, error) {
- return llmutils.NewClientFromApp(cfg)
-}
+var newClientFromApp = llmutils.NewClientFromApp
+
+// Backcompat for tests referencing the older helper name.
+func newClientFromConfig(cfg appconfig.App) (llm.Client, error) { return newClientFromApp(cfg) }