Stdin/pipe input support
Why it matters
Unix philosophy is composition, and composition requires stdin. When mytool validate only accepts --file path.json and refuses piped input, users cannot run curl api.example.com/data | mytool validate or chain your tool into generators. Tools that cannot participate in pipelines get replaced by tools that can. Worse, stdin reading without TTY detection causes interactive invocations to hang forever — the user sees a frozen terminal and assumes the tool crashed.
Severity rationale
Medium because missing stdin support blocks pipeline composition without causing data loss or crashes.
Remediation
Accept - as a filename meaning stdin, or auto-detect !process.stdin.isTTY and read from the pipe. Implement once in src/cli/lib/input.ts:
async function getInput(filePath?: string) {
if (filePath && filePath !== '-') return readFileSync(filePath, 'utf8')
const chunks: Buffer[] = []
for await (const chunk of process.stdin) chunks.push(chunk)
return Buffer.concat(chunks).toString('utf8')
}
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the CLI Quality Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from cli-quality·automated