Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
fix broken syntax
Dillon DuPont28b796f9a854
diff --git a/scripts/install-cli.sh b/scripts/install-cli.shindex 5ac09ebfa0..2763e6b83c 100644--- a/scripts/install-cli.sh+++ b/scripts/install-cli.sh@@ -4,9 +4,78 @@ set -e# CUA CLI Installation Script for macOS/Linuxecho "π Installing CUA CLI..."+# Function to print success message+print_success() {+ local bin_path="$1"+ local version="$2"+ local config_file="$3"++ echo -e "\033[32mβ CUA CLI $version was installed successfully to $bin_path\033[0m"+ echo -e "\033[90mAdded \"$bin_path\" to \$PATH in \"$config_file\"\033[0m"+ echo -e "\n\033[90mTo get started, run:\033[0m"+ echo -e " source $config_file"+ echo -e " cua --help\n"+ echo -e "\033[90mπ For more help, visit: https://docs.cua.ai/libraries/cua-cli"+}++# Function to install with bun as fallback+install_with_bun() {+ echo "\033[90mπ¦ Installing CUA CLI using Bun...\033[0m"++ # Check if bun is already installed+ if ! command -v bun &> /dev/null; then+ echo "\033[90mπ¦ Installing Bun...\033[0m"+ curl -fsSL https://bun.sh/install | bash++ # Source the shell profile to make bun available+ if [ -f "$HOME/.bashrc" ]; then+ source "$HOME/.bashrc"+ elif [ -f "$HOME/.zshrc" ]; then+ source "$HOME/.zshrc"+ fi++ # Add bun to PATH for this session+ export PATH="$HOME/.bun/bin:$PATH"+ fi++ # Verify bun installation+ if ! command -v bun &> /dev/null; then+ echo "\033[90mβ Failed to install Bun. Please install manually from https://bun.sh\033[0m"+ exit 1+ fi++ echo "\033[90mπ¦ Installing CUA CLI...\033[0m"+ if ! bun add -g @trycua/cli; then+ echo "\033[90mβ Failed to install with Bun, trying npm...\033[0m"+ if ! npm install -g @trycua/cli; then+ echo "\033[90mβ Installation failed. Please try installing manually:"+ echo " npm install -g @trycua/cli"+ exit 1+ fi+ fi++ # Verify installation+ if command -v cua &> /dev/null; then+ # Determine which config file was updated+ local config_file="$HOME/.bashrc"+ if [ -f "$HOME/.zshrc" ]; then+ config_file="$HOME/.zshrc"+ elif [ -f "$HOME/.profile" ]; then+ config_file="$HOME/.profile"+ fi++ print_success "cua" "$VERSION" "$config_file"+ exit 0+ else+ echo "\033[90mβ Installation failed. Please try installing manually:"+ echo " npm install -g @trycua/cli"+ exit 1+ fi+}+# Determine OS and architecture-OS="$(uname -s | tr '[:upper:]' '[:lower:]')-ARCH="$(uname -m)"+OS=$(uname -s | tr '[:upper:]' '[:lower:]')+ARCH=$(uname -m)# Map architecture to the format used in release assetscase "$ARCH" in@@ -25,7 +94,7 @@ elif [ "$OS" = "darwin" ] && [ "$ARCH" = "x86_64" ]; thenelif [ "$OS" = "linux" ] && [ "$ARCH" = "x86_64" ]; thenBINARY_NAME="cua-linux-x64"else- echo "β οΈ Pre-built binary not available for ${OS}-${ARCH}, falling back to Bun installation"+ echo "\033[90mβ οΈ Pre-built binary not available for ${OS}-${ARCH}, falling back to Bun installation\033[0m"install_with_bunexit 0fi@@ -33,7 +102,7 @@ fi# Get the latest release versionLATEST_RELEASE=$(curl -s https://api.github.com/repos/trycua/cua/releases/latest)if [ -z "$LATEST_RELEASE" ]; then- echo "β οΈ Could not fetch latest release, falling back to Bun installation"+ echo "\033[90mβ οΈ Could not fetch latest release, falling back to Bun installation\033[0m"install_with_bunexit 0fi@@ -43,10 +112,10 @@ TAG_NAME=$(echo "$LATEST_RELEASE" | grep 'tag_name' | cut -d '"' -f 4)VERSION=${TAG_NAME#cua-v}# Find the binary URL in the release assets-BINARY_URL=$(echo "$LATEST_RELEASE" | grep -o "https://.*/download/[^"]*/${BINARY_NAME}" | head -1)+BINARY_URL=$(echo "$LATEST_RELEASE" | grep -o 'https://.*/download/[^"]*/'${BINARY_NAME}'"' | head -1)if [ -z "$BINARY_URL" ]; then- echo "β οΈ Could not find ${BINARY_NAME} in release assets, falling back to Bun installation"+ echo "\033[90mβ οΈ Could not find ${BINARY_NAME} in release assets, falling back to Bun installation\033[0m"install_with_bunexit 0fi@@ -56,9 +125,9 @@ INSTALL_DIR="$HOME/.cua/bin"mkdir -p "$INSTALL_DIR"# Download the binary-echo "π₯ Downloading CUA CLI $VERSION for ${OS}-${ARCH}..."+echo "\033[90mπ₯ Downloading CUA CLI $VERSION for ${OS}-${ARCH}...\033[0m"if ! curl -L "$BINARY_URL" -o "$INSTALL_DIR/cua" 2>/dev/null; then- echo "β οΈ Failed to download pre-built binary, falling back to Bun installation"+ echo "\033[90mβ οΈ Failed to download pre-built binary, falling back to Bun installation\033[0m"install_with_bunexit 0fi@@ -71,17 +140,17 @@ if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then# Add to .bashrc, .zshrc, or .profileif [ -f "$HOME/.bashrc" ]; thenecho "export PATH=\"$INSTALL_DIR:\$PATH\"" >> "$HOME/.bashrc"- echo "Added $INSTALL_DIR to PATH in ~/.bashrc"+ echo "\033[90mAdded $INSTALL_DIR to PATH in ~/.bashrc\033[0m"fiif [ -f "$HOME/.zshrc" ]; thenecho "export PATH=\"$INSTALL_DIR:\$PATH\"" >> "$HOME/.zshrc"- echo "Added $INSTALL_DIR to PATH in ~/.zshrc"+ echo "\033[90mAdded $INSTALL_DIR to PATH in ~/.zshrc\033[0m"fiif [ -f "$HOME/.profile" ] && [ ! -f "$HOME/.bashrc" ] && [ ! -f "$HOME/.zshrc" ]; thenecho "export PATH=\"$INSTALL_DIR:\$PATH\"" >> "$HOME/.profile"- echo "Added $INSTALL_DIR to PATH in ~/.profile"+ echo "\033[90mAdded $INSTALL_DIR to PATH in ~/.profile\033[0m"fi# Add to current session@@ -90,67 +159,18 @@ fi# Verify installationif command -v cua &> /dev/null; then- echo "β CUA CLI $VERSION installed successfully to $INSTALL_DIR/cua"- echo ""- echo "π Get started with:"- echo " cua auth login"- echo " cua vm create --os linux --configuration small --region north-america"- echo ""- echo "π For more help, visit: https://docs.cua.ai/libraries/cua-cli"+ # Determine which config file was updated+ config_file="$HOME/.bashrc"+ if [ -f "$HOME/.zshrc" ]; then+ config_file="$HOME/.zshrc"+ elif [ -f "$HOME/.profile" ]; then+ config_file="$HOME/.profile"+ fi++ print_success "$(which cua)" "$VERSION" "$config_file"+ exit 0else- echo "β Installation failed. Please try installing manually:"+ echo "\033[90mβ Installation failed. Please try installing manually:"echo " curl -fsSL https://cua.ai/install.sh | sh"exit 1fi--# Function to install with bun as fallback-install_with_bun() {- echo "π¦ Installing CUA CLI using Bun..."-- # Check if bun is already installed- if ! command -v bun &> /dev/null; then- echo "π¦ Installing Bun..."- curl -fsSL https://bun.sh/install | bash-- # Source the shell profile to make bun available- if [ -f "$HOME/.bashrc" ]; then- source "$HOME/.bashrc"- elif [ -f "$HOME/.zshrc" ]; then- source "$HOME/.zshrc"- fi-- # Add bun to PATH for this session- export PATH="$HOME/.bun/bin:$PATH"- fi-- # Verify bun installation- if ! command -v bun &> /dev/null; then- echo "β Failed to install Bun. Please install manually from https://bun.sh"- exit 1- fi-- echo "π¦ Installing CUA CLI..."- if ! bun add -g @trycua/cli; then- echo "β Failed to install with Bun, trying npm..."- if ! npm install -g @trycua/cli; then- echo "β Installation failed. Please try installing manually:"- echo " npm install -g @trycua/cli"- exit 1- fi- fi-- # Verify installation- if command -v cua &> /dev/null; then- echo "β CUA CLI installed successfully using Bun!"- echo ""- echo "π Get started with:"- echo " cua auth login"- echo " cua vm create --os linux --configuration small --region north-america"- echo ""- echo "π For more help, visit: https://docs.cua.ai/libraries/cua-cli"- else- echo "β Installation failed. Please try installing manually:"- echo " npm install -g @trycua/cli"- exit 1- fi-}