Skip to main content

OpsCode

Terminal-native AI agent for DevOps, SRE, and Platform Engineering

OpsCode is an open-source coding agent built on the Deep Agents SDK and LangGraph. It works with 20+ LLM providers (Anthropic, OpenAI, Google, and more), ships with 6 specialized DevOps subagents, and can be extended with custom skills, plugins, and MCP servers.

Unlike general-purpose coding agents, OpsCode understands infrastructure. It knows about state locking, blast radius, IAM policies, and why terraform apply without review is a terrible idea. It produces diffs and plans — not unreviewed deployments.


Quick install

curl -LsSf https://raw.githubusercontent.com/talkops-ai/opscode/main/scripts/install.sh | bash

# Launch the interactive TUI
ops

See the Quickstart to configure provider credentials and run your first task.


Why OpsCode?

General-purpose coding agents are great at application code. But they weren't built for infrastructure. They don't understand state locking, blast radius, or why running terraform apply without review is a terrible idea.

OpsCode is purpose-built for the infrastructure lifecycle.

How it compares

FeatureAiderOpenHandsClaude CodeOpsCode
InterfaceTerminal CLIWeb Canvas / CLITerminal CLITerminal TUI & Headless CLI
FocusGit-native app codeFull-stack softwareGeneral codingDevOps, SRE, & Platform IaC
GuardrailsGit revertDocker sandboxUser confirmation3-Tier Approval + Shell/Unicode Scanners
Multi-Agent MemoryShared contextMulti-agent threadsMonolithic contextIsolated BranchMemoryStore per subagent
IaC State Safety"Produce Diffs, Not Deployments"
ExtensibilityLimitedPlugin APISkills/MCPPlugins, Marketplace, Custom Subagents, MCP
CI/CD Self-GradingTest suitesAutonomous --rubric grader loops
MCP IntegrationNativeNativeNative + 4-Tier Security Guard

Domain expertise with isolated subagents

Generic coding agents dump hundreds of lines of raw Terraform schemas, Kubernetes manifests, and CLI errors straight into the main context window. That leads to context overflow and hallucinated configs.

OpsCode ships with 6 specialized subagents — each running in its own isolated memory sandbox (BranchMemoryStore). When a subagent searches AWS docs or iterates on a broken plan, all that intermediate work stays inside the subagent. Only the final, validated result comes back to your workspace.

Extend it to any stack

The built-in subagents cover Terraform, OpenTofu, Kubernetes, Ansible, Jenkins, and GitHub Actions. But OpsCode is designed to be extended:

  • Plugin system: Install plugins from a marketplace or drop them into .opscode/plugins/ — each can bundle new skills, subagents, MCP servers, and slash commands.
  • Custom subagents: Create your own subagents in .opscode/agents/ or ~/.opscode/agents/ — just an AGENTS.md file with YAML frontmatter.
  • 7-tier skill hierarchy: Add skills at any level — built-in, plugin, user, or project — with deterministic priority resolution.
  • Async remote subagents: Connect to remote LangGraph deployments via config.toml for distributed workloads.

Safety first, not unchecked autonomy

Application code gone wrong? git revert and move on. Infrastructure gone wrong? Corrupted .tfstate files, dropped databases, public security groups — those create real damage with real blast radius.

OpsCode follows the "Produce Diffs, Not Deployments" principle:

  • It generates plans, validates syntax, and inspects schemas.
  • It shows you syntax-highlighted diffs and waits for your explicit approval.
  • It will not run terraform apply or perform destructive operations without your consent.

Works in your terminal and your pipelines

OpsCode isn't just an interactive tool — it runs equally well in CI/CD:

  • Interactive TUI: Rich Textual interface with live reasoning streams, /model hot-swapping, and Shift+Tab to toggle approval modes on the fly.
  • Headless Mode (-n): Pipe it into Jenkins, GitHub Actions, or GitLab CI. Example: cat pod.yaml | ops -n "..." --rubric @specs/k8s.md -y

Capabilities

Core tools

OpsCode comes with a set of built-in tools for filesystem operations, shell execution, web search, and more:

ToolWhat it does
executeRun shell commands with stdout/stderr capture, timeouts, and safety checks
read_file / write_file / edit_fileRead, create, and edit files with precision replacements
deleteRemove files (gated behind approval)
glob / grep / lsSearch and browse the filesystem
web_searchSearch the web for docs, CVEs, error codes, and release notes
fetch_urlExtract content from documentation URLs
js_evalEvaluate JavaScript in an in-memory QuickJS interpreter
get_goal / update_goalInspect and update goal acceptance criteria
get_rubricRetrieve rubric specifications for self-evaluation

Built-in skills

Four global skills are always available to the root agent:

SkillWhat it covers
cloud-coreCloud infrastructure fundamentals — IAM, networking, tagging, cost governance
dockerDockerfile best practices, multi-stage builds, rootless security, caching
kubernetesK8s manifests, Pod Security Standards, RBAC, NetworkPolicies, probes
rememberSaves learnings and conventions to persistent memory or new reusable skills

Skills are loaded from multiple locations with a clear priority order — project-level skills override user-level, which override plugin and built-in defaults. See Memory and Skills for the full resolution order.

Built-in subagents

OpsCode ships with 6 DevOps subagents, each with their own system prompts, domain skills, and isolated memory:

SubagentDomainSkills
aws-opentofu-provisionerOpenTofu on AWS7 skills covering IAM, VPC, state management, testing, and MCP schema lookup
aws-terraform-module-writerTerraform on AWS7 skills for IAM policies, VPC patterns, module layout, and repair loops
ci-jenkins-automaterJenkins CI4 skills for pipeline generation, Job DSL, shared libraries, and testing
github-actions-writerGitHub Actions4 skills for workflow architecture, performance, and security hardening
infra-ansible-provisionerAnsible7 skills for playbook authoring, linting, execution environments, and security
k8s-helm-provisionerKubernetes & Helm5 skills for chart authoring, schema validation, secrets, and deployment recovery

Each subagent runs with isolated memory — intermediate work (AWS doc searches, plan iterations) stays inside the subagent and doesn't pollute your main context. See Subagents.

Platform features

FeatureWhat it does
Persistent memoryProject-scoped and user-scoped AGENTS.md files carry context across sessions
Skill hierarchySkills are discovered from built-in, plugin, user, and project directories with clear precedence
MCP toolsConnect external tools via Model Context Protocol — with automatic security classification in headless mode
Plugins & marketplacesInstall community or team plugins that bundle skills, subagents, MCP servers, and commands
3 approval modesManual, Auto, and YOLO — switch mid-session with Shift+Tab
Goals & rubricsSet interactive goals with acceptance criteria, or grade work automatically in CI/CD
Remote sandboxesRun in ephemeral cloud environments (AgentCore, Daytona, Modal, and more)
Context compactionAutomatically summarizes older messages when approaching context limits
Cost trackingReal-time token usage and USD cost calculation across all providers
HooksRun custom logic before or after tool execution via hooks.json

DevOps environment awareness

OpsCode automatically detects and preserves your infrastructure environment:

  • Kubernetes: KUBECONFIG, KUBE_CONTEXT
  • AWS: AWS_PROFILE, AWS_REGION, AWS_DEFAULT_REGION, AWS_SHARED_CREDENTIALS_FILE
  • GCP: GOOGLE_APPLICATION_CREDENTIALS, GOOGLE_CLOUD_PROJECT, CLOUDSDK_CORE_PROJECT
  • Azure: AZURE_SUBSCRIPTION_ID, AZURE_TENANT_ID
  • Ansible: ANSIBLE_CONFIG, ANSIBLE_INVENTORY
  • Helm: HELM_HOME, HELM_REPOSITORY_CONFIG
  • ArgoCD: ARGOCD_SERVER, ARGOCD_AUTH_TOKEN
  • Terraform / OpenTofu: TF_CLI_CONFIG_FILE, TERRAGRUNT_CONFIG

It also recognizes DevOps project markers (terragrunt.hcl, Chart.yaml, ansible.cfg, .opscode/) alongside standard ones (.git, pyproject.toml, package.json).


Architecture

OpsCode is built on:

  • Deep Agents SDK — Agent framework with turn streaming, subagent orchestration, and middleware
  • LangGraph — Stateful agent orchestration with SQLite checkpointing
  • LangChain — LLM provider abstraction and tool interfaces
  • Textual — Terminal UI framework for the interactive TUI
  • MCP — Model Context Protocol for external tool integration

Every agent turn passes through a modular middleware pipeline that handles context injection, model hot-swapping, safety classification, skill discovery, session checkpointing, rubric grading, and subagent dispatch.

For the complete data location reference, see Configuration.


Not for you if...

We'd rather be upfront about what OpsCode isn't:

  • Not a replacement for code review. Every infrastructure change should still be reviewed by a qualified engineer before it hits production.
  • Not an unmonitored deploy bot. OpsCode produces diffs and plans. It doesn't blindly run terraform apply -auto-approve on your live environment.
  • Not for zero-IaC-knowledge users. You need to understand Terraform, Kubernetes, or Ansible basics to meaningfully review what the agent proposes. If you can't read the diff, you shouldn't approve it.

Contributing

We'd love your help. Check out the Contributing Guidelines and Security Policy before opening a PR.

git clone https://github.com/talkops-ai/opscode.git
cd opscode
uv venv && source .venv/bin/activate
uv pip install -e ".[dev,test-integration]"
uv run pytest tests/ -m unit -v

What's next