Skip to main content

InfraGPT

A CLI tool that converts natural language requests into Google Cloud (gcloud) commands.

PyPI GitHub Workflow Status

Installation

From PyPI (Recommended)

Install directly from PyPI:

pip install infragpt

From Source

  1. Clone the repository:

    git clone https://github.com/priyanshujain/infragpt.git
    cd infragpt
    
  2. Install in development mode:

    pip install -e .
    

Usage

API Keys

InfraGPT requires API keys to work:

  • For OpenAI GPT-4o: Set the OPENAI_API_KEY environment variable
  • For Anthropic Claude: Set the ANTHROPIC_API_KEY environment variable

You can set these in your shell:

export OPENAI_API_KEY="your-openai-api-key"
export ANTHROPIC_API_KEY="your-anthropic-api-key"

Command Line

Run InfraGPT directly with a prompt:

infragpt "create a new VM instance called test-vm in us-central1 with 2 CPUs"

Or specify the model to use:

infragpt --model claude "list all my compute instances in europe-west1"

Interactive Mode

Launch InfraGPT in interactive mode (no initial prompt):

infragpt

Example Commands

  • "Create a new GKE cluster with 3 nodes in us-central1"
  • "List all storage buckets"
  • "Create a Cloud SQL MySQL instance named 'mydb' in us-west1"
  • "Set up a load balancer for my instance group 'web-servers'"

Options

  • --model, -m: Choose the LLM model (gpt4o or claude)
  • --verbose, -v: Enable verbose output

Development

Versioning and Releases

The project includes a helper script for versioning:

# Bump the patch version (0.1.0 -> 0.1.1)
./bump_version.py

# Bump the minor version (0.1.0 -> 0.2.0)
./bump_version.py minor

# Bump the major version (0.1.0 -> 1.0.0)
./bump_version.py major

# Bump and create a git commit and tag
./bump_version.py --commit

CI/CD

This project uses GitHub Actions for CI/CD:

  1. Tests Workflow: Runs on every PR and push to master

    • Installs the package
    • Verifies it can be imported
    • Checks package structure
  2. Publish Workflow: Automatically publishes to PyPI

    • Triggers on pushes to the master branch
    • Requires PyPI secrets to be configured in GitHub

To set up PyPI publishing:

  1. Create an API token on PyPI:
  2. Add the token as a GitHub secret:
    • Go to your GitHub repository → Settings → Secrets and variables → Actions
    • Create a new repository secret named PYPI_API_TOKEN
    • Paste your PyPI API token as the value

Metadata

Release files for infragpt 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for infragpt 0.1.0
File Size Uploaded
infragpt-0.1.0.tar.gz 16.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for infragpt 0.1.0
File Interpreter ABI Platform
infragpt-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.2 kB

Release files / infragpt-0.1.0.tar.gz

Download URL infragpt-0.1.0.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0e0417d4a7157c25432d68b15bdc3feaf9cc6f0c90c97d3886527f8ba9f07c41
BLAKE2b-256 checksum
How to use checksums
3a5503d967663c09d5dd942c4150915065ff1b5251788ba03d146b21795b24d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / infragpt-0.1.0-py3-none-any.whl

Download URL infragpt-0.1.0-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce969401e90c65a02df4e4064eb69d7bfe04c936a598ee2535410e291f22e223
BLAKE2b-256 checksum
How to use checksums
fb19e0a9401c178da83f76975ad968b30380f1386456b9eb29733df3fdc3c72e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release history Release notifications | RSS feed

0.1.53

2 release files

0.1.50

2 release files

0.1.45

2 release files

0.1.6

2 release files

0.1.3

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page