#!/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 "$@"