-
Notifications
You must be signed in to change notification settings - Fork 4
Installation & Setup
Welcome! This guide will help you install and run gcp-ops-bot locally, so you can start monitoring your Google Cloud environment and even chat with it using natural language via Google GenAI.
Make sure the following are installed on your machine:
- Python 3.8+
- Google Cloud SDK (
gcloud) - Git
Open a terminal and run:
git clone https://github.com/Retailogists/gcp-ops-bot.git
cd gcp-ops-botpython3 -m venv venv
source venv/bin/activatepython -m venv venv
venv\Scripts\activateWith your virtual environment activated, install the Python packages:
pip install -r requirements.txtThis file holds your config values (GenAI key, project ID, region, etc.).
Copy the template and fill in your values:
cp .env.example .envThen edit .env:
GENAI_API_KEY=your_genai_api_key # Optional if not using GenAI features
GCP_PROJECT_NUMBER=123456789012
GCP_PROJECT_ID=your-project-id
GCP_REGION=your_region_here
GCP_ZONE=your_zone_here💡 If you're not using GenAI, you can leave the
GENAI_API_KEYempty.
This bot uses Application Default Credentials (ADC) to authenticate with GCP APIs.
gcloud auth application-default loginGenerate and download a JSON key for your service account.
Then set the environment variable:
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/key.json"set GOOGLE_APPLICATION_CREDENTIALS=C:\path\to\your\key.jsonStart the interactive monitoring bot:
python main.pyYou’ll see:
GCP Monitoring Bot started. Type 'q', 'quit', or 'exit' to stop.
--------------------------------------------------
User :>
You can now enter natural language queries like:
List all custom service accounts in my project
To verify that everything is working, run:
python main.pyAnd enter:
List VMs in us-central1-a
✅ If you get a valid response — you're all set!
- Usage Guide: Learn how to use the bot with real prompts and examples.
- Contributing: Want to improve this project? Here's how to get started.
Need help? Open an issue — we’re happy to help!