Skip to content
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Tiger CLI is a Go-based command-line interface for managing Tiger, the modern da
- `service.go` - Service management commands (list, create, get, fork, start, stop, 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, list)
- `mcp.go` - MCP server commands (install, start, list, get)
- `version.go` - Version command
- **Configuration**: `internal/tiger/config/config.go` - Centralized config with Viper integration
- **Logging**: `internal/tiger/logging/logging.go` - Structured logging with zap
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Tiger CLI provides the following commands:
- `install` - Install and configure MCP server for an AI assistant
- `start` - Start the MCP server
- `list` - List available MCP tools, prompts, and resources
- `get` - Get detailed information about a specific MCP capability (aliases: `describe`, `show`)
- `tiger version` - Show version information

Use `tiger <command> --help` for detailed information about each command.
Expand Down
16 changes: 16 additions & 0 deletions internal/tiger/cmd/completion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package cmd

import "strings"

// filterCompletionsByPrefix filters a slice of strings to only include items
// that start with the given prefix. This is used by shell completion functions
// to narrow down suggestions based on what the user has typed so far.
func filterCompletionsByPrefix(items []string, prefix string) []string {
var filtered []string
for _, item := range items {
if strings.HasPrefix(item, prefix) {
filtered = append(filtered, item)
}
}
return filtered
}
9 changes: 1 addition & 8 deletions internal/tiger/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package cmd
import (
"fmt"
"io"
"strings"
"time"

"github.com/olekukonko/tablewriter"
Expand Down Expand Up @@ -234,11 +233,5 @@ func configOptionCompletion(cmd *cobra.Command, args []string, toComplete string
return nil, cobra.ShellCompDirectiveNoFileComp
}

var results []string
for opt := range config.ValidConfigOptions() {
if strings.HasPrefix(opt, toComplete) {
results = append(results, opt)
}
}
return results, cobra.ShellCompDirectiveNoFileComp
return filterCompletionsByPrefix(config.ValidConfigOptions(), toComplete), cobra.ShellCompDirectiveNoFileComp
}
Loading