Skip to content

Commit

Permalink
docs: update install docs [skip-ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
sammcj committed Oct 7, 2024
1 parent d9a8e3c commit 82e5356
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ The application allows users to interactively select models, sort, filter, edit,
- [Table of Contents](#table-of-contents)
- [Features](#features)
- [Installation](#installation)
- [go install (recommended)](#go-install-recommended)
- [curl](#curl)
- [Manually](#manually)
- [Usage](#usage)
- [Key Bindings](#key-bindings)
- [Top](#top)
Expand Down Expand Up @@ -56,13 +59,21 @@ Gollama Intro ("Podcast" Episode):

## Installation

From go:
### go install (recommended)

```shell
go install github.com/sammcj/gollama@HEAD
```

From Github:
### curl

I don't recommend this method as it's not as easy to update, but you can use the following command:

```shell
curl -sL https://raw.githubusercontent.com/sammcj/gollama/refs/heads/main/scripts/install.sh | bash
```

### Manually

Download the most recent release from the [releases page](https://github.com/sammcj/gollama/releases) and extract the binary to a directory in your PATH.

Expand Down
38 changes: 38 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

# This is a simple installer that gets the latest version of gollama from Github and installs it to /usr/local/bin

INSTALL_DIR="/usr/local/bin"
INSTALL_PATH="${INSTALL_PATH:-$INSTALL_DIR/gollama}"
ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
OS=$(uname -s | tr '[:upper:]' '[:lower:]')

# Ensure the user is not root
if [ "$EUID" -eq 0 ]; then
echo "Please do not run as root"
exit 1
fi

# Get the latest release from Github
VER=$(curl --silent -qI https://github.com/sammcj/gollama/releases/latest | awk -F '/' '/^location/ {print substr($NF, 1, length($NF)-1)}')

echo "Downloading gollama ${VER} for ${OS}-${ARCH}..."

if [ "${OS}" == "darwin" ]; then
URL="https://github.com/sammcj/gollama/releases/download/$VER/gollama-macos.zip"
else
URL="https://github.com/sammcj/gollama/releases/download/$VER/gollama-${OS}-${ARCH}.zip"
fi

wget -q --show-progress -O /tmp/gollama.zip "${URL}"

# Unzip the binary
unzip -q /tmp/gollama.zip -d /tmp

# # # Move the binary to the install directory
mv gollama "${INSTALL_PATH}"

# # # Make the binary executable
chmod +x "${INSTALL_PATH}"

echo "gollama has been installed to ${INSTALL_PATH}"

0 comments on commit 82e5356

Please sign in to comment.