Skip to content

Commit 8653583

Browse files
committed
feat: rename 'vers info' to 'vers get' (alias preserved)
Addresses F8 from AGENT_NATIVE_AUDIT.md. Aligns with the canonical get/list/create/update/delete vocabulary already used by 'repo get' and 'tag get'. The 'info' alias is preserved for backwards compatibility.
1 parent ec0765a commit 8653583

3 files changed

Lines changed: 21 additions & 18 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ vers status -q
5757
vers status --json
5858

5959
# Detailed metadata for a VM (IP, lineage, timestamps)
60-
vers info <vm-id>
61-
vers info --json
60+
vers get <vm-id>
61+
vers get --json
6262

6363
# Execute a command on a VM
6464
vers execute <vm-id> <command> [args...]
@@ -147,11 +147,11 @@ vers commit delete $(vers commit list -q)
147147
vers tag delete $(vers tag list -q)
148148

149149
# Get info on the first VM
150-
vers info $(vers status -q | head -1)
150+
vers get $(vers status -q | head -1)
151151

152152
# JSON piped to jq
153153
vers status --json | jq '.[].vm_id'
154-
vers info <vm-id> --json | jq '.ip'
154+
vers get <vm-id> --json | jq '.ip'
155155
```
156156

157157
`ps` is an alias for `status`:

cmd/info.go renamed to cmd/get.go

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@ import (
99
)
1010

1111
var (
12-
infoQuiet bool
13-
infoJSON bool
14-
infoFormat string
12+
getQuiet bool
13+
getJSON bool
14+
getFormat string
1515
)
1616

17-
var infoCmd = &cobra.Command{
18-
Use: "info [vm-id|alias]",
19-
Short: "Show detailed metadata for a VM",
17+
var getCmd = &cobra.Command{
18+
Use: "get [vm-id|alias]",
19+
Aliases: []string{"info"},
20+
Short: "Show detailed metadata for a VM",
2021
Long: `Display detailed metadata for a VM including IP address, lineage (parent commit,
2122
grandparent VM), and timestamps. If no VM is specified, uses the current HEAD.
2223
2324
Use -q/--quiet to output just the VM ID.
24-
Use --json for machine-readable output.`,
25+
Use --json for machine-readable output.
26+
27+
The "info" alias is preserved for backwards compatibility.`,
2528
Args: cobra.MaximumNArgs(1),
2629
RunE: func(cmd *cobra.Command, args []string) error {
2730
target := ""
@@ -37,7 +40,7 @@ Use --json for machine-readable output.`,
3740
return err
3841
}
3942

40-
format, err := pres.ParseFormat(infoQuiet, infoJSON, infoFormat)
43+
format, err := pres.ParseFormat(getQuiet, getJSON, getFormat)
4144
if err != nil {
4245
return err
4346
}
@@ -54,9 +57,9 @@ Use --json for machine-readable output.`,
5457
}
5558

5659
func init() {
57-
rootCmd.AddCommand(infoCmd)
58-
infoCmd.Flags().BoolVarP(&infoQuiet, "quiet", "q", false, "Only display VM ID")
59-
infoCmd.Flags().BoolVar(&infoJSON, "json", false, "Output as JSON")
60-
infoCmd.Flags().StringVar(&infoFormat, "format", "", "Output format (json) [deprecated: use --json]")
61-
_ = infoCmd.Flags().MarkDeprecated("format", "use --json instead")
60+
rootCmd.AddCommand(getCmd)
61+
getCmd.Flags().BoolVarP(&getQuiet, "quiet", "q", false, "Only display VM ID")
62+
getCmd.Flags().BoolVar(&getJSON, "json", false, "Output as JSON")
63+
getCmd.Flags().StringVar(&getFormat, "format", "", "Output format (json) [deprecated: use --json]")
64+
_ = getCmd.Flags().MarkDeprecated("format", "use --json instead")
6265
}

cmd/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var statusCmd = &cobra.Command{
2222
2323
Use -q/--quiet to output just VM IDs (one per line), useful for scripting:
2424
vers kill $(vers status -q) # kill all VMs
25-
vers info $(vers status -q | head -1) # info on first VM
25+
vers get $(vers status -q | head -1) # info on first VM
2626
2727
Use --json for machine-readable output.`,
2828
Aliases: []string{"ps"},

0 commit comments

Comments
 (0)