Skip to content

Commit 5a54b58

Browse files
committed
chore: strip emoji and decorative glyphs from CLI output
Adopt the lowercase-prefix convention used by serious dev tools (gcc, rustc, clippy, go) for status messages, and drop decorative emoji that were inherited from earlier prototypes. Rationale: - Emoji and unusual glyphs in CLI output break programmatic consumption (grep / awk / jq / log shippers must handle multi-byte noise), break alignment in fixed-width displays (most emoji are East-Asian-Wide and occupy 2 cells inconsistently across terminals), and turn into '?' on non-UTF-8 transports (serial consoles, some log re-encoders, older Windows terminals). - The recent CI failure on #188 (`TestRepoLifecycle` couldn't find 'v1' because the update banner was in the buffer) is the natural consequence of putting decorative output through stdout. - None of the tools we want vers-cli to feel adjacent to (git, go, cargo, kubectl, terraform, docker, aws, gcloud, ripgrep) decorate their output with emoji. The closest, `gh`, uses only the Unicode check/cross glyphs and TTY-gates them. Replacements applied: ✓ <message> -> <message> (drop; success implied) ✗ <message> -> error: <message> (lowercase compiler-style prefix) ⚠️ <message> -> warning: <message> 💡 <message> -> note: <message> 📧 Verification email -> Verification email (drop; text already explanatory) Println("✓") -> Println("ok") Println("✗") -> Println("failed") ├─ / └─ -> |- / \\- (ASCII tree in commit lineage) → -> -> (ASCII arrow everywhere) Also lowercased the first character following the new lowercase prefixes (`error: failed to ...` rather than `error: Failed to ...`) to match clippy/rustc/gcc convention exactly. Output changes are user-facing but minor; they make grepping CLI output more reliable and the project look less prototype-y. No behavior changes.
1 parent f7af8e8 commit 5a54b58

31 files changed

Lines changed: 122 additions & 122 deletions

cmd/commit.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Subcommands:
3131
unpublish Make a commit private`,
3232
Args: cobra.NoArgs,
3333
RunE: func(cmd *cobra.Command, args []string) error {
34-
// Bare `vers commit` with no args create commit of HEAD
34+
// Bare `vers commit` with no args -> create commit of HEAD
3535
return commitCreateCmd.RunE(cmd, args)
3636
},
3737
}
@@ -68,7 +68,7 @@ Use --format json for machine-readable output.`,
6868
if res.UsedHEAD {
6969
fmt.Printf("Using current HEAD VM: %s\n", res.VmID)
7070
}
71-
fmt.Printf("Committed VM '%s'\n", res.VmID)
71+
fmt.Printf("Committed VM '%s'\n", res.VmID)
7272
fmt.Printf("Commit ID: %s\n", res.CommitID)
7373
}
7474
return nil
@@ -139,13 +139,13 @@ Examples:
139139
CommitID: id,
140140
})
141141
if err != nil {
142-
fmt.Fprintf(cmd.ErrOrStderr(), "✗ Failed to delete commit %s: %v\n", id, err)
142+
fmt.Fprintf(cmd.ErrOrStderr(), "error: failed to delete commit %s: %v\n", id, err)
143143
if firstErr == nil {
144144
firstErr = err
145145
}
146146
continue
147147
}
148-
fmt.Printf("Commit %s deleted\n", id)
148+
fmt.Printf("Commit %s deleted\n", id)
149149
}
150150
return firstErr
151151
},
@@ -198,7 +198,7 @@ var commitPublishCmd = &cobra.Command{
198198
if err != nil {
199199
return err
200200
}
201-
fmt.Printf("Commit %s is now public\n", info.CommitID)
201+
fmt.Printf("Commit %s is now public\n", info.CommitID)
202202
return nil
203203
},
204204
}
@@ -219,7 +219,7 @@ var commitUnpublishCmd = &cobra.Command{
219219
if err != nil {
220220
return err
221221
}
222-
fmt.Printf("Commit %s is now private\n", info.CommitID)
222+
fmt.Printf("Commit %s is now private\n", info.CommitID)
223223
return nil
224224
},
225225
}

cmd/execute_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010

