Skip to content

A powerful command-line tool for managing ADK (Agent Development Kit) agents in Google Cloud's Gemini Enterprise platform.

License

Notifications You must be signed in to change notification settings

florianchrometz/agent-manager-for-gemini-enterprise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Agent Manager for Gemini Enterprise

A powerful command-line tool for managing ADK (Agent Development Kit) agents in Google Cloud's Gemini Enterprise platform. This tool provides an easy-to-use interface for creating, listing, updating, and deleting agents without the need to manually construct complex API calls.

πŸš€ Quick Install

Install and run with a single command:

curl -sSL https://raw.githubusercontent.com/florianchrometz/agent-manager-for-gemini-enterprise/refs/heads/main/gemini-agent-manager.sh -o agent-manager-for-gemini-enterprise.sh && chmod +x agent-manager-for-gemini-enterprise.sh && ./agent-manager-for-gemini-enterprise.sh

πŸ“‹ Prerequisites

Before using this tool, ensure you have:

  1. Google Cloud CLI (gcloud) installed and configured

    # Install gcloud CLI
    curl https://sdk.cloud.google.com | bash
    exec -l $SHELL
    gcloud init
  2. Authentication: You must be authenticated with gcloud

    gcloud auth login
    gcloud config set project YOUR_PROJECT_ID
  3. Required permissions: Your account needs the following IAM roles:

    • Discovery Engine Admin (includes agents.manage permission)
    • Vertex AI User or Vertex AI Viewer (for the discoveryengine service account)
  4. Additional tools (usually pre-installed):

    • curl - for API calls
    • jq - for JSON processing (install via package manager if missing)

πŸ› οΈ Installation Options

Option 1: Direct Download and Run

curl -sSL https://raw.githubusercontent.com/florianchrometz/agent-manager-for-gemini-enterprise/main/agent-manager-for-gemini-enterprise.sh -o agent-manager-for-gemini-enterprise.sh
chmod +x agent-manager-for-gemini-enterprise.sh
./agent-manager-for-gemini-enterprise.sh

Option 2: Clone Repository

git clone https://github.com/florianchrometz/agent-manager-for-gemini-enterprise.git
cd agent-manager-for-gemini-enterprise
chmod +x agent-manager-for-gemini-enterprise.sh
./agent-manager-for-gemini-enterprise.sh

Option 3: Install to System PATH

curl -sSL https://raw.githubusercontent.com/florianchrometz/agent-manager-for-gemini-enterprise/main/agent-manager-for-gemini-enterprise.sh -o /usr/local/bin/gemini-agent-manager
chmod +x /usr/local/bin/gemini-agent-manager
# Now you can run 'gemini-agent-manager' from anywhere

🎯 Usage

Interactive Mode (Recommended for beginners)

Simply run the script without arguments to enter interactive mode:

./agent-manager-for-gemini-enterprise.sh

The tool will guide you through:

  1. Initial setup (if needed)
  2. Main menu with all available operations
  3. Step-by-step prompts for each action

Command Line Mode

Use specific commands for automation and scripting:

# Show help
./agent-manager-for-gemini-enterprise.sh help

# Interactive setup
./agent-manager-for-gemini-enterprise.sh setup

# List all agents
./agent-manager-for-gemini-enterprise.sh list --project-id my-project --app-id my-app --location eu

# Add a new agent
./agent-manager-for-gemini-enterprise.sh add --project-id my-project --app-id my-app --location eu

# View agent details
./agent-manager-for-gemini-enterprise.sh view --project-id my-project --app-id my-app --location eu

# Update an agent
./agent-manager-for-gemini-enterprise.sh update --project-id my-project --app-id my-app --location eu

# Remove an agent
./agent-manager-for-gemini-enterprise.sh remove --project-id my-project --app-id my-app --location eu

🌍 Supported Regions

The tool supports all major Google Cloud regions:

Location Code Region Discovery Engine Endpoint
eu Europe eu-discoveryengine.googleapis.com
us United States discoveryengine.googleapis.com
de Germany eu-discoveryengine.googleapis.com
au Australia discoveryengine.googleapis.com
in India discoveryengine.googleapis.com
ca Canada discoveryengine.googleapis.com

The tool automatically maps these to the correct Reasoning Engine locations and Discovery Engine endpoints.

πŸ“ Configuration

Required Parameters

  • Project ID: Your Google Cloud Project ID
  • App ID: Your Gemini Enterprise Application ID
  • Location: The region where your Gemini Enterprise is deployed

