Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

425 B
Raw Blame
import { Effect, Option } from 'effect';
import { Stdin } from 'src/services/stdin';

export const readStdin = Effect.gen(function* () {
  const stdin = yield* Stdin;
  return yield* stdin.readAll();
});

export const readStdinIfPiped = Effect.gen(function* () {
  const stdin = yield* Stdin;
  if (stdin.isTTY()) {
    return Option.none<string>();
  }
  const data = yield* stdin.readAll();
  return Option.some(data);
});