diff --git a/README.md b/README.md index 1fe70f3..7975321 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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. diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 0000000..5b08f65 --- /dev/null +++ b/scripts/install.sh @@ -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}"