CLI Mock Stdin

SkillDev tools

Create mock stdin utilities for interactive CLI testing.

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Then ask your AI: use the CLI Mock Stdin skill

What this skill tells your AI

The instructions your AI receives, as published by a5c-ai/babysitter in library/specializations/cli-mcp-development/skills/cli-mock-stdin/SKILL.md and read by ahel’s review.

Create mock stdin utilities for testing.

Generated Patterns

import { Readable } from 'stream';

export function mockStdin(inputs: string[]): Readable {
  let index = 0;
  return new Readable({
    read() {
      if (index < inputs.length) {
        setTimeout(() => {
          this.push(inputs[index++] + '\n');
        }, 10);
      } else {
        this.push(null);
      }
    },
  });
}

export async function runWithStdin(
  cmd: () => Promise<void>,
  inputs: string[]
): Promise<void> {
  const originalStdin = process.stdin;
  Object.defineProperty(process, 'stdin', { value: mockStdin(inputs) });
  try {
    await cmd();
  } finally {
    Object.defineProperty(process, 'stdin', { value: originalStdin });
  }
}

Target Processes

  • cli-unit-integration-testing
  • interactive-prompt-system

Signals

GitHub stars
2k
Forks
112
Last commit
Sep 2026
Advanced
Item type
skill
Key
cli-mock-stdin
Source
github.com/a5c-ai/babysitter