{"id":20390446,"url":"https://github.com/checkly/srebot","last_synced_at":"2025-09-24T00:32:10.669Z","repository":{"id":261773146,"uuid":"885300067","full_name":"checkly/srebot","owner":"checkly","description":"SREBot","archived":false,"fork":false,"pushed_at":"2025-01-14T16:10:20.000Z","size":27982,"stargazers_count":8,"open_issues_count":2,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-14T17:06:10.911Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/checkly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-08T10:20:11.000Z","updated_at":"2025-01-13T10:24:10.000Z","dependencies_parsed_at":"2024-12-06T15:24:24.382Z","dependency_job_id":"4557d6ee-348a-499f-a106-1ae05df8f801","html_url":"https://github.com/checkly/srebot","commit_stats":null,"previous_names":["checkly/srebot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkly%2Fsrebot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkly%2Fsrebot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkly%2Fsrebot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkly%2Fsrebot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/checkly","download_url":"https://codeload.github.com/checkly/srebot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234017709,"owners_count":18766566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T03:24:56.979Z","updated_at":"2025-09-24T00:32:10.657Z","avatar_url":"https://github.com/checkly.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SREBot\n\nA Site Reliability Engineering (SRE) bot that integrates with Slack, GitHub, and Checkly to help manage incidents and improve Mean Time To Resolution (MTTR).\n\n## Features\n\n- Real-time incident management through Slack\n- Integration with Checkly for monitoring alerts\n- GitHub integration for tracking releases and changes\n- AI-powered assistance using OpenAI\n- Automatic context aggregation for incidents\n\n## Prerequisites\n\n- Node.js v22.11.0\n- Docker and Docker Compose\n- PostgreSQL (via Docker or local installation)\n- Accounts and API keys for:\n  - OpenAI\n  - Slack\n  - GitHub\n  - Checkly\n\n## Setup\n\n### 1. Environment Variables\n\nDuplicate the `env.example` file in the root directory and add your keys as per requirements\n\n### 2. Database Setup\n\nThe project uses PostgreSQL as its database. To set it up using Docker:\n\n1. Start the PostgreSQL container:\n\n   ```bash\n   docker compose up -d\n   ```\n\n1. Run database migrations:\n\n   ```bash\n   npm run db:migrate\n   ```\n\n1. (Optional) To explore the database using Prisma Studio:\n\n   ```bash\n   npm run db:studio\n   ```\n\nTo reset the database if needed:\n\n```bash\ndocker compose down -v  # Remove containers and volumes\ndocker compose up -d    # Start fresh\nnpm run db:migrate     # Run migrations again\n```\n\n### 3. Installation\n\n1. Install dependencies\n\n```bash\nnpm install\n```\n\n1. Initialize the OpenAI assistant\n\n   - First, get your [OpenAI API key](https://platform.openai.com/api-keys)\n   - Add the API key to your .env file\n   - Create the assistant by running:\n\n   ```bash\n   npx ts-node scripts/init-assistant.ts\n   ```\n\nGo to the [OpenAI Portal](https://platform.openai.com/assistants) to find your assistant ID\n\n## Running the Application\n\nThere are several ways to run the application depending on your needs:\n\n### Development Mode\n\n```bash\nnpm run dev\n```\n\n### Slack Bot Only\n\n```bash\nnpm run bot:start\n```\n\n### Production Mode\n\n```bash\nnpm run build\nnpm start\n```\n\n### Running Tests\n\n```bash\nnpm test\n```\n\n## Project Structure\n\n- `/src/aggregator`: Context aggregation logic for incidents\n- `/src/ai`: AI assistant and tool implementations\n- `/src/checkly`: Checkly API integration\n- `/src/github`: GitHub API integration\n- `/src/routes`: API routes for webhooks\n- `/src/slackbot`: Slack bot implementation\n- `/src/sre-assistant`: Main SRE assistant logic\n- `/prisma`: Database schema and migrations\n\n## Available Commands\n\n- `npm run dev`: Start development server\n- `npm run bot:start`: Start Slack bot only\n- `npm run build`: Build the application\n- `npm start`: Start the built application\n- `npm test`: Run tests\n- `npm run db:migrate`: Run database migrations\n- `npm run db:studio`: Open Prisma Studio\n- `npm run db:deploy`: Deploy database migrations\n- `npm run db:generate`: Generate Prisma client\n\n## External Service Setup\n\n### Slack Setup\n\n1. Create a new Slack app in your [workspace](https://api.slack.com/apps)\n1. Configure Bot Token Scopes:\n   - chat:write\n   - app_mentions:read\n   - commands\n1. Install the app to your workspace\n1. Copy the signing secret, bot token, and app token to your .env file\n\n### GitHub Setup\n\n1. Create a Personal Access Token with repo permissions\n1. Configure webhook in your organization/repository:\n   - Payload URL: your-server/github-webhook\n   - Content type: application/json\n   - Secret: Same as GH_WEBHOOK_SECRET in .env\n   - Events: Release events\n\n### Checkly Setup\n\n1. Get your [API key and Account ID from Checkly](https://app.checklyhq.com/settings/user/api-keys)\n1. Configure webhook in Checkly:\n   - URL: your-server/checkly-webhook\n   - Select relevant alert types\n\n### Architecture\n\n```mermaid\nsequenceDiagram\n    participant CLY as Checkly\n    participant APP as App\n    participant GHB as Github\n    participant NOT as Notion API\n    participant SLCK_API as Slack API\n    participant CLY_API as Checkly Api\n    participant AI as AI Model(OpenAI)\n    participant SLCK as Slack\n    CLY-\u003e\u003eAPP:Alert Webhook\n    critical Aggregate Context\n      APP-\u003e\u003eGHB:Get Releases\n      GHB-\u003e\u003eAI:Identify Relevant Releases\n      GHB-\u003e\u003eAI:Identify Relevant Deployments\n      APP-\u003e\u003eNOT:Get Knowledge Bases\n      APP-\u003e\u003eSLCK_API:Get Channel Summary\n      SLCK_API-\u003e\u003eAI:Summarize Channel\n      APP-\u003e\u003eCLY_API:Get Alert Details\n    end\n\n    APP-\u003e\u003eAI:Ananlyze context, Root Cause and Create Summary\n    AI-\u003e\u003eAPP:Alert Summary\n    APP-\u003e\u003eSLCK:Send Alert Message\n```\n\n## License\n\nISC License - see the LICENSE file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheckly%2Fsrebot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheckly%2Fsrebot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheckly%2Fsrebot/lists"}