{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "ther1d-shell-gpt--analyze-logs-and-diffs-from-stdin",
 "repo": "TheR1D/shell_gpt",
 "repo_url": "https://github.com/TheR1D/shell_gpt",
 "repo_slug": "ther1d-shell-gpt",
 "title": "Pipe logs and diffs into an LLM for quick answers",
 "page_title": "How to pipe logs and diffs into an LLM for quick answers with Shell GPT",
 "summary": "Send docker logs or a git diff to sgpt with a prompt to find errors or write a commit message.",
 "who": "A developer debugging a failing container or writing commit messages at the end of a long day.",
 "problem": "Reading long logs for the one real error, or summarizing a diff, takes time you would rather spend fixing.",
 "outcome": "A short list of detected errors with suggested fixes, or a ready-to-edit commit message.",
 "steps": [
  "Install with `pip install shell-gpt`",
  "Analyze logs: `docker logs -n 20 my_app | sgpt \"check logs, find errors, provide possible solutions\"`",
  "Write a commit message: `git diff | sgpt \"Generate git commit message, for my changes\"`",
  "Use any redirection operator to pass a file in with a prompt such as summarise",
  "Review the output before acting on it"
 ],
 "agent_prompt": "Using TheR1D/shell_gpt, pipe the last 50 lines of <service> logs into sgpt and ask it to find errors and suggest fixes. Then pipe my staged git diff into sgpt for a commit message and show me both before doing anything.",
 "agents": [
  "any"
 ],
 "difficulty": "Beginner",
 "time": "10 minutes",
 "basis": "readme",
 "caveat": "ShellGPT is not optimized for local models, so results with Ollama may be weaker than with OpenAI.",
 "category": "Personal productivity",
 "tags": [
  "Personal productivity"
 ],
 "lang": "python",
 "requirements": [
  "Python and pip",
  "An OpenAI API key, stored in ~/.config/shell_gpt/.sgptrc on first run, or a local backend such as Ollama",
  "Linux, macOS or Windows with Bash, Zsh, PowerShell or CMD"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "Anything you pipe in is sent to the model provider, so do not pipe logs or diffs that contain secrets or customer data."
  }
 ],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/ther1d-shell-gpt/analyze-logs-and-diffs-from-stdin/",
 "md": "https://dedupedai.com/use-cases/ther1d-shell-gpt/analyze-logs-and-diffs-from-stdin/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/ther1d-shell-gpt--analyze-logs-and-diffs-from-stdin.json",
 "api_version": "v1"
}
