Skip to content

Instantly share code, notes, and snippets.

@davlgd
Last active April 26, 2025 10:21
Show Gist options
  • Save davlgd/8ef59dbb86b6f55e400f3493688be212 to your computer and use it in GitHub Desktop.
Save davlgd/8ef59dbb86b6f55e400f3493688be212 to your computer and use it in GitHub Desktop.
Clever Tools Linux & macOS install script
#!/usr/bin/env bash
# Clever Tools Installer for Linux & macOS
# This script downloads and installs Clever Tools in a configurable directory.
# Usage: ./clever-install.sh [install_dir]
set -e
# Colors for UX
CYAN='\033[0;36m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
# Configurable install directory (default: ~/.local/bin)
INSTALL_DIR="${1:-$HOME/.local/bin}"
echo -e "${GREEN}Clever Tools Installer${NC}"
echo "Target install directory: $INSTALL_DIR"
echo
mkdir -p "$INSTALL_DIR"
# Detect OS and Architecture
OS=$(uname -s)
ARCH=$(uname -m)
case "$OS" in
Linux*)
if [ "$ARCH" = "aarch64" ]; then
echo "Clever Tools is not available as a binary for aarch64 architecture on Linux."
echo -e "Install it via: ${CYAN}npm i -g clever-tools${NC}"
exit 1
fi
FOLDER="clever-tools-latest_linux"
;;
Darwin*)
FOLDER="clever-tools-latest_macos"
;;
*)
echo "Unsupported OS: $OS"
exit 1
;;
esac
ARCHIVE="$FOLDER.tar.gz"
URL="https://clever-tools.clever-cloud.com/releases/latest/$ARCHIVE"
echo -n " - Downloading Clever Tools from $URL" && curl -fsSL -o "$ARCHIVE" "$URL" && echo -e " \033[0;32m✔\033[0m"
echo -n " - Extracting archive" && tar xzf "$ARCHIVE" -C "$INSTALL_DIR" --strip-components=1 && echo -e " \033[0;32m✔\033[0m"
echo -n " - Cleaning up" && rm -rf "$ARCHIVE" "$FOLDER" && echo -e " \033[0;32m✔\033[0m"
echo
echo -e "${GREEN}Clever Tools installed in $INSTALL_DIR${NC}, make sure it's in your PATH"
echo
echo -e "Run ${CYAN}clever version${NC} to verify the installation"
echo -e "Run ${CYAN}clever login${NC} to set up your Clever Cloud account"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment