Skip to content

Commit

Permalink
fix: fix chat subcommands (#279)
Browse files Browse the repository at this point in the history
all of the sgpt chat subcommands (like cat, ls, rm) were broken. the
viper config was not loaded, which included the user cache dir. this
user cache dir is used to save the chat sessions.
  • Loading branch information
tbckr committed Sep 20, 2024
1 parent 047ffc7 commit cf3b42f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/cli/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ Manage all open chat sessions - list, show, and delete chat sessions.
DisableFlagsInUseLine: true,
Args: cobra.NoArgs,
ValidArgsFunction: cobra.NoFileCompletions,
PersistentPreRunE: func(_ *cobra.Command, _ []string) error {
return loadViperConfig(config)
},
RunE: func(cmd *cobra.Command, _ []string) error {
return cmd.Help()
},
Expand Down

0 comments on commit cf3b42f

Please sign in to comment.