Skip to content

Comments

feat: add stdin/pipe reader for command composability#11

Merged
clarabennettdev merged 1 commit intomainfrom
feature/stdin-pipe-reader
Feb 19, 2026
Merged

feat: add stdin/pipe reader for command composability#11
clarabennettdev merged 1 commit intomainfrom
feature/stdin-pipe-reader

Conversation

@clarabennettdev
Copy link
Owner

Implements #9 — stdin/pipe reader for command composability.

Changes

  • Detect piped stdin and run in streaming mode (no TUI)
  • Auto-detect log format per line (JSON, logfmt, plain)
  • Render styled output to stdout
  • Graceful signal handling (SIGINT/SIGTERM)
  • Fix .gitignore to not exclude cmd/logpilot/ directory
  • Add integration tests for pipe mode

Usage

cat app.log | logpilot
kubectl logs -f pod | logpilot
docker logs -f container | logpilot

Closes #9

Integrate StdinSource into the main command so users can pipe logs:

  cat app.log | logpilot
  kubectl logs -f pod | logpilot
  docker logs -f container | logpilot

When stdin is a pipe, logpilot runs in streaming mode (no TUI),
auto-detecting log format (JSON, logfmt, plain) per line and
rendering styled output to stdout.

Features:
- Automatic pipe detection via IsPipe()
- Auto-format detection per line (mixed formats supported)
- Graceful signal handling (SIGINT/SIGTERM)
- Long line support (up to 1MB)
- Configurable backpressure (block or drop-oldest)

Closes #9
@clarabennettdev clarabennettdev merged commit fde6114 into main Feb 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdin/pipe reader for command composability

1 participant