Tools: Build an AI Incident Copilot CLI in Python - Guide

Tools: Build an AI Incident Copilot CLI in Python - Guide

Project files

Quick demo (no real services)

Systemd triage

Docker triage

Both (bundle)

Outputs When an incident fires, you don't need more dashboards.

You need answers, fast. This post is a build-a-tool weekend project: a Python CLI that collects logs from systemd and Docker, highlights repeating patterns, maps them to the Golden Signals, and generates a ready-to-use incident report. 💬 What's your go-to first command when an incident fires?

Drop it in the comments — I'll add the best ones to the safe-commands list. Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Code Block

Copy

incopilot/ cli.py collectors.py analyzer.py reporter.py config.py scripts/ demo_generate_sample_logs.py requirements.txt pyproject.toml README.md incopilot/ cli.py collectors.py analyzer.py reporter.py config.py scripts/ demo_generate_sample_logs.py requirements.txt pyproject.toml README.md incopilot/ cli.py collectors.py analyzer.py reporter.py config.py scripts/ demo_generate_sample_logs.py requirements.txt pyproject.toml README.md python -m venv .venv && source .venv/bin/activate pip install -r requirements.txt python -m venv .venv && source .venv/bin/activate pip install -r requirements.txt python -m venv .venv && source .venv/bin/activate pip install -r requirements.txt python scripts/demo_generate_sample_logs.py python -m incopilot file --path sample.log python scripts/demo_generate_sample_logs.py python -m incopilot file --path sample.log python scripts/demo_generate_sample_logs.py python -m incopilot file --path sample.log python -m incopilot journal --unit nginx --since "30 min ago" python -m incopilot journal --unit nginx --since "30 min ago" python -m incopilot journal --unit nginx --since "30 min ago" python -m incopilot docker --container my-api --since 1h python -m incopilot docker --container my-api --since 1h python -m incopilot docker --container my-api --since 1h python -m incopilot bundle --unit nginx --container my-api --since-journal "30 min ago" --since-docker 1h python -m incopilot bundle --unit nginx --container my-api --since-journal "30 min ago" --since-docker 1h python -m incopilot bundle --unit nginx --container my-api --since-journal "30 min ago" --since-docker 1h - out/report.md — human-friendly - out/report.json — machine-friendly