mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 01:10:12 -08:00
feat: Add google-gemini-setup script for installing and launching gemini-cli
This commit is contained in:
34
google-gemini-setup.sh
Executable file
34
google-gemini-setup.sh
Executable file
@@ -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 "$@"
|
||||
Reference in New Issue
Block a user