1111
// TestExecuteCommandArgumentParsing tests the argument parsing logic for execute.
1212
// The logic uses LooksLikeVMTarget to decide if the first arg is a VM or a command:
13-
// - UUID treated as VM target
14-
// - Known alias treated as VM target
15-
// - Anything else treated as command, uses HEAD
13+
// - UUID -> treated as VM target
14+
// - Known alias -> treated as VM target
15+
// - Anything else -> treated as command, uses HEAD
1616
func TestExecuteCommandArgumentParsing(t *testing.T) {
1717
tests := []struct {
1818
name string

cmd/login.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func loginWithGit() error {
8484
fmt.Print("Looking up git email... ")
8585
email, err := auth.GetGitEmail()
8686
if err != nil {
87-
fmt.Println("")
87+
fmt.Println("failed")
8888
return err
8989
}
9090
fmt.Println(email)
@@ -93,7 +93,7 @@ func loginWithGit() error {
9393
fmt.Print("Looking up SSH public key... ")
9494
sshPubKey, _, err := auth.FindSSHPublicKey()
9595
if err != nil {
96-
fmt.Println("")
96+
fmt.Println("failed")
9797
return err
9898
}
9999
// Show truncated key for confirmation
@@ -116,7 +116,7 @@ func loginWithGit() error {
116116

117117
if initResp.AlreadyVerified {
118118
// Key is already verified — skip email, go straight to verify-key for org list
119-
fmt.Println("SSH key already verified")
119+
fmt.Println("SSH key already verified")
120120
verifyResp, err = auth.ShellAuthCheckVerification(email, sshPubKey)
121121
if err != nil {
122122
return fmt.Errorf("failed to fetch org list: %w", err)
@@ -127,16 +127,16 @@ func loginWithGit() error {
127127
}
128128

129129
// Step 4: Wait for email verification
130-
fmt.Printf("\n📧 Verification email sent to %s\n", email)
130+
fmt.Printf("\nVerification email sent to %s\n", email)
131131
fmt.Println(" Click the link in the email to continue.")
132132
fmt.Print(" Waiting for verification...")
133133

134134
verifyResp, err = auth.ShellAuthPollVerification(email, sshPubKey, 10*time.Minute)
135135
if err != nil {
136-
fmt.Println(" ")
136+
fmt.Println(" failed")
137137
return err
138138
}
139-
fmt.Println(" ")
139+
fmt.Println(" ok")
140140
}
141141

142142
// Step 5: Select organization
@@ -176,23 +176,23 @@ func loginWithGit() error {
176176
fmt.Print("Creating API key... ")
177177
keyResp, err := auth.ShellAuthCreateAPIKey(email, sshPubKey, label, orgName)
178178
if err != nil {
179-
fmt.Println("")
179+
fmt.Println("failed")
180180
return fmt.Errorf("failed to create API key: %w", err)
181181
}
182-
fmt.Println("")
182+
fmt.Println("ok")
183183

184184
// Step 7: Validate and save
185185
fmt.Print("Validating API key... ")
186186
if err := validateAPIKey(keyResp.APIKey); err != nil {
187-
fmt.Println("")
187+
fmt.Println("failed")
188188
return err
189189
}
190190

191191
if err := auth.SaveAPIKey(keyResp.APIKey); err != nil {
192192
return fmt.Errorf("error saving API key: %w", err)
193193
}
194194

195-
fmt.Printf("\n✓ Successfully authenticated with Vers (org: %s)\n", keyResp.OrgName)
195+
fmt.Printf("\nSuccessfully authenticated with Vers (org: %s)\n", keyResp.OrgName)
196196
return nil
197197
}
198198

cmd/repo.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var repoCreateCmd = &cobra.Command{
3636
if err != nil {
3737
return err
3838
}
39-
fmt.Printf("Repository '%s' created (%s)\n", resp.Name, resp.RepoID)
39+
fmt.Printf("Repository '%s' created (%s)\n", resp.Name, resp.RepoID)
4040
return nil
4141
},
4242
}
@@ -138,13 +138,13 @@ Examples:
138138
Name: name,
139139
})
140140
if err != nil {
141-
fmt.Fprintf(cmd.ErrOrStderr(), "✗ Failed to delete repository '%s': %v\n", name, err)
141+
fmt.Fprintf(cmd.ErrOrStderr(), "error: failed to delete repository '%s': %v\n", name, err)
142142
if firstErr == nil {
143143
firstErr = err
144144
}
145145
continue
146146
}
147-
fmt.Printf("Repository '%s' deleted\n", name)
147+
fmt.Printf("Repository '%s' deleted\n", name)
148148
}
149149
return firstErr
150150
},
@@ -179,7 +179,7 @@ Examples:
179179
if repoVisibilityPublic {
180180
vis = "public"
181181
}
182-
fmt.Printf("Repository '%s' is now %s\n", args[0], vis)
182+
fmt.Printf("Repository '%s' is now %s\n", args[0], vis)
183183
return nil
184184
},
185185
}
@@ -220,7 +220,7 @@ Examples:
220220
if err != nil {
221221
return err
222222
}
223-
fmt.Printf("Forked %s\n", resp.Reference)
223+
fmt.Printf("Forked -> %s\n", resp.Reference)
224224
fmt.Printf(" VM: %s\n", resp.VmID)
225225
fmt.Printf(" Commit: %s\n", resp.CommitID)
226226
return nil
@@ -255,7 +255,7 @@ var repoTagCreateCmd = &cobra.Command{
255255
if err != nil {
256256
return err
257257
}
258-
fmt.Printf("Tag created %s\n", resp.Reference)
258+
fmt.Printf("Tag created -> %s\n", resp.Reference)
259259
return nil
260260
},
261261
}
@@ -362,7 +362,7 @@ var repoTagUpdateCmd = &cobra.Command{
362362
if err != nil {
363363
return err
364364
}
365-
fmt.Printf("Tag '%s' in '%s' updated\n", args[1], args[0])
365+
fmt.Printf("Tag '%s' in '%s' updated\n", args[1], args[0])
366366
return nil
367367
},
368368
}
@@ -390,13 +390,13 @@ Examples:
390390
TagName: name,
391391
})
392392
if err != nil {
393-
fmt.Fprintf(cmd.ErrOrStderr(), "✗ Failed to delete tag '%s': %v\n", name, err)
393+
fmt.Fprintf(cmd.ErrOrStderr(), "error: failed to delete tag '%s': %v\n", name, err)
394394
if firstErr == nil {
395395
firstErr = err
396396
}
397397
continue
398398
}
399-
fmt.Printf("Tag '%s' deleted from '%s'\n", name, repoName)
399+
fmt.Printf("Tag '%s' deleted from '%s'\n", name, repoName)
400400
}
401401
return firstErr
402402
},

cmd/resize.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Use --format json for machine-readable output.`,
4444
case pres.FormatJSON:
4545
pres.PrintJSON(map[string]interface{}{"vm_id": vmID, "fs_size_mib": resizeDiskSize})
4646
default:
47-
fmt.Printf("Disk resized to %d MiB for VM %s\n", resizeDiskSize, vmID)
47+
fmt.Printf("Disk resized to %d MiB for VM %s\n", resizeDiskSize, vmID)
4848
}
4949
return nil
5050
},

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ interaction capabilities, and more.`,
187187
DebugPrint("Checking for updates...\n")
188188
hasUpdate, latestVersion, err := update.CheckForUpdates(Version, Repository, verbose)
189189
if err == nil && hasUpdate {
190-
fmt.Printf("💡 Update available: %s -> %s (run 'vers upgrade')\n\n", Version, latestVersion)
190+
fmt.Printf("note: update available: %s -> %s (run 'vers upgrade')\n\n", Version, latestVersion)
191191
}
192192
}()
193193
}

cmd/signup.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func signupWithGit() error {
2828
var err error
2929
email, err = auth.GetGitEmail()
3030
if err != nil {
31-
fmt.Println("")
31+
fmt.Println("failed")
3232
return err
3333
}
3434
fmt.Println(email)
@@ -38,7 +38,7 @@ func signupWithGit() error {
3838
fmt.Print("Looking up SSH public key... ")
3939
sshPubKey, sshKeyPath, err := auth.FindSSHPublicKey()
4040
if err != nil {
41-
fmt.Println("")
41+
fmt.Println("failed")
4242
return err
4343
}
4444
// Show truncated key for confirmation
@@ -61,7 +61,7 @@ func signupWithGit() error {
6161

6262
if initResp.AlreadyVerified {
6363
// Key is already verified — skip email, go straight to verify-key for org list
64-
fmt.Println("SSH key already verified")
64+
fmt.Println("SSH key already verified")
6565
verifyResp, err = auth.ShellAuthCheckVerification(email, sshPubKey)
6666
if err != nil {
6767
return fmt.Errorf("failed to fetch org list: %w", err)
@@ -72,16 +72,16 @@ func signupWithGit() error {
7272
}
7373

7474
// Step 4: Wait for email verification
75-
fmt.Printf("\n📧 Verification email sent to %s\n", email)
75+
fmt.Printf("\nVerification email sent to %s\n", email)
7676
fmt.Println(" Click the link in the email to continue.")
7777
fmt.Print(" Waiting for verification...")
7878

7979
verifyResp, err = auth.ShellAuthPollVerification(email, sshPubKey, 10*time.Minute)
8080
if err != nil {
81-
fmt.Println(" ")
81+
fmt.Println(" failed")
8282
return err
8383
}
84-
fmt.Println(" ")
84+
fmt.Println(" ok")
8585
}
8686

8787
// Step 5: Select organization
@@ -127,15 +127,15 @@ func signupWithGit() error {
127127
fmt.Print("Creating API key... ")
128128
keyResp, err := auth.ShellAuthCreateAPIKey(email, sshPubKey, label, orgName)
129129
if err != nil {
130-
fmt.Println("")
130+
fmt.Println("failed")
131131
return fmt.Errorf("failed to create API key: %w", err)
132132
}
133-
fmt.Println("")
133+
fmt.Println("ok")
134134

135135
// Step 7: Validate and save
136136
fmt.Print("Validating API key... ")
137137
if err := validateAPIKey(keyResp.APIKey); err != nil {
138-
fmt.Println("")
138+
fmt.Println("failed")
139139
return err
140140
}
141141

@@ -150,7 +150,7 @@ func signupWithGit() error {
150150
return fmt.Errorf("error saving config: %w", err)
151151
}
152152

153-
fmt.Printf("\n✓ Successfully authenticated with Vers (org: %s)\n", keyResp.OrgName)
153+
fmt.Printf("\nSuccessfully authenticated with Vers (org: %s)\n", keyResp.OrgName)
154154
return nil
155155
}
156156

@@ -181,16 +181,16 @@ If you already have an account, this will log you in.`,
181181

182182
fmt.Print("Validating API key... ")
183183
if err := validateAPIKey(apiKey); err != nil {
184-
fmt.Println("")
184+
fmt.Println("failed")
185185
return err
186186
}
187-
fmt.Println("")
187+
fmt.Println("ok")
188188

189189
if err := auth.SaveAPIKey(apiKey); err != nil {
190190
return fmt.Errorf("error saving API key: %w", err)
191191
}
192192

193-
fmt.Println("\n✓ Successfully authenticated with Vers")
193+
fmt.Println("\nSuccessfully authenticated with Vers")
194194
return nil
195195
},
196196
}

cmd/tag.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var tagCreateCmd = &cobra.Command{
3535
if err != nil {
3636
return err
3737
}
38-
fmt.Printf("Tag '%s' created %s\n", resp.TagName, resp.CommitID)
38+
fmt.Printf("Tag '%s' created -> %s\n", resp.TagName, resp.CommitID)
3939
return nil
4040
},
4141
}
@@ -138,7 +138,7 @@ var tagUpdateCmd = &cobra.Command{
138138
if err != nil {
139139
return err
140140
}
141-
fmt.Printf("Tag '%s' updated\n", args[0])
141+
fmt.Printf("Tag '%s' updated\n", args[0])
142142
return nil
143143
},
144144
}
@@ -163,13 +163,13 @@ Examples:
163163
TagName: name,
164164
})
165165
if err != nil {
166-
fmt.Fprintf(cmd.ErrOrStderr(), "✗ Failed to delete tag '%s': %v\n", name, err)
166+
fmt.Fprintf(cmd.ErrOrStderr(), "error: failed to delete tag '%s': %v\n", name, err)
167167
if firstErr == nil {
168168
firstErr = err
169169
}
170170
continue
171171
}
172-
fmt.Printf("Tag '%s' deleted\n", name)
172+
fmt.Printf("Tag '%s' deleted\n", name)
173173
}
174174
return firstErr
175175
},

internal/auth/keys.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ func GetOrCreateSSHKey(vmID string, client *vers.Client, apiCtx context.Context)
5252
return "", fmt.Errorf("failed to save SSH key: %w", err)
5353
}
5454

55-
fmt.Println("SSH key cached")
55+
fmt.Println("SSH key cached")
5656
return keyPath, nil
5757
}

internal/handlers/kill.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ func HandleKill(ctx context.Context, a *app.App, r KillReq) error {
4343
var allDeleted []string
4444

4545
for i, target := range targets {
46-
// Resolve alias ID
46+
// Resolve alias -> ID
4747
vmInfo, err := utils.ResolveVMIdentifier(ctx, a.Client, target)
4848
if err != nil {
49-
fmt.Fprintf(a.IO.Err, "✗ Failed to resolve '%s': %v\n", target, err)
49+
fmt.Fprintf(a.IO.Err, "error: failed to resolve '%s': %v\n", target, err)
5050
if firstErr == nil {
5151
firstErr = err
5252
}
@@ -57,7 +57,7 @@ func HandleKill(ctx context.Context, a *app.App, r KillReq) error {
5757

5858
deletedID, err := delsvc.DeleteVM(ctx, a.Client, vmInfo.ID)
5959
if err != nil {
60-
fmt.Fprintf(a.IO.Err, "✗ Failed to delete '%s': %v\n", vmInfo.DisplayName, err)
60+
fmt.Fprintf(a.IO.Err, "error: failed to delete '%s': %v\n", vmInfo.DisplayName, err)
6161
if firstErr == nil {
6262
firstErr = err
6363
}

0 commit comments

Comments
 (0)