diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 65 |
1 files changed, 4 insertions, 61 deletions
@@ -5,6 +5,7 @@ Hexai, the AI addition for your Helix Editor (https://helix-editor.com) .. Other editors should work but weren't tested. It has got improved capabilities for Go code understanding (for example, create unit tests from function), but other programming language work as well. + ## Features * LSP Code auto-completion @@ -29,6 +30,7 @@ Hexai uses Mage for developer tasks. Install Mage, then run targets like build, - Dev build (+ tests, vet, lint): `mage dev` - Run tests: `mage test` - Run tests with coverage: `go test ./... -cover` +- Full cross-package coverage and HTML report: `mage coverage` (writes `docs/coverage.html`) - In restricted sandboxes/CI (no sockets), skip network-based tests: - `HEXAI_TEST_SKIP_NET=1 go test ./... -cover` - Install binaries to `GOPATH/bin`: `mage install` @@ -41,64 +43,5 @@ Either use the Mage method as mentioned above, or install directly with: - CLI: `go install codeberg.org/snonux/hexai/cmd/hexai@latest` - LSP: `go install codeberg.org/snonux/hexai/cmd/hexai-lsp@latest` - -For `hexai-action`, use Mage or a local build: - -- Build locally: `go build -o hexai-action cmd/internal/hexai-action/main.go` -- Or via Mage: `mage buildHexaiAction` (or `mage build`) -- Install: `mage install` (copies `hexai-action` to `GOPATH/bin` together with other binaries) - -## Hexai Action (TUI) - -`hexai-action` is a small TUI to run Hexai code actions from stdin. It loads the same `config.toml` as `hexai` and `hexai-lsp` (XDG path: `~/.config/hexai/config.toml`), and respects the same environment overrides. - -- Pipe code (and optionally diagnostics) into the tool. -- Select an action with arrow keys, vi keys (`j/k`, `g/G`), Enter, or hotkeys `[s] [r] [d] [c] [t]`. -- The tool prints the transformed text to stdout. - -Input formats - -- Rewrite: include an inline instruction near the top of the selection using one of: - - `;do something;` - - `/* do something */` - - `<!-- do something -->` - - `// do something` (or `#`, `--`) - -- Diagnostics (optional block): - - Begin with a header line `Diagnostics:` (case-insensitive), one diagnostic per line, blank line, then the code selection. - -Examples - -- Rewrite selection: - -``` -;replace fmt.Println with log.Println; -package main - -import "fmt" - -func main() { fmt.Println("hi") } -``` - -- Diagnostics + selection: - -``` -Diagnostics: -missing return at end of function -use of undefined: foo - -func f() int { - foo() -} -``` - -Run: - -- `cat input.go | ./hexai-action` -- or `./hexai-action < input.go` -- or with files: `./hexai-action --infile input.go --outfile output.go` - -Flags - -- `--infile` Read input from the given file instead of stdin. -- `--outfile` Write output to the given file instead of stdout (truncates/creates). +- Action runner: `go install codeberg.org/snonux/hexai/cmd/hexai-action@latest` +Install: `mage install` (copies `hexai-action` to `GOPATH/bin` together with other binaries) |
