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