Compare commits
No commits in common. "cac2a1e80cdd2e1ca1bbb3e6ad46f565595a7955" and "dd5f1667670b63a5469717a059c5604db1d1c382" have entirely different histories.
cac2a1e80c
...
dd5f166767
@ -18,6 +18,7 @@ Maybe features:
|
||||
|
||||
```shell
|
||||
$ go install git.mlow.ca/mlow/lmcli@latest
|
||||
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
5
main.go
5
main.go
@ -8,8 +8,9 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := cli.Execute(); err != nil {
|
||||
fmt.Fprint(os.Stderr, err)
|
||||
cmd := cli.NewRootCmd()
|
||||
if err := cmd.Execute(); err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
@ -12,21 +12,6 @@ import (
|
||||
// TODO: allow setting with flag
|
||||
const MAX_TOKENS = 256
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(
|
||||
lsCmd,
|
||||
newCmd,
|
||||
promptCmd,
|
||||
replyCmd,
|
||||
rmCmd,
|
||||
viewCmd,
|
||||
)
|
||||
}
|
||||
|
||||
func Execute() error {
|
||||
return rootCmd.Execute()
|
||||
}
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "lmcli",
|
||||
Short: "Interact with Large Language Models",
|
||||
@ -238,8 +223,8 @@ var replyCmd = &cobra.Command{
|
||||
messageContents, err := InputFromEditor("# How would you like to reply?\n", "reply.*.md")
|
||||
|
||||
userReply := Message{
|
||||
ConversationID: conversation.ID,
|
||||
Role: "user",
|
||||
ConversationID: conversation.ID,
|
||||
Role: "user",
|
||||
OriginalContent: messageContents,
|
||||
}
|
||||
|
||||
@ -402,3 +387,15 @@ var promptCmd = &cobra.Command{
|
||||
fmt.Println()
|
||||
},
|
||||
}
|
||||
|
||||
func NewRootCmd() *cobra.Command {
|
||||
rootCmd.AddCommand(
|
||||
lsCmd,
|
||||
newCmd,
|
||||
promptCmd,
|
||||
replyCmd,
|
||||
rmCmd,
|
||||
viewCmd,
|
||||
)
|
||||
return rootCmd
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user