Skip to content

Commit f8a46b9

Browse files
Rename service describe/show to get
1 parent e8f0a89 commit f8a46b9

File tree

8 files changed

+75
-72
lines changed

8 files changed

+75
-72
lines changed

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Tiger CLI is a Go-based command-line interface for managing Tiger, the modern da
150150
- **Command Structure**: `internal/tiger/cmd/` - Cobra-based command definitions
151151
- `root.go` - Root command with global flags and configuration initialization
152152
- `auth.go` - Authentication commands (login, logout, whoami)
153-
- `service.go` - Service management commands (list, create, describe, fork, delete, update-password)
153+
- `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)
156156
- `mcp.go` - MCP server commands (install, start)
@@ -160,7 +160,7 @@ Tiger CLI is a Go-based command-line interface for managing Tiger, the modern da
160160
- **API Client**: `internal/tiger/api/` - Generated OpenAPI client with mocks
161161
- **MCP Server**: `internal/tiger/mcp/` - Model Context Protocol server implementation
162162
- `server.go` - MCP server initialization, tool registration, and lifecycle management
163-
- `service_tools.go` - Service management tools (list, show, create, update-password)
163+
- `service_tools.go` - Service management tools (list, get, create, update-password)
164164
- `db_tools.go` - Database operation tools (execute-query)
165165
- `proxy.go` - Proxy client that forwards tools/resources/prompts from remote docs MCP server
166166
- **Password Storage**: `internal/tiger/password/` - Secure password storage utilities

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Tiger CLI provides the following commands:
8484
- `tiger service` - Service lifecycle management
8585
- `list` - List all services
8686
- `create` - Create a new service
87-
- `describe` - Show detailed service information
87+
- `get` - Show detailed service information (aliases: `describe`, `show`)
8888
- `fork` - Fork an existing service
8989
- `delete` - Delete a service
9090
- `update-password` - Update service master password
@@ -162,7 +162,7 @@ The MCP server exposes the following tools to AI assistants:
162162

163163
**Service Management:**
164164
- `service_list` - List all database services in your project
165-
- `service_show` - Show detailed information about a specific service
165+
- `service_get` - Get detailed information about a specific service
166166
- `service_create` - Create new database services with configurable resources
167167
- `service_update_password` - Update the master password for a service
168168

internal/tiger/cmd/integration_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,22 +214,22 @@ func TestServiceLifecycleIntegration(t *testing.T) {
214214
}
215215
})
216216

217-
t.Run("DescribeService", func(t *testing.T) {
217+
t.Run("GetService", func(t *testing.T) {
218218
if serviceID == "" {
219219
t.Skip("No service ID available from create test")
220220
}
221221

222-
t.Logf("Describing service: %s", serviceID)
222+
t.Logf("Getting service details: %s", serviceID)
223223

224224
output, err := executeIntegrationCommand(
225-
"service", "describe", serviceID,
225+
"service", "get", serviceID,
226226
"--output", "json",
227227
)
228228

229-
t.Logf("Raw service describe output: %s", output)
229+
t.Logf("Raw service get output: %s", output)
230230

231231
if err != nil {
232-
t.Fatalf("Service describe failed: %v\nOutput: %s", err, output)
232+
t.Fatalf("Service get failed: %v\nOutput: %s", err, output)
233233
}
234234

235235
// Parse JSON to verify service details
@@ -388,14 +388,14 @@ func TestServiceLifecycleIntegration(t *testing.T) {
388388

389389
t.Logf("Verifying service %s no longer exists", deletedServiceID)
390390

391-
// Try to describe the deleted service - should fail
391+
// Try to get the deleted service - should fail
392392
output, err := executeIntegrationCommand(
393-
"service", "describe", deletedServiceID,
393+
"service", "get", deletedServiceID,
394394
)
395395

396396
// We expect this to fail since the service should be deleted
397397
if err == nil {
398-
t.Errorf("Expected service describe to fail for deleted service, but got output: %s", output)
398+
t.Errorf("Expected service get to fail for deleted service, but got output: %s", output)
399399
}
400400

401401
// Check that error indicates service not found
@@ -531,8 +531,8 @@ func TestServiceNotFound(t *testing.T) {
531531
reason string
532532
}{
533533
{
534-
name: "service describe",
535-
args: []string{"service", "describe", nonExistentServiceID},
534+
name: "service get",
535+
args: []string{"service", "get", nonExistentServiceID},
536536
expectedExitCode: ExitServiceNotFound,
537537
},
538538
{
@@ -703,8 +703,8 @@ func TestAuthenticationErrorsIntegration(t *testing.T) {
703703
args: []string{"service", "list", "--project-id", projectID},
704704
},
705705
{
706-
name: "service describe",
707-
args: []string{"service", "describe", "non-existent-service", "--project-id", projectID},
706+
name: "service get",
707+
args: []string{"service", "get", "non-existent-service", "--project-id", projectID},
708708
},
709709
{
710710
name: "service create",

internal/tiger/cmd/service.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func buildServiceCmd() *cobra.Command {
3434
}
3535

3636
// Add all subcommands
37-
cmd.AddCommand(buildServiceDescribeCmd())
37+
cmd.AddCommand(buildServiceGetCmd())
3838
cmd.AddCommand(buildServiceListCmd())
3939
cmd.AddCommand(buildServiceCreateCmd())
4040
cmd.AddCommand(buildServiceDeleteCmd())
@@ -44,31 +44,32 @@ func buildServiceCmd() *cobra.Command {
4444
return cmd
4545
}
4646

47-
// serviceDescribeCmd represents the describe command under service
48-
func buildServiceDescribeCmd() *cobra.Command {
47+
// buildServiceGetCmd represents the get command under service
48+
func buildServiceGetCmd() *cobra.Command {
4949
var withPassword bool
5050

5151
cmd := &cobra.Command{
52-
Use: "describe [service-id]",
53-
Short: "Show detailed information about a service",
52+
Use: "get [service-id]",
53+
Aliases: []string{"describe", "show"},
54+
Short: "Show detailed information about a service",
5455
Long: `Show detailed information about a specific database service.
5556
5657
The service ID can be provided as an argument or will use the default service
5758
from your configuration. This command displays comprehensive information about
5859
the service including configuration, status, endpoints, and resource usage.
5960
6061
Examples:
61-
# Describe default service
62-
tiger service describe
62+
# Get default service details
63+
tiger service get
6364
64-
# Describe specific service
65-
tiger service describe svc-12345
65+
# Get specific service details
66+
tiger service get svc-12345
6667
6768
# Get service details in JSON format
68-
tiger service describe svc-12345 --output json
69+
tiger service get svc-12345 --output json
6970
7071
# Get service details in YAML format
71-
tiger service describe svc-12345 --output yaml`,
72+
tiger service get svc-12345 --output yaml`,
7273
RunE: func(cmd *cobra.Command, args []string) error {
7374
// Get config
7475
cfg, err := config.Load()

internal/tiger/cmd/service_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ func TestAutoGeneratedServiceName(t *testing.T) {
558558
}
559559
}
560560

561-
func TestServiceDescribe_NoServiceID(t *testing.T) {
561+
func TestServiceGet_NoServiceID(t *testing.T) {
562562
tmpDir := setupServiceTest(t)
563563

564564
// Set up config with project ID but no default service ID
@@ -577,8 +577,8 @@ func TestServiceDescribe_NoServiceID(t *testing.T) {
577577
}
578578
defer func() { getAPIKeyForService = originalGetAPIKey }()
579579

580-
// Execute service describe command without service ID
581-
_, err, _ = executeServiceCommand("service", "describe")
580+
// Execute service get command without service ID
581+
_, err, _ = executeServiceCommand("service", "get")
582582
if err == nil {
583583
t.Fatal("Expected error when no service ID is provided or configured")
584584
}
@@ -588,7 +588,7 @@ func TestServiceDescribe_NoServiceID(t *testing.T) {
588588
}
589589
}
590590

591-
func TestServiceDescribe_NoAuth(t *testing.T) {
591+
func TestServiceGet_NoAuth(t *testing.T) {
592592
tmpDir := setupServiceTest(t)
593593

594594
// Set up config with project ID and service ID
@@ -608,8 +608,8 @@ func TestServiceDescribe_NoAuth(t *testing.T) {
608608
}
609609
defer func() { getAPIKeyForService = originalGetAPIKey }()
610610

611-
// Execute service describe command
612-
_, err, _ = executeServiceCommand("service", "describe")
611+
// Execute service get command
612+
_, err, _ = executeServiceCommand("service", "get")
613613
if err == nil {
614614
t.Fatal("Expected error when not authenticated")
615615
}

internal/tiger/mcp/service_tools.go

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -79,24 +79,24 @@ func setServiceIDSchemaProperties(schema *jsonschema.Schema) {
7979
schema.Properties["service_id"].Pattern = "^[a-z0-9]{10}$"
8080
}
8181

82-
// ServiceShowInput represents input for service_show
83-
type ServiceShowInput struct {
82+
// ServiceGetInput represents input for service_get
83+
type ServiceGetInput struct {
8484
ServiceID string `json:"service_id"`
8585
}
8686

87-
func (ServiceShowInput) Schema() *jsonschema.Schema {
88-
schema := util.Must(jsonschema.For[ServiceShowInput](nil))
87+
func (ServiceGetInput) Schema() *jsonschema.Schema {
88+
schema := util.Must(jsonschema.For[ServiceGetInput](nil))
8989
setServiceIDSchemaProperties(schema)
9090
return schema
9191
}
9292

93-
// ServiceShowOutput represents output for service_show
94-
type ServiceShowOutput struct {
93+
// ServiceGetOutput represents output for service_get
94+
type ServiceGetOutput struct {
9595
Service ServiceDetail `json:"service"`
9696
}
9797

98-
func (ServiceShowOutput) Schema() *jsonschema.Schema {
99-
return util.Must(jsonschema.For[ServiceShowOutput](nil))
98+
func (ServiceGetOutput) Schema() *jsonschema.Schema {
99+
return util.Must(jsonschema.For[ServiceGetOutput](nil))
100100
}
101101

102102
// ServiceDetail represents detailed service information
@@ -231,19 +231,19 @@ func (s *Server) registerServiceTools() {
231231
},
232232
}, s.handleServiceList)
233233

234-
// service_show
234+
// service_get
235235
mcp.AddTool(s.mcpServer, &mcp.Tool{
236-
Name: "service_show",
237-
Title: "Show Service Details",
236+
Name: "service_get",
237+
Title: "Get Service Details",
238238
Description: "Get detailed information for a specific database service. " +
239239
"Returns connection endpoints, replica configuration, resource allocation, creation time, and status.",
240-
InputSchema: ServiceShowInput{}.Schema(),
241-
OutputSchema: ServiceShowOutput{}.Schema(),
240+
InputSchema: ServiceGetInput{}.Schema(),
241+
OutputSchema: ServiceGetOutput{}.Schema(),
242242
Annotations: &mcp.ToolAnnotations{
243243
ReadOnlyHint: true,
244-
Title: "Show Service Details",
244+
Title: "Get Service Details",
245245
},
246-
}, s.handleServiceShow)
246+
}, s.handleServiceGet)
247247

248248
// service_create
249249
mcp.AddTool(s.mcpServer, &mcp.Tool{
@@ -333,21 +333,21 @@ func (s *Server) handleServiceList(ctx context.Context, req *mcp.CallToolRequest
333333
}
334334
}
335335

336-
// handleServiceShow handles the service_show MCP tool
337-
func (s *Server) handleServiceShow(ctx context.Context, req *mcp.CallToolRequest, input ServiceShowInput) (*mcp.CallToolResult, ServiceShowOutput, error) {
336+
// handleServiceGet handles the service_get MCP tool
337+
func (s *Server) handleServiceGet(ctx context.Context, req *mcp.CallToolRequest, input ServiceGetInput) (*mcp.CallToolResult, ServiceGetOutput, error) {
338338
// Load config and validate project ID
339339
cfg, err := s.loadConfigWithProjectID()
340340
if err != nil {
341-
return nil, ServiceShowOutput{}, err
341+
return nil, ServiceGetOutput{}, err
342342
}
343343

344344
// Create fresh API client with current credentials
345345
apiClient, err := s.createAPIClient()
346346
if err != nil {
347-
return nil, ServiceShowOutput{}, err
347+
return nil, ServiceGetOutput{}, err
348348
}
349349

350-
logging.Debug("MCP: Showing service details",
350+
logging.Debug("MCP: Getting service details",
351351
zap.String("project_id", cfg.ProjectID),
352352
zap.String("service_id", input.ServiceID))
353353

@@ -357,31 +357,31 @@ func (s *Server) handleServiceShow(ctx context.Context, req *mcp.CallToolRequest
357357

358358
resp, err := apiClient.GetProjectsProjectIdServicesServiceIdWithResponse(ctx, cfg.ProjectID, input.ServiceID)
359359
if err != nil {
360-
return nil, ServiceShowOutput{}, fmt.Errorf("failed to get service details: %w", err)
360+
return nil, ServiceGetOutput{}, fmt.Errorf("failed to get service details: %w", err)
361361
}
362362

363363
// Handle API response
364364
switch resp.StatusCode() {
365365
case 200:
366366
if resp.JSON200 == nil {
367-
return nil, ServiceShowOutput{}, fmt.Errorf("empty response from API")
367+
return nil, ServiceGetOutput{}, fmt.Errorf("empty response from API")
368368
}
369369

370370
service := *resp.JSON200
371-
output := ServiceShowOutput{
371+
output := ServiceGetOutput{
372372
Service: s.convertToServiceDetail(service),
373373
}
374374

375375
return nil, output, nil
376376

377377
case 401:
378-
return nil, ServiceShowOutput{}, fmt.Errorf("authentication failed: invalid API key")
378+
return nil, ServiceGetOutput{}, fmt.Errorf("authentication failed: invalid API key")
379379
case 403:
380-
return nil, ServiceShowOutput{}, fmt.Errorf("permission denied: insufficient access to service")
380+
return nil, ServiceGetOutput{}, fmt.Errorf("permission denied: insufficient access to service")
381381
case 404:
382-
return nil, ServiceShowOutput{}, fmt.Errorf("service '%s' not found in project '%s'", input.ServiceID, cfg.ProjectID)
382+
return nil, ServiceGetOutput{}, fmt.Errorf("service '%s' not found in project '%s'", input.ServiceID, cfg.ProjectID)
383383
default:
384-
return nil, ServiceShowOutput{}, fmt.Errorf("API request failed with status %d", resp.StatusCode())
384+
return nil, ServiceGetOutput{}, fmt.Errorf("API request failed with status %d", resp.StatusCode())
385385
}
386386
}
387387

specs/spec.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ For the initial v0 release, implement these essential commands first:
7373
7474
**Core Service Management:**
7575
- `tiger service list` - List all services
76-
- `tiger service describe` - Show service details
76+
- `tiger service get` - Show service details (aliases: `describe`, `show`)
7777
- `tiger service create` - Create new services
7878
- `tiger service delete` - Delete services with confirmation
7979
- `tiger service update-password` - Update service master password
@@ -172,7 +172,7 @@ Manage database services.
172172

173173
**Subcommands:**
174174
- `list`: List all services
175-
- `describe`: Show service details
175+
- `get`: Show service details (aliases: `describe`, `show`)
176176
- `create`: Create a new service
177177
- `delete`: Delete a service
178178
- `start`: Start a service
@@ -207,9 +207,11 @@ tiger service list
207207
tiger services list
208208
tiger svc list
209209

210-
# Show service details
211-
tiger service describe svc-12345
212-
tiger svc describe svc-12345
210+
# Show service details (all forms work)
211+
tiger service get svc-12345
212+
tiger service describe svc-12345 # alias
213+
tiger service show svc-12345 # alias
214+
tiger svc get svc-12345
213215

214216
# Create a TimescaleDB service
215217
tiger service create \
@@ -685,7 +687,7 @@ svc-12345 production-db running production
685687
Errors are returned with descriptive messages and appropriate exit codes:
686688

687689
```bash
688-
$ tiger service describe invalid-id
690+
$ tiger service get invalid-id
689691
Error: Service 'invalid-id' not found in project 'proj-12345'
690692
Use 'tiger service list' to see available services.
691693
```
@@ -795,7 +797,7 @@ tiger db connection-string svc-12345
795797
### Monitoring and Maintenance
796798
```bash
797799
# Check service status
798-
tiger service describe svc-12345
800+
tiger service get svc-12345
799801

800802
# Update service password
801803
tiger service update-password svc-12345 --password new-secure-password
@@ -811,7 +813,7 @@ Commands follow consistent patterns for specifying service IDs:
811813
**Single-service commands** (verbs acting on one service):
812814
- Use positional `<service-id>` as the canonical parameter
813815
- Support `--service-id` flag as an alias/override
814-
- Examples: `tiger service describe <service-id>`, `tiger db connect <service-id>`
816+
- Examples: `tiger service get <service-id>`, `tiger db connect <service-id>`
815817

816818
**Global context commands** (acting on other resources with service as secondary):
817819
- Use `--service-id` flag as the canonical parameter

0 commit comments

Comments
 (0)