Skip to main content

Conversational autonomous Git and GitHub operations coordinator using Groq-hosted LLMs.

Project description

gitops-by-veera

A production-ready, security-hardened, conversational autonomous Git and GitHub operations coordinator. Convert natural language into safe, validated local Git commands and GitHub REST API calls — powered by Groq-hosted LLMs.


Features

  • Natural language to Git/GitHub actions — describe what you want, GitOps plans and executes it
  • Dual-domain operations — local Git commands and GitHub cloud API calls in a single pipeline
  • Security-first architecture — command injection prevention, path traversal blocking, shell injection defense, and prompt injection resistance
  • Model cascading — automatic fallback across three Groq-hosted model tiers
  • Self-healing remediation — failed operations trigger AI-generated fix suggestions (capped at 2 cycles)
  • Direct evaluation bypass — trivial commands (git status, git diff, git log) skip the LLM entirely for speed
  • Structured JSON contracts — all LLM output is parsed into strict Pydantic models
  • Session telemetry — detailed execution metrics available with --debug
  • Colab/Jupyter compatible — runs in notebooks, cloud runtimes, and local terminals

Installation

From PyPI

pip install gitops-by-veera

From source

git clone https://github.com/vkprince6/gitops-by-veera.git
cd gitops-by-veera
pip install -e ".[dev]"

Google Colab

!pip install gitops-by-veera
import subprocess
subprocess.run(["git-ops", "setup"])

Credentials & Security

GitOps requires two API credentials:

Credential Environment Variable Description
Groq API Key GROQ_API_KEY From console.groq.com
GitHub Token GITHUB_TOKEN Fine-grained PAT with repo read/write scopes

IMPORTANT: Classic admin GitHub tokens are strictly prohibited. You MUST use fine-grained Personal Access Tokens scoped to specific repositories with only the permissions required for your workflow.

Credentials are stored at ~/.gitops_by_veera_config.json with chmod 600 permissions. They are never logged or printed to the terminal.


Setup

git-ops setup

You will be prompted (via getpass) for your Groq API key and GitHub token. Alternatively, set environment variables:

export GROQ_API_KEY="gsk_..."
export GITHUB_TOKEN="github_pat_..."

Usage

Run a natural language pipeline

git-ops run "Stage all files, commit with message 'feat: initial setup', and push to origin main"

Dry-run (plan and validate only — no execution)

git-ops run "Create a branch called feature-xyz and push it" --dry-run

Debug mode with telemetry

git-ops run "Open a PR from feature-xyz to main with title 'New Feature'" --debug

Supported Operations

Local Git

Operation Risk Level
git status, git diff, git log Safe
git add, git commit, git fetch, git pull Safe
git push, git branch, git checkout, git switch Safe
git reset --hard, git clean -fd, git push --force Warning — requires confirmation
git rebase, git cherry-pick, git stash clear Warning — requires confirmation
git filter-branch, git reflog expire, git gc --prune=now Blocked

GitHub Cloud (via REST API)

  • Create repositories (/user/repos, /orgs/{org}/repos)
  • Manage branches and refs (/repos/{owner}/{repo}/git/refs)
  • Open, list, and update Pull Requests (/repos/{owner}/{repo}/pulls)
  • Merge Pull Requests (/repos/{owner}/{repo}/pulls/{number}/merge)
  • Create and update Issues (/repos/{owner}/{repo}/issues)
  • Trigger GitHub Actions workflows (/repos/{owner}/{repo}/actions/workflows/{id}/dispatches)

All DELETE requests and repository-level destructive endpoints are strictly blocked.


Example Workflows

# View repository status (bypasses LLM entirely for speed)
git-ops run "show status"

# Full branch + commit + PR workflow
git-ops run "Create branch feature-auth, commit staged files with message 'feat: add auth', push, and open a PR to main"

# Create a GitHub issue
git-ops run "Create an issue titled 'Bug: login fails on mobile' with a description"

# Trigger a workflow dispatch
git-ops run "Trigger the deploy.yml workflow on the main branch"

Google Colab Integration

!pip install gitops-by-veera

import os
os.environ["GROQ_API_KEY"] = "gsk_..."      # or use Colab secrets
os.environ["GITHUB_TOKEN"] = "github_pat_..."

import subprocess
result = subprocess.run(
    ["git-ops", "run", "show git status", "--dry-run"],
    capture_output=True, text=True
)
print(result.stdout)

Architecture

User prompt
    │
    ├── Direct Evaluation Router (regex bypass for trivial commands)
    │       └── Returns plan immediately, skips LLM
    │
    └── LLM Cascade (Groq API)
            ├── Tier 1: openai/gpt-oss-120b
            ├── Tier 2: openai/gpt-oss-20b
            └── Tier 3: llama-3.1-8b-instant (also used for remediation)
                    │
                    └── Pydantic-validated ExecutionPlan
                            │
                            └── Multi-stage Validator
                                    ├── Binary whitelist enforcement
                                    ├── Shell injection detection
                                    ├── Path traversal blocking
                                    ├── GitHub endpoint whitelist
                                    └── Payload field sanitization
                                            │
                                            └── Sequential Executor
                                                    ├── Local: subprocess.run (shell=False)
                                                    └── Cloud: requests → GitHub REST API
                                                            │
                                                            └── Self-Healing Remediation (≤2 cycles)

Development

pip install -e ".[dev]"

# Run tests
pytest --cov=src/gitops_by_veera --cov-report=term-missing

# Type checking
mypy src/

# Linting
ruff check src/ tests/

License

MIT License — see LICENSE.


Security

See SECURITY.md for the full security architecture and responsible disclosure policy.

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

gitops_by_veera-1.0.1.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

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

gitops_by_veera-1.0.1-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file gitops_by_veera-1.0.1.tar.gz.

File metadata

  • Download URL: gitops_by_veera-1.0.1.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for gitops_by_veera-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c4865114b996f1165e01b68f761f5d1b3862db4555768399a58d9eafb612ad7e
MD5 0d1f8c09dae78036ed9c49d416ee17e1
BLAKE2b-256 295776b78254061296054a497b9202c50cfec758f434f64d4b2784f31db9ffd7

See more details on using hashes here.

File details

Details for the file gitops_by_veera-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gitops_by_veera-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2d435473865c3d561984709e7da49cfdb4f12e9777cebf34dd55bf3a05947b3
MD5 e7a9ce23b705a43fa5b0097de1f804c0
BLAKE2b-256 77fd088b7166ce2da9411eac2f92e38a7aa1f7b5b30195a850c0832547e6d0a7

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