+1. Variables _you_ can set
+2. Functions _you_ must define
+3. Convenience / Helper Functions
+
+(optional, if needed) Bash variables that you _may_ define:
+
+```bash
+# Define this if the package name is different from the command name (i.e. golang => go)
+pkg_cmd_name="foobar"
+
+# These are used for symlinks, PATH, and test commands
+pkg_dst="$HOME/.local/opt/foobar"
+pkg_dst_cmd="$HOME/.local/opt/foobar/bin/foobar"
+#pkg_dst_bin="$(dirname "$pkg_dst_cmd")"
+
+# These are the _real_ locations for the above
+pkg_src="$HOME/.local/opt/foobar-v$WEBI_VERSION"
+pkg_src_cmd="$HOME/.local/opt/foobar-v$WEBI_VERSION/bin/foobar"
+#pkg_src_bin="$(dirname "$pkg_src_cmd")"
+```
+
+(required) A version check function that strips all non-version junk
+
+```bash
+pkg_get_current_version() {
+ # foobar-v1.1.7 => 1.1.7
+ echo "$(foobar --version | head -n 1 | sed 's:foobar-v::')"
+}
+```
+
+For the rest of the functions you can like copy/paste from the examples:
+
+```bash
+pkg_format_cmd_version() {} # Override, pretty prints version
+
+pkg_link # Override, replaces webi_link()
+
+pkg_pre_install() { # Override, runs any webi_* commands
+ webi_check # for $HOME/.local/opt tools
+ webi_download # for things that have a releases.js
+ webi_extract # for .xz, .tar.*, and .zip files
+}
+
+pkg_install() {} # Override, usually just needs to rename extracted folder to
+ # "$HOME/.local/opt/$pkg_cmd_name-v$WEBI_VERSION"
+
+pkg_post_install() { # Override
+ webi_path_add "$pkg_dst_bin" # should probably update PATH
+}
+
+pkg_done_message() {} # Override, pretty print a success message
+```
+
+## Script API
+
+See `webi/template.sh`
+
+These variables will be set by the server:
+
+```bash
+WEBI_PKG=example@v1
+WEBI_TAG=v1
+WEBI_HOST=https://webinstall.dev
+WEBI_RELEASES=https://webinstall.dev/api/releases/example@v1?os=macos&arch=amd64&pretty=true
+WEBI_CSV=v1.0.2,
+WEBI_VERSION=1.0.2
+WEBI_MAJOR=1
+WEBI_MINOR=0
+WEBI_PATCH=2
+WEBI_LTS=
+WEBI_CHANNEL=stable
+WEBI_EXT=tar
+WEBI_PKG_URL=https://cdn.example.com/example-macos-amd64.tar.gz
+WEBI_PKG_FILE=example-macos-amd64.tar.gz
+```
+
+```bash
+PKG_NAME=example
+PKG_OSES=macos,linux,windows
+PKG_ARCHES=amd64,arm64,x86
+PKG_FORMATS=zip,xz
+```
+
+```bash
+WEBI_TMP=${WEBI_TMP:-"$(mktemp -d -t webinstall-foobar.XXXXXXXX)"}
+WEBI_SINGLE=""
+```
+
+```bash
+webi_check # Checks to see if the selected version is already installed (and re-links if so)
+webi_download # Downloads the selected release to $HOME/Downloads/webi/<package-name>.tar.gz
+webi_extract # Extracts the download to /tmp/<package-name>-<random>/
+webi_path_add /new/path # Adds /new/path to PATH for bash, zsh, and fish
+webi_pre_install # Runs webi_check, webi_download, and webi_extract
+webi_install # Moves extracted files from $WEBI_TMP to $pkg_src
+webi_link # replaces any existing symlink with the currently selected version
+webi_post_install # Runs `webi_path_add $pkg_dst_bin`
+```