feat(cli): Adding models subcommand with list and install subcommands (#1165)

Adding subcommands to do certain actions directly from the command line.
I'm starting with the models subcommand allowing you to list models from
your galleries and install them.

This PR partially fixes #816

My intention is to keep adding other subcommands, but I think this is a
good start, and I think this already provides value.

Also, I added a new dependency to generate the progress bar in the
command line, it is not "needed" but I think is a nice to have to have a
cooler interface.

Here is a screenshot:

![imagen](8d8c1bf0-5340-46ce-9362-812694f914cd)
This commit is contained in:
Jesús Espino 2023-10-12 10:45:34 +02:00 committed by GitHub
parent 81a5ed9f31
commit 8ca671761a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 75 additions and 55 deletions

3
go.mod
View file

@ -27,6 +27,7 @@ require (
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
github.com/rs/zerolog v1.31.0
github.com/sashabaranov/go-openai v1.15.4
github.com/schollz/progressbar/v3 v3.13.1
github.com/tmc/langchaingo v0.0.0-20230929160525-e16b77704b8d
github.com/urfave/cli/v2 v2.25.7
github.com/valyala/fasthttp v1.50.0
@ -54,6 +55,7 @@ require (
github.com/golang/snappy v0.0.2 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nwaples/rardecode v1.1.0 // indirect
@ -61,6 +63,7 @@ require (
github.com/pkoukk/tiktoken-go v0.1.2 // indirect
github.com/ulikunitz/xz v0.5.9 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
golang.org/x/term v0.11.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect