opensre README

项目的 README,来自 github.com/Tracer-Cloud/opensre。合并为一个 markdown 文件:README.md。

OpenSRE

OpenSRE: The open-source agent for CI/CD reliability

Your CI tells you it broke, but not why or how to fix it. OpenSRE is a CLI agent that reads the failed run, traces the cause and pushes a fix for you to review. Self-hosted, with your own models.

CI status Project status: public alpha Apache 2.0 License Discord Sponsored by Greptile

Tracer-Cloud%2Fopensre | Trendshift

Quickstart · Docs · FAQ · Security


🚧 Public Alpha: Core workflows are usable for early exploration, though not yet fully stable. The project is in active development, and APIs and integrations may evolve.


Before you begin

Make sure you have:

Step 1: Install and start opensre

macOS or Linux:

curl -fsSL https://install.opensre.com | bash -s -- -gh

Windows (PowerShell):

& ([scriptblock]::Create((irm https://install.opensre.com/install.ps1))) -gh

Then start OpenSRE:

opensre

OpenSRE CLI welcome screen with the sign-in prompt

Windows details: Windows.

The installer fetches the latest build from main without requiring sudo. If opensre is not found, follow the PATH instructions printed by the installer or open a new terminal.

For supported platforms and troubleshooting, see Install locally.


Table of Contents


Why OpenSRE?

AI writes more of the code every month. Someone still has to fix the build.

When CI goes red, it tells you that something failed, not why or how to fix it. Under deadline pressure, teams hit re-run and move on, flaky checks pile up, main stays red, and the real investigation waits for whichever senior engineer has time. OpenSRE is an open-source CI/CD reliability agent that does that investigation for you, built to run on your own infrastructure with your own models:

SWE-bench1 showed that agents improve fastest with realistic tasks and clear feedback. Pipeline failures are slower, noisier and harder to reproduce than local code tasks, so we hold OpenSRE to the same standard by:

Start with the CI/CD overview: analyze a repository's CI reliability, fix failing checks on a PR, or set up an agent that keeps CI green.

Not just CI/CD. The same agent investigates production incidents across your stack. Connect the integrations you run, such as EKS, EC2, CloudWatch, Kubernetes, Grafana (Loki, Mimir/PromQL, Tempo), Alertmanager, Datadog, Slack, and GitHub. Then describe the incident in the interactive shell or route alerts to it. OpenSRE picks the tools that fit, from logs and metrics to pod state and deploy history.

1 https://arxiv.org/abs/2310.06770


Quick Start

Contributors: start at main.py for the process entrypoint map.

Run opensre to sign in and get started. The first launch activates the hosted model.

opensre

Webapp contributors can run opensre setup --dev to authenticate through http://localhost:3000.

Interactive shell — with no subcommand, opensre validates your account and starts a REPL (TTY required). You can exit and stay signed out, but the shell only opens for an active account. Describe incidents in plain language, watch the agent work, and use slash commands for session control (/help, /status, /cost, /sessions, /resume, /compact, /new, /exit) and integrations (/integrations list, /integrations verify). Ctrl+C cancels an in-flight turn without losing session state. See interactive shell commands for the full reference.

Headless CLI — run one agent turn non-interactively from a terminal, script, or CI job:

opensre ask "why is checkout-api slow?"

See Headless CLI for stdin prompts, JSON output, and tool approvals.

From Python — drive the agent in-process from your own code (source checkout required):

from surfaces.embedded import start_embedded_session

session = start_embedded_session()
result = session.chat("why is checkout-api slow?")
# ``answered`` is true for any reply text, including a failed model call.
# That failure sets accounting_status to "not_run" and stop_reason to "error".
if result.action_result.accounting_status == "completed" and not result.cancelled:
    print(result.primary_response_text)

See Python API for sessions, conversations, and custom output sinks.

For your team's daily loop: embed OpenSRE in the Python services and automations your teammates already use. Start with the in-repo Python API guide, then use it every day to make incident response repeatable.

Other useful commands:

opensre integrations setup
opensre update
opensre uninstall   # remove opensre and all local data

Deployment

An OpenSRE Cloud managed gateway, an AWS EC2 path, and a general self-hosted option:

Full deployment steps and prerequisites → DEPLOYMENT.md


How OpenSRE Works

opensre-how-it-works-github

When a CI run fails, an alert arrives, or you ask a question, OpenSRE automatically:

  1. Fetches the relevant context: failing checks and CI logs, recent commits and deploys, and correlated logs, metrics and traces
  2. Masks sensitive identifiers (optional) before external LLM calls
  3. Reasons across your connected systems to test hypotheses in a tool-calling loop, separating CI-caused failures from code-caused ones
  4. Answers with an evidence-linked response in the conversation
  5. Fixes the cause and pushes it to the PR branch for you to review, or suggests next steps and, optionally, executes remediation actions
  6. Posts a summary directly to Slack, PagerDuty, or Telegram — no context switching needed

For the current code-level agent architecture after removing the old graph and chain framework layers, see AGENTS.md.


Integrations

OpenSRE connects to 60+ tools and services across the modern cloud stack, from LLM providers and observability platforms to infrastructure, databases, and incident management.

Category Integrations Roadmap
AI / LLM Providers Anthropic · OpenAI · OpenAI Codex · Ollama · Google Gemini · OpenRouter · TrustedRouter · NVIDIA NIM · Bedrock
Observability Grafana (Loki · Mimir · Tempo · annotations) · Datadog · Honeycomb · Coralogix · groundcover · CloudWatch · Sentry · Elasticsearch · Better Stack · Splunk · Victoria Logs · SignOz · OpenObserve · OpenSearch · Azure Monitor · New Relic
Infrastructure Kubernetes · AWS (S3 · Lambda · EKS · EC2 · CloudTrail · Bedrock) · Azure · ArgoCD · Helm
Database MongoDB · ClickHouse · PostgreSQL · MySQL · MariaDB · MongoDB Atlas · Azure SQL · Snowflake · Redis · RDS · Supabase · Neon
Data Platform Apache Airflow · Apache Kafka · Prefect · RabbitMQ · Dagster · Temporal
Dev Tools GitHub · GitHub MCP · Bitbucket · GitLab · Jenkins
Incident Management PagerDuty · Jira · Alertmanager · incident.io · ServiceNow · Trello (client helpers only) Linear
Communication Slack · Google Docs · Discord · Telegram · Rocket.Chat · WhatsApp · Buzz Notion · Teams · Confluence
Agent Deployment Vercel · EC2 · ECS · Railway
Protocols MCP

OpenSRE is community-built. Looking for a safe first contribution? Browse good first issue tickets or see the Good First Issues guide. See CONTRIBUTING.md for the full workflow.

Local environment: SETUP.md (all platforms, Windows, MCP).

Developing in this repo: docs/DEVELOPMENT.md (install from source, CI parity checks, dev container, deployment detail, telemetry reference).

Join our Discord

Star History Chart

Thanks goes to these amazing people:

Contributors

Security

OpenSRE is designed with production environments in mind: structured and auditable LLM prompts, local transcript handling by default, and no silent bulk export of raw logs. See SECURITY.md for responsible disclosure.


Telemetry

First-party product analytics and Sentry (errors) are opt-out. Quick disable:

export OPENSRE_NO_TELEMETRY=1

Full matrix, DSN override, and local event logging → docs/DEVELOPMENT.md


License

Apache 2.0 — see LICENSE.

Citations

1 https://arxiv.org/abs/2310.06770

opensre (Tracer-Cloud/opensre)

正在搜索数据库…

这是做什么的?一个开源框架,用于构建 AI SRE 智能体,在你自己的基础设施上处理生产环境事故——同时也是一个为这些智能体提供训练和评估的环境。
那它是一个托管在云上的面板,还是需要我自己安装运行的东西?你安装的是一个本地的 'opensre' 命令行工具,它提供交互式 shell、供脚本和 CI 使用的无界面模式,以及一个 Python API——它直接对接你自己的云环境,并附带 EC2、Railway、ECS 或 Vercel 的部署方案。
怎么安装和登录?先运行根目录的安装脚本——它会自动识别 Unix shell 还是 PowerShell(macOS 上也可以用 Homebrew 安装)——然后注册或登录 OpenSRE 账号;只有账号处于有效状态时,交互式 shell 才会打开。
运行它需要我自己准备 LLM 的 API 密钥吗?你需要一个 OpenSRE 账号,安装过程中会激活一个托管模型。你也可以自带模型:支持 Anthropic、OpenAI、Ollama、Gemini、OpenRouter、NVIDIA NIM、Bedrock 等。
它现在稳定吗?目前是公开测试版(alpha):核心流程可以用来初步探索,但还不完全稳定,API 和集成在后续开发中仍可能变动。
能在 Windows 上运行吗,还是只支持 macOS 和 Linux?macOS 和 Linux 是一等公民——安装器不需要 sudo,会回退到 ~/.local/bin——Windows 也有 PowerShell 安装器支持。交互式 shell 需要有 TTY(终端)。
我的生产数据很敏感——到底哪些内容会被发给 LLM?它运行在你自己的基础设施上,在调用外部 LLM 之前,可以对 pod、集群、账号 ID 这类敏感标识做脱敏处理,之后再在输出结果中还原。
当告警触发或者我向它提问时,OpenSRE 实际会做什么?它会抓取并关联日志、指标、链路追踪和最近的部署记录,在一个工具调用循环中对你的各个接入系统进行推理,最后给出附带证据链接的结论。它会建议下一步操作,可以执行修复动作,并把摘要发送到 Slack、PagerDuty 或 Telegram。
它能连接哪些工具和服务?有 60 多个集成:可观测性方面有 Grafana、Datadog、Honeycomb 和 Sentry;基础设施方面有 Kubernetes、AWS、GCP 和 Azure;数据库方面有 PostgreSQL、MongoDB 和 ClickHouse;另外还支持 PagerDuty、Jira、GitHub,以及 MCP 和 ACP 协议。
能不能不用交互式 shell,而是在脚本或 CI 里运行它?可以——无界面的 CLI 能在终端、脚本或 CI 任务中以非交互方式运行一轮智能体处理,支持标准输入提示、JSON 输出和工具审批。还有 Python API,可以在你自己的代码中以进程内方式驱动这个智能体(需要源码检出)。
我想给团队部署,该怎么做?两条 AWS EC2 路径——把网关打包进带 systemd 的 AMI 镜像(仅限 Telegram 网关,不用 Docker)——或者通过仓库里的 Dockerfile 部署到 Railway、ECS 或 Vercel 这类通用托管平台。设置 LLMPROVIDER 及其 API 密钥,如果需要持久化存储,还要设置 DATABASEURI 和 REDISURI。
有哪些类似的项目?evenfire, kwatch, openobserve, ruflo, keep, LangBot, hive, agentscope
大小
195 MB
星标
17.6K
时长
10个月
提交 · 90 天