diff --git a/google-gemini-setup.sh b/google-gemini-setup.sh new file mode 100755 index 0000000..c62da3c --- /dev/null +++ b/google-gemini-setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +set -e # Exit on any error + +# Colors for output +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +# Check if gemini is installed +if ! command -v gemini &> /dev/null; then + echo -e "${YELLOW}gemini-cli not found, installing...${NC}" + + # Check if npm is available + if ! command -v npm &> /dev/null; then + echo -e "${RED}Error: npm is not installed. Please install Node.js and npm first.${NC}" + exit 1 + fi + + # Install gemini-cli globally + if npm install -g @google/gemini-cli; then + echo -e "${GREEN}gemini-cli installed successfully!${NC}" + else + echo -e "${RED}Error: Failed to install gemini-cli${NC}" + exit 1 + fi +else + echo -e "${GREEN}gemini-cli is already installed${NC}" +fi + +# Always execute gemini CLI after ensuring it's installed +echo -e "${YELLOW}Launching gemini-cli...${NC}" +gemini "$@"