DEV Community

SybilGambleyyu
SybilGambleyyu

Posted on • Originally published at sybilgambleyyu.github.io

logsnip: cut CI noise, keep the stack traces

Cut the noise. Keep the stack traces.

CI logs are mostly package installs. The failure is a few dozen lines buried under thousands of Downloading… lines. Scrolling for the real stack trace is a tax paid on every red build.

logsnip is a zero-dependency Python CLI that extracts those failure regions and collapses the rest.

Install

pip install git+https://github.com/SybilGambleyyu/logsnip.git
# or the whole toolkit:
curl -fsSL https://raw.githubusercontent.com/SybilGambleyyu/devkit/main/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

One-liners

# Last failure from a GitHub Actions run
gh run view --log-failed | logsnip --last

# Headlines only
logsnip ci-full.log --summary

# Safe to paste into an AI assistant
gh run view --log-failed | logsnip --last | redactx
Enter fullscreen mode Exit fullscreen mode

What it matches

Built-in patterns cover pytest E lines and AssertionError, npm ERR!, rustc error[E…], TypeScript error TS…, GitHub Actions ##[error], make failures, and common exit-code messages. Stack frames after a hit are pulled in automatically.

Design

  • No network, no config files, no dependencies — pipe-friendly
  • --check exits 1 when error-like lines appear (CI gate)
  • --json for machines; --summary for humans in a hurry
  • Pairs with redactx before anything leaves your machine

Source: github.com/SybilGambleyyu/logsnip · MIT

Top comments (0)