Skip to main content

An OpenAI-powered assistant for managing Google Cloud Platform resources.

Project description

GCPMate - Google Cloud Platform Assistant

GCPMate is a tool that helps you manage your Google Cloud Platform (GCP) resources. It uses OpenAI's powerful language models to understand what you want to do, and then generates GCP command-line instructions for you to execute. If you like the proposed outcome, GCPMate can also execute the commands for you!

Installation

To use GCPMate, you'll need to have Python 3.x and an OpenAI API key. To install GCPMate, simply run:

pip install gcpmate

In current version program expects to find API key in env variable OPENAI_API_KEY. You can obtain the API key at https://platform.openai.com/account/api-keys. Once ready, you can set up env variable by running:

export OPENAI_API_KEY=<your-api-key>

Usage

GCPMate will use OpenAI's language models to understand your query, and then generate a series of GCP command-line instructions for you to execute. If you like the proposed outcome, GCPMate can also execute the commands for you! To use GCPMate, simply run:

gcpmate "<your query>"

Where <your query> is a description of what you want to achieve in GCP.

To get an explanation for a command, error or even custom query, you can use the following command:

gcpmate --explain "your query"

Replace "your query" with the text you want to explain. Be sure to use single quotes if your query contains double quotes, and vice versa.

Examples

Here are some example queries you can use with GCPMate:

gcpmate "create a new GCP project called my-superb-new-project"
gcpmate "create ubuntu VM called superbvm in us-central1-a in project <xyz>"

You can also use GCPMate to ask queries, or paste error messages, or ask to explain a command:

gcpmate --explain "Why I cannot connect to my VM over ssh?"
gcpmate -e " gcloud compute instances create newvm --project superproject324 --zone us-central1-a --image-family ubuntu-1804-lts --image-project ubuntu-os-cloud"
# this query will return explaination what that command would do.

Options

GCPMate supports several command-line options:

gcpmate -h  # Show the help message and exit
gcpmate -m <model>  # Specify the OpenAI model to use (default: text-davinci-003)
gcpmate -s  # Skip printing "Fair warning" and runtime info (gcloud account, project, region, zone, OpenAI model)
gcpmate -e  # Return explanation to given query, which can be command, error message, etc.

Contributing

If you find a bug or have a feature request, please open an issue on the GCPMate GitHub repository: https://github.com/ontaptom/gcpmate

Pull requests are also welcome! If you want to contribute to GCPMate, please fork the repository, create a new branch, and then submit a pull request. Please ensure that your code passes the existing tests and linting rules.

License

This project is licensed under the terms of the Apache License 2.0. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcpmate-1.0.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gcpmate-1.0.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file gcpmate-1.0.0.tar.gz.

File metadata

  • Download URL: gcpmate-1.0.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for gcpmate-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b91cd41cbee0948f46955c1a40f72f0a64ee6a2d65eaa586b7a0271bb86a17d4
MD5 24ee502c661ea8fa425ec1466a51a364
BLAKE2b-256 f89a75bd0a33a0cf01f091e408d9fb823611943142fd272f5ca86fad289b691a

See more details on using hashes here.

File details

Details for the file gcpmate-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gcpmate-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for gcpmate-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11accfc32aebdba74266926afef397dc23e00372e249a1002085b7c65942dbea
MD5 f362d5e138e375716ab94dc55d0f62fc
BLAKE2b-256 b2e630e832cd7113f1c75b3aaec4ffbf9808ceb983eb248f92c7cb46af05b55b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page