Skip to content

Process all documents from stdin, not just the first - #49

Open
MPV wants to merge 1 commit into
masterfrom
claude/stdin-multidoc
Open

Process all documents from stdin, not just the first#49
MPV wants to merge 1 commit into
masterfrom
claude/stdin-multidoc

Conversation

@MPV

@MPV MPV commented Jul 23, 2026

Copy link
Copy Markdown
Owner

What

Route the stdin path through the same document-splitting logic the file path already uses, so a multi-document stream piped into kir - yields images from every document.

Why

ProcessStdin passed the entire stdin buffer to yamlparser.ProcessData, whose decoder only reads the first YAML document. Any multi-document stream piped in silently dropped every document after the first:

$ printf '...deployment image-one...\n---\n...deployment image-two...\n' | kir -
image-one          # image-two was silently lost

Behavior change

kir - on a multi-document stream now emits images from all documents. The file path is unchanged.

Testing

Added TestProcessDocumentsMultiple, which exercises the shared multi-document path that stdin now uses.

Stack

First of the parsing stack — merge order: this → claude/skip-non-workloadsclaude/robust-yaml-splitting. Base: master.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Pc6NAURAqjU4LYJx93tgSC


Generated by Claude Code

@MPV
MPV changed the base branch from master to claude/approve-stdout-stderr July 23, 2026 07:09
@MPV
MPV force-pushed the claude/stdin-multidoc branch from 7e2273e to 8f215aa Compare July 23, 2026 07:10
@MPV
MPV force-pushed the claude/approve-stdout-stderr branch from 929d8a3 to a0611cd Compare July 23, 2026 08:17
@MPV
MPV force-pushed the claude/stdin-multidoc branch 2 times, most recently from 8696395 to 6e5fb8d Compare July 23, 2026 08:24
Base automatically changed from claude/approve-stdout-stderr to master July 24, 2026 06:40
ProcessStdin passed the entire stdin buffer to yamlparser.ProcessData,
whose decoder only reads the first YAML document. Any multi-document
stream piped in (e.g. `kubectl get ... -o yaml | kir -`) silently
dropped every document after the first.

Route stdin through the same document-splitting path already used for
files so both handle multi-document input identically.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pc6NAURAqjU4LYJx93tgSC
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.

2 participants