summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
2025-08-17refactor as per manual code reviewsPaul Buetow
2025-08-17feat: Support XDG config homePaul Buetow
This change implements support for the XDG Base Directory Specification for the configuration file. The configuration file is now read from `$XDG_CONFIG_HOME/hexai/config.json` if the `XDG_CONFIG_HOME` environment variable is set. If it is not set, it falls back to the previous location, `$HOME/.config/hexai/config.json`. This change also includes: - A fix for a bug in the test suite where a test was failing due to an environment variable being set. - Updates to the documentation to reflect the new configuration file location. - A version bump to 0.1.0.
2025-08-17cli+lsp: refactor main packages into internal runners; add testsPaul Buetow
- Move CLI logic to internal/hexaicli with Run/RunWithClient - Move LSP logic to internal/hexailsp with Run/RunWithFactory - Extract helpers; keep behavior identical for both binaries - Add unit tests for hexaicli (input parsing, messages, streaming) and hexailsp (factory wiring, client creation, logging settings) - Add top-of-file summaries and 'Not yet reviewed by a human' comments to all Go files - Update README with internal package docs
2025-08-17cli: stream responses in hexai when supported (OpenAI, Ollama)Paul Buetow
- Add llm.Streamer optional interface - Implement ChatStream for OpenAI (SSE) and Ollama (JSON stream) - CLI uses streaming; LSP unchanged (non-streaming) - README: document streaming behavior for CLI
2025-08-17docs(cli): document hexai CLI usage and behaviorsPaul Buetow
- Inputs from stdin/arg, concatenation rules - Stderr styling, immediate provider/model, final stats line - Default concise style; 'explain' keyword for verbose answers - Examples and exit codes
2025-08-17cli: add leading newline before stats on stderr for hexai outputPaul Buetow
2025-08-17cli: add hexai command-line tool and split LSP to hexai-lspPaul Buetow
- New cmd/hexai CLI: reads stdin/arg, prints LLM output to stdout - Prints provider/model immediately to stderr; summary at end - Refactor config loader to internal/appconfig - Update Taskfile to build/install/run both binaries - Update README with new CLI and LSP names
2025-08-17rename CLI binary to hexai-lspPaul Buetow
- Default log path: /tmp/hexai-lsp.log - Taskfile: build/copy/run hexai-lsp binary
2025-08-17llm: add GitHub Copilot providerPaul Buetow
- Implement copilot client reading COPILOT_API_KEY - Wire copilot_base_url and copilot_model config - Update README and config example; defaults to gpt-4.1 - Keep OpenAI default at gpt-4.1 for consistency
2025-08-17lsp/config: make completion trigger characters configurablePaul Buetow
- Add trigger_characters to JSON config and ServerOptions - Store on server and advertise in initialize - Update README and example config - Preserve previous defaults when unset
2025-08-16lsp: refactor NewServer to use options structPaul Buetow
- Introduce ServerOptions to reduce constructor parameter count - Update main.go call site; preserve defaults and behavior - Build and run tests
2025-08-16lsp: add 'Resolve diagnostics' code action scoped to selectionPaul Buetow
- Parse diagnostics from CodeAction context; filter to overlap with selection - Build LLM prompt from selection-only diagnostics; replace only selected range - Keep existing 'Rewrite selection' action; return both when applicable - Add Diagnostic and CodeActionContext types; make CodeActionParams.Context raw JSON - Add helpers for range overlap; unit tests for filtering/overlap - Update README to document resolve-diagnostics action
2025-08-16refactor(config): drop env-based config (except OPENAI_API_KEY)Paul Buetow
- Switch to config-file-only; only OPENAI_API_KEY read from env.\n- llm: replace env autodetect with Config + NewFromConfig; add newOpenAI/newOllama.\n- lsp: NewServer now accepts injected llm.Client.\n- cli: remove env overrides; extend appConfig with provider-specific fields; build client from config + OPENAI_API_KEY.\n- docs: update README (config-only, defaults to OpenAI, minimal example); simplify flags table.\n- add config.json.example.\n- prompts: enforce ;text; (no spaces) and add ;;text; to remove entire line; tests added.