Repository navigation
feat(cli): completion, ssh commands, logs -f - #158
Merged
Merged
Conversation
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>
|
Warning Review limit reachedNext included review available in 33 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (20)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CLI and TUI polish. Items are numbered as in the QoL audit.
Changes
stoat completion bash|zsh|fishprints a script that calls a hiddenstoat __complete. It completes subcommands, flags, enum values, VM names (data root plus the current project's keys), image ids and recipe names. Install steps are indocs/reference/cli.md.stoat ssh <vm> <cmd...>runs the command over ssh.--jsonkeeps its refusal, and the message now saysstoat --json exec <vm> -- <cmd>.-f/--follow;--lineswith-nkept and--nhidden for one release;no apply log yet for <vm>on stderr; stoat's own log defaults to INFO (STOAT_LOG_LEVEL=debugbrings the trace back).--followwith--jsonis a usage error.create --helpshows RAM, CPUs and disk from the core constants. Thestoat inittemplate uses the same constants. Acreatewith no TTY on stdin, or with--json, recordsdisplay = "vnc".?panel wrap instead of truncating. The list hides the logo below 30 rows and uses the freed rows for VMs.imagessizes columns from the data.doctorprints one line per check;-qprints only failures.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.modon the Go proxy:Notes
display = "vnc"default applies tostoat create. VMs created from astoat.tomlbystoat upare not changed.stoat ssh --json vm cmd:--jsonafter the VM name goes to the remote command, as withexec.TestToastOverlayKeepsScreenShapenow 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.Verification
go vet,gofmt,golangci-lint run ./...(0 issues) andgo test ./...pass.shellcheckis not installed here; no shell file changed.