feat: CLI improvements — JSON output, SSH readiness, error handling#11
Open
jasonhernandez wants to merge 5 commits into
Open
feat: CLI improvements — JSON output, SSH readiness, error handling#11jasonhernandez wants to merge 5 commits into
jasonhernandez wants to merge 5 commits into
Conversation
Show build, pull, and list commands instead of only suggesting pull. Most custom images (ubuntu-dev, ubuntu-slim) need to be built from a Dockerfile, not pulled from a registry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
If `ember vm create` succeeds but the subsequent start fails (e.g., ember-vz crash, missing binary), delete the created VM instead of leaving orphaned state behind. Previously, the start rollback only cleaned up network/process but left the VM metadata and disk. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
`ember vm create` now waits up to 90s (configurable via --wait) for SSH to become reachable before reporting success. This means `ember exec` works immediately after create — no manual polling needed. Also add --wait flag to `ember exec` for configuring the SSH connect timeout (default: 30s, can be increased for heavy images). If the wait times out, the VM is still running — just SSH is slow. A hint is printed suggesting `ember exec --wait`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When `ember exec vm -- "echo hi | tee /tmp/out"` has one argument after `--`, pass it directly to the SSH channel without quoting. The remote shell interprets pipes and redirects correctly. Previously, shell_escape_join would single-quote arguments containing `|` or `>`, preventing the remote shell from interpreting them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- `ember vm create --format json` returns VM metadata as JSON on stdout - All progress messages (Cloning, Growing, Injecting, Starting, Waiting) now go to stderr so stdout is clean for JSON piping - `ember exec` also reformatted by cargo fmt This makes ember scriptable: `ember vm create foo --image bar --format json | jq .` outputs clean JSON while progress is visible on stderr. 201 tests pass (186 ember + 15 emberd), clippy clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Five independent CLI improvements:
vm create --format json: returns VM metadata as JSON on stdout. All progress messages go to stderr so stdout is clean for piping.vm create, polls SSH until the VM responds (configurable--waitseconds).vm startfails aftervm create, automatically deletes the orphaned state.ember exec vm -- "echo hi | tee /tmp/out"passes the command verbatim instead of re-quoting.Files changed
src/cli/vm.rssrc/cli/exec.rsTest plan
cargo buildclean,cargo clippycleanember vm create test --image base --format jsonoutputs JSONember vm create test --image nonexistentshows helpful errorember exec test -- "echo hi | tee /tmp/out"works🤖 Generated with Claude Code