DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to pipe logs and diffs into an LLM for quick answers with Shell GPT

Send docker logs or a git diff to sgpt with a prompt to find errors or write a commit message.

Short answer: Install with pip install shell-gpt; then 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". All steps.

Credentials. Anything you pipe in is sent to the model provider, so do not pipe logs or diffs that contain secrets or customer data.

Who it is forA developer debugging a failing container or writing commit messages at the end of a long day.

The problemReading long logs for the one real error, or summarizing a diff, takes time you would rather spend fixing.

The outcomeA short list of detected errors with suggested fixes, or a ready-to-edit commit message.

What you need first

  • 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

Steps

  1. Install with pip install shell-gpt
  2. Analyze logs: docker logs -n 20 my_app | sgpt "check logs, find errors, provide possible solutions"
  3. Write a commit message: git diff | sgpt "Generate git commit message, for my changes"
  4. Use any redirection operator to pass a file in with a prompt such as summarise
  5. Review the output before acting on it

Prompt for your agent

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.

Caveat. ShellGPT is not optimized for local models, so results with Ollama may be weaker than with OpenAI.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for TheR1D/shell_gpt and "Pipe logs and diffs into an LLM for quick answers"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer