agentsclimarketplace

Cli mock stdin

Skill a5c-ai/babysitter/library/specializations/cli-mcp-development/skills/cli-mock-stdin

Create mock stdin utilities for interactive CLI testing.From its SKILL.md

Install
npx -y skills add a5c-ai/babysitter --skill cli-mock-stdin

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

1.3 KB, 204 tokens by cl100k_base, as published. Nobody here has run it

CLI Mock Stdin

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

What ships with it: 1 file

155 B alongside SKILL.md

Keep looking

Skills are one crate of 326,059. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.