Skip to content

Commit afb13f6

Browse files
authored
Rename whoami to status (#67)
1 parent 863f334 commit afb13f6

File tree

7 files changed

+33
-33
lines changed

7 files changed

+33
-33
lines changed

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Tiger CLI is a Go-based command-line interface for managing Tiger, the modern da
149149
- **Entry Point**: `cmd/tiger/main.go` - Simple main that delegates to cmd.Execute()
150150
- **Command Structure**: `internal/tiger/cmd/` - Cobra-based command definitions
151151
- `root.go` - Root command with global flags and configuration initialization
152-
- `auth.go` - Authentication commands (login, logout, whoami)
152+
- `auth.go` - Authentication commands (login, logout, status)
153153
- `service.go` - Service management commands (list, create, get, fork, delete, update-password)
154154
- `db.go` - Database operation commands (connection-string, connect, test-connection)
155155
- `config.go` - Configuration management commands (show, set, unset, reset)
@@ -377,7 +377,7 @@ buildRootCmd() → Complete CLI with all commands and flags
377377
├── buildAuthCmd()
378378
│ ├── buildLoginCmd()
379379
│ ├── buildLogoutCmd()
380-
│ └── buildWhoamiCmd()
380+
│ └── buildStatusCmd()
381381
├── buildServiceCmd()
382382
│ ├── buildServiceListCmd()
383383
│ ├── buildServiceGetCmd()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Tiger CLI provides the following commands:
8080
- `tiger auth` - Authentication management
8181
- `login` - Log in to your Tiger account
8282
- `logout` - Log out from your Tiger account
83-
- `whoami` - Show current authentication status
83+
- `status` - Show current authentication status
8484
- `tiger service` - Service lifecycle management
8585
- `list` - List all services
8686
- `create` - Create a new service

internal/tiger/cmd/auth.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,19 @@ func buildLogoutCmd() *cobra.Command {
171171
}
172172
}
173173

174-
func buildWhoamiCmd() *cobra.Command {
174+
func buildStatusCmd() *cobra.Command {
175175
return &cobra.Command{
176-
Use: "whoami",
177-
Short: "Show current user information",
178-
Long: `Show information about the currently authenticated user.`,
176+
Use: "status",
177+
Short: "Show current auth information",
178+
Long: `Show information about the currently authenticated token.`,
179179
RunE: func(cmd *cobra.Command, args []string) error {
180180
cmd.SilenceUsage = true
181181

182182
if _, err := config.GetAPIKey(); err != nil {
183183
return err
184184
}
185185

186-
// TODO: Make API call to get user information
186+
// TODO: Make API call to get token information
187187
fmt.Fprintln(cmd.OutOrStdout(), "Logged in (API key stored)")
188188

189189
return nil
@@ -200,7 +200,7 @@ func buildAuthCmd() *cobra.Command {
200200

201201
cmd.AddCommand(buildLoginCmd())
202202
cmd.AddCommand(buildLogoutCmd())
203-
cmd.AddCommand(buildWhoamiCmd())
203+
cmd.AddCommand(buildStatusCmd())
204204

205205
return cmd
206206
}

internal/tiger/cmd/auth_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -583,13 +583,13 @@ func TestAuthLogin_KeyringFallback(t *testing.T) {
583583
t.Errorf("Expected API key '%s', got '%s'", expectedAPIKey, storedKey)
584584
}
585585

586-
// Test whoami with file-only storage
587-
output, err = executeAuthCommand("auth", "whoami")
586+
// Test status with file-only storage
587+
output, err = executeAuthCommand("auth", "status")
588588
if err != nil {
589-
t.Fatalf("Whoami failed with file storage: %v", err)
589+
t.Fatalf("Status failed with file storage: %v", err)
590590
}
591591
if output != "Logged in (API key stored)\n" {
592-
t.Errorf("Unexpected whoami output: '%s'", output)
592+
t.Errorf("Unexpected status output: '%s'", output)
593593
}
594594

595595
// Test logout with file-only storage
@@ -666,7 +666,7 @@ func TestAuthLogin_EnvironmentVariable_FileOnly(t *testing.T) {
666666
}
667667
}
668668

669-
func TestAuthWhoami_LoggedIn(t *testing.T) {
669+
func TestAuthStatus_LoggedIn(t *testing.T) {
670670
setupAuthTest(t)
671671

672672
// Store API key first
@@ -675,24 +675,24 @@ func TestAuthWhoami_LoggedIn(t *testing.T) {
675675
t.Fatalf("Failed to store API key: %v", err)
676676
}
677677

678-
// Execute whoami command
679-
output, err := executeAuthCommand("auth", "whoami")
678+
// Execute status command
679+
output, err := executeAuthCommand("auth", "status")
680680
if err != nil {
681-
t.Fatalf("Whoami failed: %v", err)
681+
t.Fatalf("Status failed: %v", err)
682682
}
683683

684684
if output != "Logged in (API key stored)\n" {
685685
t.Errorf("Unexpected output: '%s' (len=%d)", output, len(output))
686686
}
687687
}
688688

689-
func TestAuthWhoami_NotLoggedIn(t *testing.T) {
689+
func TestAuthStatus_NotLoggedIn(t *testing.T) {
690690
setupAuthTest(t)
691691

692-
// Execute whoami command without being logged in
693-
_, err := executeAuthCommand("auth", "whoami")
692+
// Execute status command without being logged in
693+
_, err := executeAuthCommand("auth", "status")
694694
if err == nil {
695-
t.Fatal("Expected whoami to fail when not logged in")
695+
t.Fatal("Expected status to fail when not logged in")
696696
}
697697

698698
// Error should indicate not logged in

internal/tiger/cmd/integration_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func executeIntegrationCommand(args ...string) (string, error) {
8181
}
8282

8383
// TestServiceLifecycleIntegration tests the complete authentication and service lifecycle:
84-
// login -> whoami -> create -> get -> update-password -> delete -> logout
84+
// login -> status -> create -> get -> update-password -> delete -> logout
8585
func TestServiceLifecycleIntegration(t *testing.T) {
8686
config.SetTestServiceName(t)
8787
// Check for required environment variables
@@ -148,12 +148,12 @@ func TestServiceLifecycleIntegration(t *testing.T) {
148148
t.Logf("Login successful")
149149
})
150150

151-
t.Run("WhoAmI", func(t *testing.T) {
151+
t.Run("Status", func(t *testing.T) {
152152
t.Logf("Verifying authentication status")
153153

154-
output, err := executeIntegrationCommand("auth", "whoami")
154+
output, err := executeIntegrationCommand("auth", "status")
155155
if err != nil {
156-
t.Fatalf("WhoAmI failed: %v\nOutput: %s", err, output)
156+
t.Fatalf("Status failed: %v\nOutput: %s", err, output)
157157
}
158158

159159
// Should not say "Not logged in"
@@ -433,10 +433,10 @@ func TestServiceLifecycleIntegration(t *testing.T) {
433433
t.Run("VerifyLoggedOut", func(t *testing.T) {
434434
t.Logf("Verifying we're logged out")
435435

436-
output, err := executeIntegrationCommand("auth", "whoami")
436+
output, err := executeIntegrationCommand("auth", "status")
437437
// This should either fail or say "Not logged in"
438438
if err == nil && !strings.Contains(output, "Not logged in") {
439-
t.Errorf("Expected to be logged out, but whoami succeeded: %s", output)
439+
t.Errorf("Expected to be logged out, but status succeeded: %s", output)
440440
}
441441

442442
t.Logf("Verified logged out status")

specs/spec.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ For the initial v0 release, implement these essential commands first:
6868
**Authentication:**
6969
- `tiger auth login` - Token-based authentication
7070
- `tiger auth logout` - Remove stored credentials
71-
- `tiger auth whoami` - Show current user
71+
- `tiger auth status` - Show current user
7272
7373
**Core Service Management:**
7474
- `tiger service list` - List all services
@@ -105,7 +105,7 @@ Manage authentication and credentials (token-based only).
105105
**Subcommands:**
106106
- `login`: Authenticate with API token
107107
- `logout`: Remove stored credentials
108-
- `whoami`: Show current user information
108+
- `status`: Show current user information
109109
110110
**Examples:**
111111
```bash
@@ -125,7 +125,7 @@ tiger auth login
125125
tiger auth login
126126
127127
# Show current user
128-
tiger auth whoami
128+
tiger auth status
129129
130130
# Logout
131131
tiger auth logout

specs/spec_after_oauth.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Manage authentication and credentials with OAuth support.
1010
**Subcommands:**
1111
- `login`: Authenticate with TigerData Cloud (OAuth flow)
1212
- `logout`: Remove stored credentials
13-
- `whoami`: Show current user information
13+
- `status`: Show current user information
1414
- `token`: Manage API tokens
1515

1616
**Examples:**
@@ -21,8 +21,8 @@ tiger auth login
2121
# Web-based OAuth authentication
2222
tiger auth login --web
2323

24-
# Show current user
25-
tiger auth whoami
24+
# Show current token status
25+
tiger auth status
2626

2727
# Logout and clear credentials
2828
tiger auth logout

0 commit comments

Comments
 (0)