Configuration Methods

  1. Interactive Setup: Run ./agent-manager-for-gemini-enterprise.sh setup
  2. Command Line Options: Use --project-id, --app-id, and --location flags
  3. Environment Variables: The tool will detect the current gcloud project automatically

Finding Your App ID

Your App ID can be found in:

  1. The Gemini Enterprise console URL
  2. The engines list in Google Cloud Console β†’ Discovery Engine
  3. Previous API responses from agent operations

πŸ”§ Features

βœ… Agent Management Operations

  • List Agents: View all agents with their details
  • View Agent: Get detailed information about a specific agent
  • Add Agent: Create new ADK agents with guided prompts
  • Update Agent: Modify existing agent properties
  • Remove Agent: Delete agents with confirmation prompts

βœ… User Experience

  • Interactive Mode: Guided menus and prompts
  • Command Line Mode: Perfect for scripting and automation
  • Colored Output: Clear visual feedback with color-coded messages
  • Error Handling: Comprehensive error checking and user-friendly messages
  • Validation: Automatic validation of configuration and inputs

βœ… Integration Features

  • gcloud Integration: Automatic project detection and authentication
  • Regional Support: Smart endpoint selection based on location
  • Reasoning Engine Mapping: Automatic location mapping for ADK deployments
  • JSON Processing: Clean output formatting and data extraction

πŸ“– Examples

Example 1: Complete Setup and Agent Creation

# 1. Run interactive setup
./agent-manager-for-gemini-enterprise.sh setup

# 2. List current agents
./agent-manager-for-gemini-enterprise.sh list

# 3. Add a new agent (will prompt for details)
./agent-manager-for-gemini-enterprise.sh add

Example 2: Automated Script Usage

#!/bin/bash
PROJECT_ID="my-gcp-project"
APP_ID="my-gemini-enterprise-app"
LOCATION="eu"

# List all agents
./agent-manager-for-gemini-enterprise.sh list \
  --project-id "$PROJECT_ID" \
  --app-id "$APP_ID" \
  --location "$LOCATION"

# View specific agent
./agent-manager-for-gemini-enterprise.sh view \
  --project-id "$PROJECT_ID" \
  --app-id "$APP_ID" \
  --location "$LOCATION" \
  "agent_id_here"

Example 3: CI/CD Integration

# GitHub Actions example
- name: List Gemini Agents
  run: |
    curl -sSL https://raw.githubusercontent.com/florianchrometz/agent-manager-for-gemini-enterprise/main/agent-manager-for-gemini-enterprise.sh -o agent-manager-for-gemini-enterprise.sh
    chmod +x agent-manager-for-gemini-enterprise.sh
    ./agent-manager-for-gemini-enterprise.sh list \
      --project-id ${{ secrets.GCP_PROJECT_ID }} \
      --app-id ${{ secrets.GEMINI_ENTERPRISE_APP_ID }} \
      --location eu \
      --non-interactive

πŸ” Security Considerations

  • Authentication: Uses your existing gcloud authentication
  • Permissions: Requires Discovery Engine Admin role
  • No Secrets: No API keys or secrets are stored in the script
  • Audit Trail: All operations are logged through Google Cloud's audit system

πŸ› Troubleshooting

Common Issues

  1. "Not authenticated with gcloud"

    gcloud auth login
    gcloud auth application-default login
  2. "Could not retrieve project number"

    gcloud config set project YOUR_PROJECT_ID
    # Ensure you have access to the project
  3. "API Error: Permission denied"

    • Verify you have Discovery Engine Admin role
    • Check that the discoveryengine service account has Vertex AI permissions
  4. "jq: command not found"

    # Ubuntu/Debian
    sudo apt-get install jq
    
    # macOS
    brew install jq
    
    # CentOS/RHEL
    sudo yum install jq
  5. "Agent not found" when listing

    • Verify your App ID is correct
    • Ensure you're using the right location/region
    • Check that the Gemini Enterprise app exists

Debug Mode

For additional debugging information, you can modify the script to add:

set -x  # Add after the initial set -e line for verbose output

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Development Setup

git clone https://github.com/florianchrometz/agent-manager-for-gemini-enterprise.git
cd agent-manager-for-gemini-enterprise
chmod +x agent-manager-for-gemini-enterprise.sh

# Test the script
./agent-manager-for-gemini-enterprise.sh help

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support


Made with ❀️ for the Google Cloud and Gemini Enterprise community

About

A powerful command-line tool for managing ADK (Agent Development Kit) agents in Google Cloud's Gemini Enterprise platform.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages