Skip to content

feat(cli): completion, ssh commands, logs -f - #158

Merged
NovusEdge merged 1 commit into
mainfrom
qol/cli-polish
Sep 29, 2026
Merged

NovusEdge merged 1 commit into
mainfrom
qol/cli-polish

Conversation

@NovusEdge

Copy link
Copy Markdown
Owner

CLI and TUI polish. Items are numbered as in the QoL audit.

Changes

Completion approach

kong v1.16 has no completion support. I wrote it in about 200 lines with no new dependency. Grammar fields opt in with a complete:"vm|image|recipe" tag, and the completion logic is Go code with unit tests. The three shell scripts only forward the typed words.

Rejected, after checking each go.mod on the Go proxy:

  • willabides/kongplete v0.4.0 (Nov 2023): built on kong 0.8.1, and pulls posener/complete, loginshell, go-multierror and yaml.
  • jotaen/kong-completion v0.0.14: the same posener/complete, loginshell and multierror tree, and needs Go 1.25.
  • go.abhg.dev/komplete v0.1.0: one release (Oct 2024), built on kong 1.2.1, adds shellwords.

Notes

  • The display = "vnc" default applies to stoat create. VMs created from a stoat.toml by stoat up are not changed.
  • stoat ssh --json vm cmd: --json after the VM name goes to the remote command, as with exec.
  • Two existing tests changed. TestToastOverlayKeepsScreenShape now checks the toast against the terminal width, because the footer's last line is shorter now that it wraps. The list row budget takes the wrapped footer height into account.
  • No VM was booted. The tests are unit and TUI model tests.

Verification

go vet, gofmt, golangci-lint run ./... (0 issues) and go test ./... pass. shellcheck is not installed here; no shell file changed.

Shell completion: `stoat completion bash|zsh|fish` prints a script that
calls a hidden `stoat __complete`. It walks the kong model, and grammar
fields opt into VM, image and recipe values with a `complete` tag. No new
dependency.

ssh: words after the VM name run as the remote command.

logs: -f/--follow, --lines with -n kept and --n hidden for one release,
"no <which> log yet for <vm>", and stoat's own log at INFO
(STOAT_LOG_LEVEL=debug restores the trace).

create: help shows core's RAM, CPU and disk defaults; init's template
uses them; a create without a terminal or with --json records vnc.

images sizes columns from the data and doctor prints one line per check.

TUI: pane expands literal tabs, footer and help wrap instead of
truncating, and the list hides the logo below 30 rows.

Signed-off-by: NovusEdge <novusedge0@gmail.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: e9c12997-a2c2-4ae1-b71a-5ca179d82fec

📥 Commits

Reviewing files that changed from the base of the PR and between ba413a3 and 3c7797c.

📒 Files selected for processing (20)
  • docs/reference/cli.md
  • docs/reference/tui.md
  • internal/cli/cli.go
  • internal/cli/complete.go
  • internal/cli/complete_test.go
  • internal/cli/grammar.go
  • internal/cli/polish_test.go
  • internal/cli/run_access.go
  • internal/cli/run_image.go
  • internal/cli/run_init.go
  • internal/cli/run_misc.go
  • internal/cli/run_state.go
  • internal/cli/wire/envelope.go
  • internal/logx/logx.go
  • internal/tui/app.go
  • internal/tui/keymap.go
  • internal/tui/theme.go
  • internal/tui/toast_test.go
  • internal/tui/vmlist.go
  • internal/tui/wrap_test.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@NovusEdge
NovusEdge merged commit 40d8695 into main Sep 29, 2026
8 of 9 checks passed
@NovusEdge
NovusEdge deleted the qol/cli-polish branch September 29, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant