diff --git a/CLAUDE.md b/CLAUDE.md index 4c6a94f2..6c661968 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -150,7 +150,7 @@ Tiger CLI is a Go-based command-line interface for managing Tiger, the modern da - **Command Structure**: `internal/tiger/cmd/` - Cobra-based command definitions - `root.go` - Root command with global flags and configuration initialization - `auth.go` - Authentication commands (login, logout, whoami) - - `service.go` - Service management commands (list, create, describe, fork, delete, update-password) + - `service.go` - Service management commands (list, create, get, fork, delete, update-password) - `db.go` - Database operation commands (connection-string, connect, test-connection) - `config.go` - Configuration management commands (show, set, unset, reset) - `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 - **API Client**: `internal/tiger/api/` - Generated OpenAPI client with mocks - **MCP Server**: `internal/tiger/mcp/` - Model Context Protocol server implementation - `server.go` - MCP server initialization, tool registration, and lifecycle management - - `service_tools.go` - Service management tools (list, show, create, update-password) + - `service_tools.go` - Service management tools (list, get, create, update-password) - `db_tools.go` - Database operation tools (execute-query) - `proxy.go` - Proxy client that forwards tools/resources/prompts from remote docs MCP server - **Password Storage**: `internal/tiger/password/` - Secure password storage utilities @@ -193,7 +193,7 @@ The Tiger MCP server provides AI assistants with programmatic access to Tiger re **Two Types of Tools:** 1. **Direct Tiger Tools** - Native tools for Tiger operations - - `service_tools.go` - Service management (list, show, create, update-password) + - `service_tools.go` - Service management (list, get, create, update-password) - `db_tools.go` - Database operations (execute-query) 2. **Proxied Documentation Tools** (`proxy.go`) - Tools forwarded from a remote docs MCP server (see `proxy.go` for implementation) @@ -380,7 +380,7 @@ buildRootCmd() → Complete CLI with all commands and flags │ └── buildWhoamiCmd() ├── buildServiceCmd() │ ├── buildServiceListCmd() -│ ├── buildServiceDescribeCmd() +│ ├── buildServiceGetCmd() │ ├── buildServiceCreateCmd() │ ├── buildServiceForkCmd() │ ├── buildServiceDeleteCmd() diff --git a/README.md b/README.md index da0adbd5..3880d135 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Tiger CLI provides the following commands: - `tiger service` - Service lifecycle management - `list` - List all services - `create` - Create a new service - - `describe` - Show detailed service information + - `get` - Show detailed service information (aliases: `describe`, `show`) - `fork` - Fork an existing service - `delete` - Delete a service - `update-password` - Update service master password @@ -162,7 +162,7 @@ The MCP server exposes the following tools to AI assistants: **Service Management:** - `service_list` - List all database services in your project -- `service_show` - Show detailed information about a specific service +- `service_get` - Get detailed information about a specific service - `service_create` - Create new database services with configurable resources - `service_update_password` - Update the master password for a service diff --git a/docs/development.md b/docs/development.md index 2ca17249..2da6c637 100644 --- a/docs/development.md +++ b/docs/development.md @@ -88,7 +88,7 @@ go test ./internal/tiger/cmd -v -run Integration ### What Integration Tests Cover - **Authentication lifecycle**: Login with credentials, verify authentication, logout -- **Service management**: Create, list, describe, and delete database services +- **Service management**: Create, list, get, and delete database services - **Password management**: Update service passwords with keychain storage - **Database connectivity**: Generate connection strings and execute psql commands - **Output formats**: Validate JSON, YAML, and table output formats diff --git a/docs/mcp_feedback.md b/docs/mcp_feedback.md index c95e776a..433f30c6 100644 --- a/docs/mcp_feedback.md +++ b/docs/mcp_feedback.md @@ -12,7 +12,7 @@ The TigerData MCP tools provide useful database management functionality but hav ### Recommendations - **WHY**: Consistency reduces cognitive load and makes the API more predictable - Standardize on snake_case throughout: `get_guide`, `semantic_search_postgres_docs` -- Use consistent verbs: `service_get` instead of `service_show` for alignment with REST conventions +- ~~Use consistent verbs: `service_get` instead of `service_show` for alignment with REST conventions~~ ✅ COMPLETED ## Input Parameters @@ -99,6 +99,7 @@ The TigerData MCP tools provide useful database management functionality but hav ### High Priority 1. Fix parameter type issues in `semanticSearchPostgresDocs` 2. Standardize naming conventions across all tools + - ~~service_get~~ ✅ COMPLETED 3. Add service deletion capability 4. ~~Rename timeout to timeout_minutes~~ ✅ COMPLETED @@ -125,4 +126,4 @@ The TigerData MCP tools provide useful database management functionality but hav 2. **Reliability**: Proper typing prevents runtime failures 3. **Usability**: Clear documentation reduces trial-and-error 4. **Completeness**: Full CRUD operations enable real workflows -5. **Efficiency**: Appropriate content sizing preserves LLM context \ No newline at end of file +5. **Efficiency**: Appropriate content sizing preserves LLM context diff --git a/internal/tiger/cmd/integration_test.go b/internal/tiger/cmd/integration_test.go index 88f0cc3e..45bf588e 100644 --- a/internal/tiger/cmd/integration_test.go +++ b/internal/tiger/cmd/integration_test.go @@ -81,7 +81,7 @@ func executeIntegrationCommand(args ...string) (string, error) { } // TestServiceLifecycleIntegration tests the complete authentication and service lifecycle: -// login -> whoami -> create -> describe -> update-password -> delete -> logout +// login -> whoami -> create -> get -> update-password -> delete -> logout func TestServiceLifecycleIntegration(t *testing.T) { config.SetTestServiceName(t) // Check for required environment variables @@ -215,22 +215,22 @@ func TestServiceLifecycleIntegration(t *testing.T) { } }) - t.Run("DescribeService", func(t *testing.T) { + t.Run("GetService", func(t *testing.T) { if serviceID == "" { t.Skip("No service ID available from create test") } - t.Logf("Describing service: %s", serviceID) + t.Logf("Getting service details: %s", serviceID) output, err := executeIntegrationCommand( - "service", "describe", serviceID, + "service", "get", serviceID, "--output", "json", ) - t.Logf("Raw service describe output: %s", output) + t.Logf("Raw service get output: %s", output) if err != nil { - t.Fatalf("Service describe failed: %v\nOutput: %s", err, output) + t.Fatalf("Service get failed: %v\nOutput: %s", err, output) } // Parse JSON to verify service details @@ -389,14 +389,14 @@ func TestServiceLifecycleIntegration(t *testing.T) { t.Logf("Verifying service %s no longer exists", deletedServiceID) - // Try to describe the deleted service - should fail + // Try to get the deleted service - should fail output, err := executeIntegrationCommand( - "service", "describe", deletedServiceID, + "service", "get", deletedServiceID, ) // We expect this to fail since the service should be deleted if err == nil { - t.Errorf("Expected service describe to fail for deleted service, but got output: %s", output) + t.Errorf("Expected service get to fail for deleted service, but got output: %s", output) } // Check that error indicates service not found @@ -533,8 +533,8 @@ func TestServiceNotFound(t *testing.T) { reason string }{ { - name: "service describe", - args: []string{"service", "describe", nonExistentServiceID}, + name: "service get", + args: []string{"service", "get", nonExistentServiceID}, expectedExitCode: ExitServiceNotFound, }, { @@ -707,8 +707,8 @@ func TestAuthenticationErrorsIntegration(t *testing.T) { args: []string{"service", "list", "--project-id", projectID}, }, { - name: "service describe", - args: []string{"service", "describe", "non-existent-service", "--project-id", projectID}, + name: "service get", + args: []string{"service", "get", "non-existent-service", "--project-id", projectID}, }, { name: "service create", diff --git a/internal/tiger/cmd/service.go b/internal/tiger/cmd/service.go index 787dbb74..b6ddddbe 100644 --- a/internal/tiger/cmd/service.go +++ b/internal/tiger/cmd/service.go @@ -34,7 +34,7 @@ func buildServiceCmd() *cobra.Command { } // Add all subcommands - cmd.AddCommand(buildServiceDescribeCmd()) + cmd.AddCommand(buildServiceGetCmd()) cmd.AddCommand(buildServiceListCmd()) cmd.AddCommand(buildServiceCreateCmd()) cmd.AddCommand(buildServiceDeleteCmd()) @@ -44,13 +44,14 @@ func buildServiceCmd() *cobra.Command { return cmd } -// serviceDescribeCmd represents the describe command under service -func buildServiceDescribeCmd() *cobra.Command { +// buildServiceGetCmd represents the get command under service +func buildServiceGetCmd() *cobra.Command { var withPassword bool cmd := &cobra.Command{ - Use: "describe [service-id]", - Short: "Show detailed information about a service", + Use: "get [service-id]", + Aliases: []string{"describe", "show"}, + Short: "Show detailed information about a service", Long: `Show detailed information about a specific database service. The service ID can be provided as an argument or will use the default service @@ -58,17 +59,17 @@ from your configuration. This command displays comprehensive information about the service including configuration, status, endpoints, and resource usage. Examples: - # Describe default service - tiger service describe + # Get default service details + tiger service get - # Describe specific service - tiger service describe svc-12345 + # Get specific service details + tiger service get svc-12345 # Get service details in JSON format - tiger service describe svc-12345 --output json + tiger service get svc-12345 --output json # Get service details in YAML format - tiger service describe svc-12345 --output yaml`, + tiger service get svc-12345 --output yaml`, RunE: func(cmd *cobra.Command, args []string) error { // Get config cfg, err := config.Load() diff --git a/internal/tiger/cmd/service_test.go b/internal/tiger/cmd/service_test.go index a4f0fe60..44c59e63 100644 --- a/internal/tiger/cmd/service_test.go +++ b/internal/tiger/cmd/service_test.go @@ -558,7 +558,7 @@ func TestAutoGeneratedServiceName(t *testing.T) { } } -func TestServiceDescribe_NoServiceID(t *testing.T) { +func TestServiceGet_NoServiceID(t *testing.T) { tmpDir := setupServiceTest(t) // Set up config with project ID but no default service ID @@ -577,8 +577,8 @@ func TestServiceDescribe_NoServiceID(t *testing.T) { } defer func() { getAPIKeyForService = originalGetAPIKey }() - // Execute service describe command without service ID - _, err, _ = executeServiceCommand("service", "describe") + // Execute service get command without service ID + _, err, _ = executeServiceCommand("service", "get") if err == nil { t.Fatal("Expected error when no service ID is provided or configured") } @@ -588,7 +588,7 @@ func TestServiceDescribe_NoServiceID(t *testing.T) { } } -func TestServiceDescribe_NoAuth(t *testing.T) { +func TestServiceGet_NoAuth(t *testing.T) { tmpDir := setupServiceTest(t) // Set up config with project ID and service ID @@ -608,8 +608,8 @@ func TestServiceDescribe_NoAuth(t *testing.T) { } defer func() { getAPIKeyForService = originalGetAPIKey }() - // Execute service describe command - _, err, _ = executeServiceCommand("service", "describe") + // Execute service get command + _, err, _ = executeServiceCommand("service", "get") if err == nil { t.Fatal("Expected error when not authenticated") } diff --git a/internal/tiger/mcp/service_tools.go b/internal/tiger/mcp/service_tools.go index 1ab15594..b702f5e6 100644 --- a/internal/tiger/mcp/service_tools.go +++ b/internal/tiger/mcp/service_tools.go @@ -79,24 +79,24 @@ func setServiceIDSchemaProperties(schema *jsonschema.Schema) { schema.Properties["service_id"].Pattern = "^[a-z0-9]{10}$" } -// ServiceShowInput represents input for service_show -type ServiceShowInput struct { +// ServiceGetInput represents input for service_get +type ServiceGetInput struct { ServiceID string `json:"service_id"` } -func (ServiceShowInput) Schema() *jsonschema.Schema { - schema := util.Must(jsonschema.For[ServiceShowInput](nil)) +func (ServiceGetInput) Schema() *jsonschema.Schema { + schema := util.Must(jsonschema.For[ServiceGetInput](nil)) setServiceIDSchemaProperties(schema) return schema } -// ServiceShowOutput represents output for service_show -type ServiceShowOutput struct { +// ServiceGetOutput represents output for service_get +type ServiceGetOutput struct { Service ServiceDetail `json:"service"` } -func (ServiceShowOutput) Schema() *jsonschema.Schema { - return util.Must(jsonschema.For[ServiceShowOutput](nil)) +func (ServiceGetOutput) Schema() *jsonschema.Schema { + return util.Must(jsonschema.For[ServiceGetOutput](nil)) } // ServiceDetail represents detailed service information @@ -231,19 +231,19 @@ func (s *Server) registerServiceTools() { }, }, s.handleServiceList) - // service_show + // service_get mcp.AddTool(s.mcpServer, &mcp.Tool{ - Name: "service_show", - Title: "Show Service Details", + Name: "service_get", + Title: "Get Service Details", Description: "Get detailed information for a specific database service. " + "Returns connection endpoints, replica configuration, resource allocation, creation time, and status.", - InputSchema: ServiceShowInput{}.Schema(), - OutputSchema: ServiceShowOutput{}.Schema(), + InputSchema: ServiceGetInput{}.Schema(), + OutputSchema: ServiceGetOutput{}.Schema(), Annotations: &mcp.ToolAnnotations{ ReadOnlyHint: true, - Title: "Show Service Details", + Title: "Get Service Details", }, - }, s.handleServiceShow) + }, s.handleServiceGet) // service_create mcp.AddTool(s.mcpServer, &mcp.Tool{ @@ -327,21 +327,21 @@ func (s *Server) handleServiceList(ctx context.Context, req *mcp.CallToolRequest return nil, output, nil } -// handleServiceShow handles the service_show MCP tool -func (s *Server) handleServiceShow(ctx context.Context, req *mcp.CallToolRequest, input ServiceShowInput) (*mcp.CallToolResult, ServiceShowOutput, error) { +// handleServiceGet handles the service_get MCP tool +func (s *Server) handleServiceGet(ctx context.Context, req *mcp.CallToolRequest, input ServiceGetInput) (*mcp.CallToolResult, ServiceGetOutput, error) { // Load config and validate project ID cfg, err := s.loadConfigWithProjectID() if err != nil { - return nil, ServiceShowOutput{}, err + return nil, ServiceGetOutput{}, err } // Create fresh API client with current credentials apiClient, err := s.createAPIClient() if err != nil { - return nil, ServiceShowOutput{}, err + return nil, ServiceGetOutput{}, err } - logging.Debug("MCP: Showing service details", + logging.Debug("MCP: Getting service details", zap.String("project_id", cfg.ProjectID), zap.String("service_id", input.ServiceID)) @@ -351,16 +351,16 @@ func (s *Server) handleServiceShow(ctx context.Context, req *mcp.CallToolRequest resp, err := apiClient.GetProjectsProjectIdServicesServiceIdWithResponse(ctx, cfg.ProjectID, input.ServiceID) if err != nil { - return nil, ServiceShowOutput{}, fmt.Errorf("failed to get service details: %w", err) + return nil, ServiceGetOutput{}, fmt.Errorf("failed to get service details: %w", err) } // Handle API response if resp.StatusCode() != 200 { - return nil, ServiceShowOutput{}, resp.JSON4XX + return nil, ServiceGetOutput{}, resp.JSON4XX } service := *resp.JSON200 - output := ServiceShowOutput{ + output := ServiceGetOutput{ Service: s.convertToServiceDetail(service), } diff --git a/specs/spec.md b/specs/spec.md index 08fd333f..157a292b 100644 --- a/specs/spec.md +++ b/specs/spec.md @@ -73,7 +73,7 @@ For the initial v0 release, implement these essential commands first: **Core Service Management:** - `tiger service list` - List all services -- `tiger service describe` - Show service details +- `tiger service get` - Show service details (aliases: `describe`, `show`) - `tiger service create` - Create new services - `tiger service delete` - Delete services with confirmation - `tiger service update-password` - Update service master password @@ -172,7 +172,7 @@ Manage database services. **Subcommands:** - `list`: List all services -- `describe`: Show service details +- `get`: Show service details (aliases: `describe`, `show`) - `create`: Create a new service - `delete`: Delete a service - `start`: Start a service @@ -207,9 +207,11 @@ tiger service list tiger services list tiger svc list -# Show service details -tiger service describe svc-12345 -tiger svc describe svc-12345 +# Show service details (all forms work) +tiger service get svc-12345 +tiger service describe svc-12345 # alias +tiger service show svc-12345 # alias +tiger svc get svc-12345 # Create a TimescaleDB service tiger service create \ @@ -440,13 +442,13 @@ The `connect` and `psql` commands support passing additional flags directly to t Manage high-availability replicas for fault tolerance. **Subcommands:** -- `describe`: Show current HA configuration +- `get`: Show current HA configuration (aliases: `describe`, `show`) - `set`: Set HA configuration level **Examples:** ```bash # Show current HA configuration -tiger ha describe svc-12345 +tiger ha get svc-12345 # Set HA level tiger ha set svc-12345 --level none @@ -471,7 +473,7 @@ Manage read replica sets for scaling read workloads. **Subcommands:** - `list`: List all read replica sets -- `describe`: Show replica set details +- `get`: Show replica set details (aliases: `describe`, `show`) - `create`: Create a read replica set - `delete`: Delete a replica set - `resize`: Resize replica set resources @@ -526,7 +528,7 @@ Manage Virtual Private Clouds. **Subcommands:** - `list`: List all VPCs -- `describe`: Show VPC details +- `get`: Show VPC details (aliases: `describe`, `show`) - `create`: Create a new VPC - `delete`: Delete a VPC - `rename`: Rename a VPC @@ -547,7 +549,7 @@ tiger vpc create \ --region us-east-1 # Show VPC details -tiger vpc describe vpc-12345 +tiger vpc get vpc-12345 # Attach/detach services tiger vpc attach-service vpc-12345 --service-id svc-67890 @@ -573,7 +575,7 @@ Manage VPC peering connections for a specific VPC. **Subcommands:** - `list`: List all peering connections for a VPC -- `describe`: Show details of a specific peering connection +- `get`: Show details of a specific peering connection (aliases: `describe`, `show`) - `create`: Create a new peering connection - `delete`: Delete a peering connection @@ -583,7 +585,7 @@ Manage VPC peering connections for a specific VPC. tiger vpc peering list vpc-12345 # Show details of a specific peering connection -tiger vpc peering describe vpc-12345 peer-67890 +tiger vpc peering get vpc-12345 peer-67890 # Create a new peering connection tiger vpc peering create vpc-12345 \ @@ -685,7 +687,7 @@ svc-12345 production-db running production Errors are returned with descriptive messages and appropriate exit codes: ```bash -$ tiger service describe invalid-id +$ tiger service get invalid-id Error: Service 'invalid-id' not found in project 'proj-12345' Use 'tiger service list' to see available services. ``` @@ -795,7 +797,7 @@ tiger db connection-string svc-12345 ### Monitoring and Maintenance ```bash # Check service status -tiger service describe svc-12345 +tiger service get svc-12345 # Update service password tiger service update-password svc-12345 --password new-secure-password @@ -811,7 +813,7 @@ Commands follow consistent patterns for specifying service IDs: **Single-service commands** (verbs acting on one service): - Use positional `` as the canonical parameter - Support `--service-id` flag as an alias/override -- Examples: `tiger service describe `, `tiger db connect ` +- Examples: `tiger service get `, `tiger db connect ` **Global context commands** (acting on other resources with service as secondary): - Use `--service-id` flag as the canonical parameter diff --git a/specs/spec_future.md b/specs/spec_future.md index eb3a5297..599c6651 100644 --- a/specs/spec_future.md +++ b/specs/spec_future.md @@ -11,7 +11,7 @@ Manage TigerData projects. **Subcommands:** - `list`: List all projects -- `show`: Show project details +- `get`: Get project details (aliases: `show`, `describe`) - `set-default`: Set default project **Examples:** @@ -19,8 +19,8 @@ Manage TigerData projects. # List projects tiger projects list -# Show project details -tiger projects show proj-12345 +# Get project details +tiger projects get proj-12345 # Set default project tiger projects set-default proj-12345 @@ -246,7 +246,7 @@ View and manage long-running operations. **Subcommands:** - `list`: List operations -- `show`: Show operation details +- `get`: Get operation details (aliases: `show`, `describe`) - `cancel`: Cancel operation - `logs`: View operation logs @@ -255,8 +255,8 @@ View and manage long-running operations. # List operations tiger operations list -# Show operation details -tiger operations show op-12345 +# Get operation details +tiger operations get op-12345 # View logs tiger operations logs op-12345 --follow diff --git a/specs/spec_mcp.md b/specs/spec_mcp.md index 993bf2ff..8c8b673c 100644 --- a/specs/spec_mcp.md +++ b/specs/spec_mcp.md @@ -18,7 +18,7 @@ For the initial v0 release, implement these essential tools first: **Core Service Management:** - `tiger_service_list` - List all services -- `tiger_service_show` - Show service details +- `tiger_service_get` - Get service details - `tiger_service_create` - Create new services - `tiger_service_delete` - Delete services (with confirmation, 24-hour safe delete) - Maybe not v0 - `tiger_service_update_password` - Update service master password @@ -155,11 +155,11 @@ List all database services. **Returns:** Array of service objects with id, name, status, type, region, and resource information. -#### `tiger_service_show` -Show details of a specific service. +#### `tiger_service_get` +Get details of a specific service. **Parameters:** -- `service_id` (string, required): Service ID to show +- `service_id` (string, required): Service ID to get **Returns:** Detailed service object with configuration, endpoints, and status. @@ -326,8 +326,8 @@ Execute a SQL query on a service database. ### High-Availability Management -#### `tiger_ha_show` -Show current HA configuration for a service. +#### `tiger_ha_get` +Get current HA configuration for a service. **Parameters:** - `service_id` (string, required): Service ID @@ -353,8 +353,8 @@ List all read replica sets for a service. **Returns:** Array of read replica set objects. -#### `tiger_read_replica_show` -Show details of a specific read replica set. +#### `tiger_read_replica_get` +Get details of a specific read replica set. **Parameters:** - `replica_set_id` (string, required): Replica set ID @@ -436,11 +436,11 @@ List all Virtual Private Clouds. **Returns:** Array of VPC objects with id, name, CIDR, and region information. -#### `tiger_vpc_show` -Show details of a specific VPC. +#### `tiger_vpc_get` +Get details of a specific VPC. **Parameters:** -- `vpc_id` (string, required): VPC ID to show +- `vpc_id` (string, required): VPC ID to get **Returns:** Detailed VPC object with configuration and attached services. @@ -507,8 +507,8 @@ List all peering connections for a VPC. **Returns:** Array of peering connection objects. -#### `tiger_vpc_peering_show` -Show details of a specific peering connection. +#### `tiger_vpc_peering_get` +Get details of a specific peering connection. **Parameters:** - `vpc_id` (string, required): VPC ID