Skip to content

Commit ca155fe

Browse files
Add tiger service logs command and service_logs MCP tool (#137)
1 parent 0713b56 commit ca155fe

File tree

11 files changed

+657
-24
lines changed

11 files changed

+657
-24
lines changed

CLAUDE.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ Tiger CLI is a Go-based command-line interface for managing Tiger, the modern da
267267
- **Command Structure**: `internal/tiger/cmd/` - Cobra-based command definitions
268268
- `root.go` - Root command with global flags and configuration initialization
269269
- `auth.go` - Authentication commands (login, logout, status)
270-
- `service.go` - Service management commands (list, create, get, fork, start, stop, resize, delete, update-password)
270+
- `service.go` - Service management commands (list, create, get, fork, start, stop, resize, delete, update-password, logs)
271271
- `db.go` - Database operation commands (connection-string, connect, test-connection)
272272
- `config.go` - Configuration management commands (show, set, unset, reset)
273273
- `mcp.go` - MCP server commands (install, start, list, get)
@@ -277,7 +277,7 @@ Tiger CLI is a Go-based command-line interface for managing Tiger, the modern da
277277
- **API Client**: `internal/tiger/api/` - Generated OpenAPI client with mocks
278278
- **MCP Server**: `internal/tiger/mcp/` - Model Context Protocol server implementation
279279
- `server.go` - MCP server initialization, tool registration, and lifecycle management
280-
- `service_tools.go` - Service management tools (list, get, create, fork, start, stop, resize, update-password)
280+
- `service_tools.go` - Service management tools (list, get, create, fork, start, stop, resize, update-password, logs)
281281
- `db_tools.go` - Database operation tools (execute-query)
282282
- `proxy.go` - Proxy client that forwards tools/resources/prompts from remote docs MCP server
283283
- `capabilities.go` - Lists all available MCP capabilities (tools, prompts, resources, resource templates)
@@ -286,6 +286,7 @@ Tiger CLI is a Go-based command-line interface for managing Tiger, the modern da
286286
- Wait operations and polling logic (WaitForService)
287287
- Error handling and exit code utilities
288288
- Service detail conversion helpers
289+
- Log fetching with pagination (FetchServiceLogs)
289290
- **Utilities**: `internal/tiger/util/` - Small utility functions with minimal dependencies
290291

291292
### Configuration System
@@ -309,7 +310,7 @@ The Tiger MCP server provides AI assistants with programmatic access to Tiger re
309310
**Two Types of Tools:**
310311

311312
1. **Direct Tiger Tools** - Native tools for Tiger operations
312-
- `service_tools.go` - Service management (list, get, create, fork, start, stop, update-password)
313+
- `service_tools.go` - Service management (list, get, create, fork, start, stop, update-password, logs)
313314
- `db_tools.go` - Database operations (execute-query)
314315
2. **Proxied Documentation Tools** (`proxy.go`) - Tools forwarded from a remote docs MCP server (see `proxy.go` for implementation)
315316

@@ -405,7 +406,7 @@ tiger-cli/
405406
│ ├── config/ # Configuration management
406407
│ ├── logging/ # Structured logging utilities
407408
│ ├── mcp/ # MCP server implementation
408-
│ ├── common/ # Shared business logic (password storage, wait ops, error handling)
409+
│ ├── common/ # Shared business logic (password storage, wait ops, error handling, log fetching)
409410
│ ├── cmd/ # CLI commands (Cobra)
410411
│ └── util/ # Small utility functions with minimal dependencies
411412
├── docs/ # Documentation
@@ -493,7 +494,8 @@ buildRootCmd() → Complete CLI with all commands and flags
493494
│ ├── buildServiceStartCmd()
494495
│ ├── buildServiceStopCmd()
495496
│ ├── buildServiceDeleteCmd()
496-
│ └── buildServiceUpdatePasswordCmd()
497+
│ ├── buildServiceUpdatePasswordCmd()
498+
│ └── buildServiceLogsCmd()
497499
├── buildDbCmd()
498500
│ ├── buildDbConnectionStringCmd()
499501
│ ├── buildDbConnectCmd()

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Tiger CLI provides the following commands:
9999
- `resize` - Resize service CPU and memory allocation
100100
- `delete` - Delete a service
101101
- `update-password` - Update service master password
102+
- `logs` - View service logs
102103
- `tiger db` - Database operations
103104
- `connect` - Connect to a database with psql
104105
- `connection-string` - Get connection string for a service
@@ -182,6 +183,7 @@ The MCP server exposes the following tools to AI assistants:
182183
- `service_stop` - Stop a running database service
183184
- `service_resize` - Resize a database service by changing CPU and memory allocation
184185
- `service_update_password` - Update the master password for a service
186+
- `service_logs` - View logs for a database service
185187

186188
**Database Operations:**
187189
- `db_execute_query` - Execute SQL queries against a database service with support for parameterized queries, custom timeouts, and connection pooling

internal/tiger/api/client.go

Lines changed: 178 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/tiger/api/mocks/mock_client.go

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/tiger/api/types.go

Lines changed: 18 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)