diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index fe4aee8..c885392 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -17,11 +17,6 @@ jobs: with: go-version: "1.20" - - name: Lint - uses: golangci/golangci-lint-action@v3 - with: - args: "--timeout=3m" - - name: Build run: CGO_ENABLED=1 go build -tags "fts5" @@ -30,4 +25,4 @@ jobs: env: PANDA_ENV: dev PANDA_DATA_DIR_PATH: /panda/data - PANDA_DATABSE_NAME: panda.db \ No newline at end of file + PANDA_DATABSE_NAME: panda.db diff --git a/.goreleaser-darwin.yaml b/.goreleaser-darwin.yaml index c55c2be..c8e445d 100644 --- a/.goreleaser-darwin.yaml +++ b/.goreleaser-darwin.yaml @@ -27,7 +27,7 @@ builds: archives: - id: panda-archive - format: tar.gz + formats: zip name_template: >- {{ .ProjectName }}_ {{- .Version }}_ diff --git a/.goreleaser-linux.yaml b/.goreleaser-linux.yaml index 7ba093d..86bcde6 100644 --- a/.goreleaser-linux.yaml +++ b/.goreleaser-linux.yaml @@ -32,7 +32,7 @@ builds: archives: - id: panda-archive - format: tar.gz + formats: zip name_template: >- {{ .ProjectName }}_ {{- .Version }}_ @@ -45,7 +45,6 @@ archives: - LICENSE* checksum: - name_template: 'checksums.txt' disable: true changelog: @@ -55,7 +54,7 @@ release: github: owner: aavshr name: panda - draft: true + draft: false prerelease: auto mode: append name_template: "{{.ProjectName}} v{{.Version}}" diff --git a/Makefile b/Makefile index 705b297..418ceb1 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ build: go build -o panda --tags "fts5" +test: + go test -v -tags "fts5" ./... + run: build -./panda rm ./panda diff --git a/README.md b/README.md index d523e4d..c8cfd30 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,47 @@ 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. +However, I had to finish this and get a v0 out. 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 +### Installation + +#### Download Pre-built Binaries + +Download the latest release for your platform from the [releases page](https://github.com/aavshr/panda/releases). + +**macOS:** +```bash +# Extract the archive +unzip panda__Darwin_*.zip + +# Remove macOS quarantine attribute (thank you Apple) +xattr -c panda + +# Move to your PATH (usually /usr/local/bin but move it wherever you like in the PATH) +sudo mv panda /usr/local/bin/ +``` -Install with `go install github.com/aavshr/panda@latest` and run with `panda`. +**Linux:** +```bash +# Move to your PATH (usually /usr/local/bin but move it wherever you like in the PATH) +sudo mv panda /usr/local/bin/ +``` + +#### Build from Source + +You need to have Go installed (version 1.23 or higher). + +```bash +git clone https://github.com/aavshr/panda.git +cd panda +make build +``` + +### Usage -Clone the repository and build with `make build` if you just want to build it yourself. +Run with `panda` after installation. **Navigation** diff --git a/internal/ui/model_test.go b/internal/ui/model_test.go deleted file mode 100644 index 42339d9..0000000 --- a/internal/ui/model_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package ui - -import ( - "fmt" - "os" - "testing" - - "github.com/aavshr/panda/internal/db" - "github.com/aavshr/panda/internal/ui/llm" - "github.com/aavshr/panda/internal/ui/store" - "golang.org/x/term" -) - -func TestModel_View(t *testing.T) { - testThreads := []*db.Thread{ - { - ID: "1", - Name: "Thread 1", - CreatedAt: "2024-01-01", - UpdatedAt: "2024-01-02", - }, - { - ID: "2", - Name: "Thread 2", - CreatedAt: "2024-01-03", - UpdatedAt: "2024-01-02", - }, - } - testMessages := []*db.Message{ - { - ThreadID: "1", - Content: "Message 1", - Role: "user", - CreatedAt: "2024-01-01", - }, - { - ThreadID: "1", - Content: "Message 2", - Role: "assistant", - CreatedAt: "2024-01-01", - }, - } - - mockStore := store.NewMock(testThreads, testMessages) - mockLLM := llm.NewMock() - - width, height, err := term.GetSize(int(os.Stdout.Fd())) - if err != nil { - t.Fatalf("failed to get terminal size: %v", err) - } - - m, _ := New(&Config{ - InitThreadsLimit: 10, - MaxThreadsLimit: 100, - MessagesLimit: 50, - Width: width - 10, - Height: height - 10, - }, mockStore, mockLLM) - _ = m.Init() - fmt.Println(m.View()) -}