feat(cli): add inspect command#197
Merged
DorianZheng merged 5 commits intoboxlite-ai:mainfrom Feb 6, 2026
Merged
Conversation
DorianZheng
reviewed
Feb 6, 2026
boxlite/src/runtime/types.rs
Outdated
| /// Allows callers (e.g. CLI) to build a State view for templates or output | ||
| /// without access to internal BoxState. The result is equivalent to | ||
| /// `BoxStateInfo::new(state)` when the same box is represented as BoxInfo. | ||
| pub fn from_box_info(info: &BoxInfo) -> Self { |
Member
There was a problem hiding this comment.
use from trait, impl From<BoxInfo> for BoxStateInfo
- Add `boxlite inspect [OPTIONS] BOX [BOX...]` with --latest support
- Output formats: json, yaml, or Go template (e.g. {{.State}}, {{.Id}})
- PascalCase output (Id, Name, Image, State, Cpus, Memory) aligned with Docker/Podman
- Template aliases: .ID -> .Id, .ImageID -> .Image
- Reject table format; use formatter + BoxInfo/BoxStateInfo from boxlite
- Tests: no args, nonexistent, by name/id, multiple boxes, --latest, formats, table rejected
Co-authored-by: Cursor <[email protected]>
…th Docker/Podman
- Formatter: GtmplWithJson parse-once render-many; add json template
function and format_go_style_value for object output. Remove
format_gtmpl_with_json; tests use GtmplWithJson::parse().render().
- Inspect: parse template once before loop, serialize each presenter
to JSON once and reuse for path lookup and gtmpl context. Use
value_from_serde_json and GtmplWithJson; drop presenter_to_gtmpl_value.
- looks_like_template: require both {{ and }}.
- Add gtmpl_value dep; add inspect tests for template formats.
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
- Replace BoxStateInfo::from_box_info with impl From<&BoxInfo> - Update inspect command to use BoxStateInfo::from(info) Co-authored-by: Cursor <[email protected]>
b6eb857 to
9e65bab
Compare
DorianZheng
approved these changes
Feb 6, 2026
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.
Info
issue:#35
Key Changes
boxlite inspectwith --latest supportTesting
make test:cli./target/debug/inspect./target/debug/boxlite create --name mybox alpine:latest