diff --git a/README.md b/README.md new file mode 100644 index 0000000..d523e4d --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +## Panda + +A terminal user interface for chatting with LLMs. + +I started this project because I wanted something lightweight that I can run in my terminal to talk with LLMs. +I could not keep up the project with my work and the everchanging landscape of LLMs and their capabilities. I also realized that the terminal is not the right interface for this kind of thing. + +However, I had to finish this and get a v0 out (have a bad habit of not being able to move on to a new side-project otherwise). Right now it can only talk to OpenAI's API (you need an OpenAI API Key) and is very basic in features. + +![Screenshot](docs/images/screenshot.png) + +### Usage + +Install with `go install github.com/aavshr/panda@latest` and run with `panda`. + +Clone the repository and build with `make build` if you just want to build it yourself. + +**Navigation** + +- `Esc` to focus out of a section +- `Enter` to focus into a section +- Use arrow keys or `hjkl` to navigate + +**Chat** + +- Use `Tab` to send a message + +**History** + +- Use `Enter` to start a new chat in that thread +- Use `Ctrl + D` to delete a thread +- Use `/` to filter threads diff --git a/docs/images/screenshot.png b/docs/images/screenshot.png new file mode 100644 index 0000000..c2ab8c0 Binary files /dev/null and b/docs/images/screenshot.png differ diff --git a/internal/ui/handlers.go b/internal/ui/handlers.go index 449b27b..cb54978 100644 --- a/internal/ui/handlers.go +++ b/internal/ui/handlers.go @@ -124,7 +124,7 @@ func (m *Model) handleChatInputReturnMsg(msg components.ChatInputReturnMsg) tea. // TODO: more robust behavior for thread creation // first thread is always for new thread if m.activeThreadIndex == 0 { - n := 20 + n := 25 if len(msg.Value) < n { n = len(msg.Value) } diff --git a/internal/ui/model.go b/internal/ui/model.go index 99a5a90..e4c841c 100644 --- a/internal/ui/model.go +++ b/internal/ui/model.go @@ -126,8 +126,8 @@ func New(conf *Config, store store.Store, llm llm.LLM) (*Model, error) { m.historyModel = components.NewListModel(&components.NewListModelInput{ Title: titleHistory, Items: components.NewThreadListItems(m.threads), - Width: conf.historyWidth - 18, // padding - Height: conf.historyHeight - 10, // padding + Width: conf.historyWidth, + Height: conf.historyHeight, Delegate: components.NewThreadListItemDelegate(), AllowInfiniteScrolling: false, })