summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--internal/hexaicli/run.go29
-rw-r--r--internal/llm/copilot.go1
-rw-r--r--internal/llm/openai.go1
4 files changed, 17 insertions, 16 deletions
diff --git a/README.md b/README.md
index b8a85a4..2758536 100644
--- a/README.md
+++ b/README.md
@@ -134,7 +134,7 @@ formatter = { command = "goimports" }
language-servers = [ "gopls", "golangci-lint-lsp", "hexai" ]
[language-server.hexai]
-command = "hexai"
+command = "hexai-lsp"
```
Note, that we have also configured other LSPs here (for Go, `gopls` and `golangci-lint-lsp`, along with `hexai` for AI completions - they aren't required for `hexai` to work, though)
diff --git a/internal/hexaicli/run.go b/internal/hexaicli/run.go
index 839daef..cfc70ec 100644
--- a/internal/hexaicli/run.go
+++ b/internal/hexaicli/run.go
@@ -3,13 +3,14 @@
package hexaicli
import (
- "bufio"
- "context"
- "fmt"
- "io"
- "os"
- "strings"
- "time"
+ "bufio"
+ "context"
+ "fmt"
+ "io"
+ "log"
+ "os"
+ "strings"
+ "time"
"hexai/internal/appconfig"
"hexai/internal/llm"
@@ -19,12 +20,14 @@ import (
// Run executes the Hexai CLI behavior given arguments and I/O streams.
// It assumes flags have already been parsed by the caller.
func Run(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer) error {
- cfg := appconfig.Load(nil)
- client, err := newClientFromConfig(cfg)
- if err != nil {
- fmt.Fprintf(stderr, logging.AnsiBase+"hexai: LLM disabled: %v"+logging.AnsiReset+"\n", err)
- return err
- }
+ // 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 := newClientFromConfig(cfg)
+ if err != nil {
+ fmt.Fprintf(stderr, logging.AnsiBase+"hexai: LLM disabled: %v"+logging.AnsiReset+"\n", err)
+ return err
+ }
return RunWithClient(ctx, args, stdin, stdout, stderr, client)
}
diff --git a/internal/llm/copilot.go b/internal/llm/copilot.go
index 67cffc9..1c9f60d 100644
--- a/internal/llm/copilot.go
+++ b/internal/llm/copilot.go
@@ -1,5 +1,4 @@
// Summary: GitHub Copilot client implementation for chat completions using the Copilot API.
-// Not yet reviewed by a human
package llm
import (
diff --git a/internal/llm/openai.go b/internal/llm/openai.go
index 69c0cfc..3093891 100644
--- a/internal/llm/openai.go
+++ b/internal/llm/openai.go
@@ -1,5 +1,4 @@
// Summary: OpenAI client implementation for chat completions with optional streaming and detailed logging.
-// Not yet reviewed by a human
package llm
import (