Compare commits
No commits in common. "cac2a1e80cdd2e1ca1bbb3e6ad46f565595a7955" and "dd5f1667670b63a5469717a059c5604db1d1c382" have entirely different histories.
cac2a1e80c
...
dd5f166767
@ -18,6 +18,7 @@ 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,8 +8,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if err := cli.Execute(); err != nil {
|
cmd := cli.NewRootCmd()
|
||||||
fmt.Fprint(os.Stderr, err)
|
if err := cmd.Execute(); err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,21 +12,6 @@ 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",
|
||||||
@ -402,3 +387,15 @@ 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