diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-07 11:36:38 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-07 11:36:38 +0300 |
| commit | fb06bfa9dc7140f987bdbad59467a84610221fbb (patch) | |
| tree | b8ebf92c121a32eed0dc5e193c5877c5d0b94e6b /cmd/hexai-action | |
| parent | 0d424adfc64da1c61296c66a99162ec68cc4f8d0 (diff) | |
refactor: move hexai-action to cmd/hexai-action; extract orchestration into internal/hexaiaction; move tests; update Magefile and docs
Diffstat (limited to 'cmd/hexai-action')
| -rw-r--r-- | cmd/hexai-action/main.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/cmd/hexai-action/main.go b/cmd/hexai-action/main.go new file mode 100644 index 0000000..b796cbd --- /dev/null +++ b/cmd/hexai-action/main.go @@ -0,0 +1,33 @@ +package main + +import ( + "context" + "flag" + "fmt" + "os" + + "codeberg.org/snonux/hexai/internal/hexaiaction" +) + +func main() { + infile := flag.String("infile", "", "Read input from this file instead of stdin") + outfile := flag.String("outfile", "", "Write output to this file instead of stdout") + forceTmux := flag.Bool("tmux", false, "Force running the UI in a tmux split-pane (auto if not set)") + noTmux := flag.Bool("no-tmux", false, "Disable tmux mode even if available") + uiChild := flag.Bool("ui-child", false, "INTERNAL: run interactive UI and write to -outfile atomically") + tmuxTarget := flag.String("tmux-target", "", "tmux split target (advanced)") + tmuxSplit := flag.String("tmux-split", "v", "tmux split orientation: v or h") + tmuxPercent := flag.Int("tmux-percent", 33, "tmux split size percentage (1-100)") + flag.Parse() + + opts := hexaiaction.Options{ + Infile: *infile, Outfile: *outfile, + ForceTmux: *forceTmux, NoTmux: *noTmux, UIChild: *uiChild, + TmuxTarget: *tmuxTarget, TmuxSplit: *tmuxSplit, TmuxPercent: *tmuxPercent, + } + if err := hexaiaction.RunCommand(context.Background(), opts, os.Stdin, os.Stdout, os.Stderr); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +} + |
