-
Notifications
You must be signed in to change notification settings - Fork 3
Usage Guide
Once you've installed and authenticated gcp-ops-bot
, you're ready to start using it.
The bot uses natural language prompts and GCP APIs (optionally enhanced with GenAI) to respond with helpful insights about your cloud infrastructure.
Run the following command in your terminal:
python main.py
You’ll see:
GCP Monitoring Bot started. Type 'q', 'quit', or 'exit' to stop.
--------------------------------------------------
User :>
You’re now in an interactive prompt. Type your questions and the bot will respond!
- Your question is passed to Google GenAI (if enabled), along with relevant GCP data.
- The bot fetches info using the Google Cloud APIs (Monitoring, Logging, Compute, etc.).
- It formats a human-readable answer back to you.
Here are some example questions you can try out immediately:
List all custom service accounts in my project
✅ Expected Output:
A list of non-default service accounts, including email and description.
What virtual machines are running in us-central1-a?
✅ Expected Output:
A table or list of VM names, zones, machine types, and statuses.
Show CPU usage for the past 30 minutes
✅ Expected Output:
A summary or graph data of recent CPU metrics for one or more instances.
Give me logs from the last hour for compute instances
✅ Expected Output:
Structured logs or summarized insights from Cloud Logging.
If you’ve added your GENAI_API_KEY
in .env
, try this:
What could explain the spike in CPU usage yesterday?
✅ Expected Output:
An AI-generated interpretation of possible causes using both logs and metrics.
Type:
exit
or
quit
-
Nothing happens when I type: Make sure you're in the
venv
and.env
is properly configured. -
Permission denied or not found errors: Ensure you've authenticated with
gcloud auth application-default login
or set a service account key. -
"API not enabled" errors: Enable required APIs like:
- Cloud Logging API
- Cloud Monitoring API
- Compute Engine API
-
Use project-specific prompts:
Show VMs running in project `my-project-id`
-
Narrow logs by resource type or label:
Get logs for VM `instance-1` in zone `us-central1-a`
If you'd like to contribute your own examples, please check the Contributing Guide and submit a PR!
Need help? Open an issue — we’re happy to help.