diff --git a/pkg/cli/cmd.go b/pkg/cli/cmd.go index d628d0a..de00a46 100644 --- a/pkg/cli/cmd.go +++ b/pkg/cli/cmd.go @@ -19,7 +19,7 @@ var ( const ( // Limit number of conversations shown with `ls`, without --all - LS_LIMIT int = 25 + LS_LIMIT int = 5 ) func init() { @@ -32,7 +32,9 @@ func init() { cmd.MarkFlagsMutuallyExclusive("system-prompt", "system-prompt-file") } - listCmd.Flags().Bool("all", false, fmt.Sprintf("Show all conversations, by default only the last %d are shown", LS_LIMIT)) + listCmd.Flags().Int("count", LS_LIMIT, fmt.Sprintf("Number of conversations to list")) + listCmd.Flags().Bool("all", false, "List all conversations") + renameCmd.Flags().Bool("generate", false, "Generate a conversation title") editCmd.Flags().Int("offset", 1, "Offset from the last reply to edit (Default: edit your last message, assuming there's an assistant reply)") @@ -225,6 +227,7 @@ var listCmd = &cobra.Command{ categorized := map[string][]ConversationLine{} all, _ := cmd.Flags().GetBool("all") + count, _ := cmd.Flags().GetInt("count") for _, conversation := range conversations { lastMessage, err := store.LastMessage(&conversation) @@ -269,7 +272,7 @@ var listCmd = &cobra.Command{ fmt.Printf("%s:\n", category.name) for _, conv := range conversationLines { - if conversationsPrinted >= LS_LIMIT && !all { + if conversationsPrinted >= count && !all { fmt.Printf("%d remaining message(s), use --all to view.\n", len(conversations)-conversationsPrinted) break outer }