Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Play.Infra ๐Ÿš€

If you found this project useful, please give it a โญ๏ธ to show your support!

Play.Infra Screenshot AI Harness SDK Options

Play.Infra is a self-hosted, vendor-agnostic AI Playground built specifically for infrastructure operations. It gives you a unified, web-based chat interface to orchestrate your local or remote infrastructure through various popular AI pair programmer SDKs available today: GitHub Copilot SDK, Google Antigravity, Cursor SDK, and Claude Agent SDK.

Play.Infra is built around your existing subscriptions. If you have a GitHub Copilot license, you can connect the Github Copilot SDK. If you subscribe to Google AI Studio, you can use Antigravity. If you are a Cursor Pro user, connect the Cursor SDK. Have AWS Bedrock credits or an Anthropic account? Connect Claude Agent directly. Use what you already pay for!

By wrapping best-in-class agentic SDKs into a single backend, Play.Infra lets you seamlessly switch between AI providers without vendor lock-in. You bring your own credentials (BYOK), and the agent securely runs terminal commands, utilizes extensible Agent Skills, reads files, and writes code on your behalf in an ephemeral, isolated environment.


๐ŸŒŸ Why Play.Infra?

Infrastructure automation usually requires jumping between AWS consoles, terminal tabs, and configuration files. While standard AI models can write infrastructure code, they lack the native runtime context and system access to safely execute and validate it.

Play.Infra bridges this gap. It turns raw programmatic AI SDKs into a unified, secure web canvas tailored specifically for DevOps, Cloud, and Site Reliability Engineers.:

  • Multi-Harness Evaluation: Choose between you favorite harness: GitHub Copilot, Claude Agent, Antigravity, and Cursor directly in the UI, with easy login and setup. Authenticate using PATs, OAuth, or API keys from supported LLM providers (BYOK).
  • Connect & Verify Instantly: Securely plug in your AWS credentials, Kubernetes contexts (kubeconfig), and GitHub tokens directly through the UI. You can instantly test these connections with a single click to ensure the agent has the exact access it needs before launching any workflows.
  • Agentic Autonomy Without the Complexity: Play.Infra empowers LLMs to directly utilize the super fast CLI and terminal tools you already trust (aws, kubectl, terraform, gh) by dynamically injecting their required configurations. It also supports expanding those capabilities instantly via widely supported Agent Skills.
  • Bring Your Own Keys (BYOK): Don't pay for additional AI subscriptions. Play.Infra connects directly to AWS Bedrock, Anthropic Console, Google AI Studio, or GitHub using your existing API keys and corporate billing.
  • Security & Isolation: Credentials are provided directly via your browser session and are never permanently stored on the server. For each execution, Play.Infra generates a unique, ephemeral directory to securely write your session's tokens (kubeconfig, aws, github), and injects them as strict environment paths (e.g. KUBECONFIG, AWS_CONFIG_FILE) into the agent's isolated environment. Once the task completes, the temporary credentials are automatically destroyed.

๐Ÿค– Supported SDK's

Play.Infra abstracts the complexity of individual SDKs to provide a unified streaming UI for:

  • GitHub Copilot SDK: The official GitHub Copilot SDK. Personal and Enterprise accounts.
  • Google Antigravity SDK: Google's official advanced agentic coding assistant designed for complex, multi-step infrastructure workflows..
  • Cursor SDK: Connect via the Cursor's Offical Python SDK.
  • Claude Agent SDK: Powered by Anthropic's official Agent SDK. Supports standard Anthropic API keys OR Amazon Bedrock BYOK (bring your own AWS credentials) via environmental injection.

๐Ÿ› ๏ธ Core Capabilities

Play.Infra is a powerful chatbot and orchestrator that uses terminal commands, Agent Skills, MCP's for resolving issues and collecting data. It features pre-built workflows and a flagship Playground for free-form infrastructure management.

Play.Infra Screenshot Prompt

๐Ÿงฉ Extensible Agent Skills

Play.Infra natively supports Agent Skills, allowing you to instantly expand what the AI can do without writing code.

  • Bundled Skills: The app comes pre-bundled with a /mermaid skill, empowering the agent to dynamically produce technical Mermaid diagrams (flowcharts, architecture maps, etc.) based on the live infrastructure resources it analyzes.
  • Upload Your Own: Easily upload and manage your own custom skills directly through the UI to tailor the agent to your specific organizational needs and internal CLI tools.

๐Ÿ”Œ Seamless Infrastructure Connectivity

Effortlessly link your cloud environments and repositories directly from the UI sidebar. Paste your kubeconfig for Kubernetes, enter your AWS credentials or paste credentials file content directly, or provide a GitHub PAT. Built-in "Test Connection" buttons verify access instantly, ensuring the agent is ready to execute kubectl, aws, terraform and gh commands on your behalf.

๐Ÿ“Š Interactive Mermaid Diagrams

Play.Infra renders Mermaid diagrams embedded in Markdown directly in the chat UI. By scanning live AWS accounts or Kubernetes clusters, the agent can instantly generate infrastructure maps, deployment flowcharts, and network diagrams. This helps understand complex microservice dependencies, verify that deployments match the intended architecture, and other documentations.

๐Ÿ“ Prompt Templates

Play.Infra includes a built-in Prompt Templates engine. You can use and customize reusable prompt blueprints to establish best practices, standardize infrastructure generation, and save time on repeated tasks (like scaffolding new microservices or performing routine Kubernetes audits).

Play.Infra Screenshot Prompt Template

Feature Description
๐ŸŽฎ Playground (Flagship Feature) A free-form orchestration environment where the true power of Play.Infra shines. Ask the agent to perform multi-step workflows across AWS, Terraform, Kubernetes, and GitHubโ€”all in one session. Connect your credentials, and the Playground gives you an unconstrained agentic shell to explore, debug, and build whatever you need.
๐Ÿ›ก๏ธ AWS Governance (beta) Audit S3, SQS, SNS, DynamoDB, EC2, Load Balancers, and IAM for compliance and security best practices. The agent will run AWS CLI commands to scan your accounts.
๐Ÿ—๏ธ IaC Generator (beta) Reverse-engineer existing AWS infrastructure into production-quality Terraform HCL. The agent pulls live configurations and translates them into .tf state files.
โ˜ธ๏ธ Kubernetes Ops Run kubectl against your cluster โ€” perform health checks, troubleshoot failing pods, audit RBAC policies, and trace logs automatically.

๐Ÿ’ก Real-World Use Cases

Because Play.Infra injects your credentials into a secure, isolated shell session, the AI can perform complex, cross-domain troubleshooting that would normally take hours:

Play.Infra Screenshot Prompt Response

  • Cross-Platform Root Cause Analysis: Bring your kubeconfig and GitHub PAT. If a pod is failing, simply ask the agent to "investigate the logs in the payment-service pod and correlate the error with the source code in the backend-api GitHub repository." The agent will run kubectl logs, parse the stack trace, clone or search the repo using gh, and pinpoint the exact line of code causing the failure and even submit a Pull Request.
  • Autonomous Cluster Healing: Connect your kubeconfig and ask the agent to "debug and fix the frontend-app deployment which is failing with a CrashLoopBackOff error." The agent will pull events, analyze the logs, identify the misconfiguration (e.g., a missing environment variable or OOM kill), and apply the fix.
  • Infrastructure as Code Audits: Connect your AWS credentials and ask the agent to "find all S3 buckets without versioning enabled and generate the Terraform code required to fix them." The agent will scan your AWS account using the AWS CLI and output ready-to-apply .tf files.
  • Seamless Cloud Investigations: Instead of clicking through the AWS Console, GitHub, and your terminal, you have one chat interface with access to everything simultaneously. Itโ€™s incredibly convenient for correlating a recent GitHub deployment to an AWS CloudWatch alarm or a Kubernetes event.

๐Ÿ”Œ Bruno API Collections

A Bruno collection is provided to help you test the backend endpoints locally without using the UI.

  1. Download Bruno from usebruno.com.
  2. Open the bruno/ directory in this project.
  3. Update the environment variables in Bruno (like API_TOKEN and AWS_ACCESS_KEY_ID).
  4. You can directly run tests against the /api/run, /api/models, and /api/followup endpoints.

๐Ÿ›ฃ๏ธ API Routes

Method Path Description
GET / Main UI (Jinja2 rendered)
GET /api/health Service health check
GET /api/models Live list of available models for the selected provider
POST /api/run Start an agentic task โ€” returns an SSE stream
POST /api/followup Send follow-up to an active session โ€” returns an SSE stream
GET /api/oauth/login Begin GitHub OAuth flow

โš™๏ธ Environment Variables

Variable Required Description
BASE_PATH Yes (k8s) Ingress sub-path (e.g. /agents/infra-playground/)
COPILOT_ALLOW_ALL No Allow all tools (default: true)
GITHUB_OAUTH_CLIENT_ID No GitHub OAuth App client ID for Github Copilot Access via Github OAuth
GITHUB_OAUTH_CLIENT_SECRET No GitHub OAuth App client secret for Github Copilot Access via Github OAuth
GH_TOKEN_CLI No GitHub CLI token for GHE (pre-authenticated at startup)
GH_CLI_HOSTNAME No GHE hostname for gh CLI (default: github.com)

๐Ÿš€ Quick Start (Local Development)

git clone https://github.com/kmarrrahul/Play.Infra.git
cd Play.Infra
pip install -r requirements.txt

# Run the Uvicorn server
python -m uvicorn app.main:app --port 8080 --reload

Open http://localhost:8080, select your preferred AI provider, plug in your API key, and start orchestrating your infrastructure!


๐Ÿณ Docker Deployment

Build

.\build_and_push.ps1 -Tag 1.0.4

The Dockerfile bundles Python 3.11, Node.js 20, AWS CLI v2, Terraform CLI, GitHub Copilot CLI, gh CLI, kubectl, and uv.

Run

To ensure localhost resolves flawlessly for GitHub OAuth callbacks (especially on Windows Docker Desktop), explicitly bind both the IPv4 and IPv6 loopbacks:

docker run -it --name play-infra `
  -p 127.0.0.1:8080:8080 -p "[::1]:8080:8080" `
  -e COPILOT_MODEL=claude-haiku-4.5 `
  registry.example.com/myproject/play-infra-ai-harness:0.0.1

Note: If you want to enable the "Sign in with GitHub" OAuth flow specifically for the GitHub Copilot SDK, simply append -e GITHUB_OAUTH_CLIENT_ID=$env:GITHUB_OAUTH_CLIENT_ID -e GITHUB_OAUTH_CLIENT_SECRET=$env:GITHUB_OAUTH_CLIENT_SECRET to the command above.

Selective Image Builds (Optimizing Size)

The final Docker image bundles native agent runtimes (like Go daemons or Node binaries) via Python SDK site-packages, as well as heavy infrastructure binaries, resulting in a default image size of ~1.5 GB. If you only intend to use specific AI Harness SDK's or binaries, you can dramatically reduce the image size (down to ~400 MB) by using Docker build arguments:

# Example: Build an image containing ONLY the Cursor SDK, kubectl, and gh
docker build -t play-infra:antigravity-only \
  --build-arg ENABLE_COPILOT=false --build-arg ENABLE_CLAUDE=false --build-arg ENABLE_CURSOR=false \
  --build-arg ENABLE_TERRAFORM=false \
  .

Available SDK build arguments (default true):

  • ENABLE_COPILOT, ENABLE_CLAUDE, ENABLE_CURSOR, ENABLE_ANTIGRAVITY

Available Binary build arguments (default true):

  • ENABLE_TERRAFORM, ENABLE_KUBECTL, ENABLE_GH

Using helper Script:

To build a lightweight image with only Github Copilot SDK Integration and kubectl, you can run: .\build_and_push.ps1 -EnableClaude $false -EnableCursor $false -EnableAntigravity $false -EnableTerraform $false -EnableGh $false Use available params to build image as needed.

  • Available params: EnableCopilot, EnableClaude, EnableCursor, EnableAntigravity, EnableTerraform, EnableKubectl, EnableGh

โ˜ธ๏ธ Kubernetes Deployment

Play.Infra is fully prepared for multi-tenant production deployments on Kubernetes.

kubectl apply -f k8s/infra-agent-credentials-secret.yaml
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/ingress.yaml

Once deployed, the app will be accessible at your cluster's ingress URL.

About

Orchestrate local and remote infrastructure via chat using the official SDKs for GitHub Copilot, Claude Agent, Antigravity, and Cursor.

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages