Merge model,cli,docs polish for v0.1.0

# Conflicts:
#	internal/cli/commands_image.go
This commit is contained in:
Thales Maciel 2026-04-28 17:36:47 -03:00
commit f7a6832ebf
No known key found for this signature in database
GPG key ID: 33112E6833C34679
6 changed files with 196 additions and 42 deletions

View file

@ -891,7 +891,8 @@ Pipe into 'jq' for quick field extraction, e.g. banger vm stats dev | jq .mem.
}
func (d *deps) newVMPortsCommand() *cobra.Command {
return &cobra.Command{
var jsonOut bool
cmd := &cobra.Command{
Use: "ports <id-or-name>",
Short: "Show host-reachable listening guest ports",
Args: exactArgsUsage(1, "usage: banger vm ports <id-or-name>"),
@ -905,9 +906,14 @@ func (d *deps) newVMPortsCommand() *cobra.Command {
if err != nil {
return err
}
if jsonOut {
return printJSON(cmd.OutOrStdout(), result)
}
return printVMPortsTable(cmd.OutOrStdout(), result)
},
}
cmd.Flags().BoolVar(&jsonOut, "json", false, "print ports as JSON instead of a table")
return cmd
}
type resolvedVMTarget struct {