> ## Documentation Index
> Fetch the complete documentation index at: https://docs.proofpod.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Standard input

> Forwarding standard input to a cloud command, and why it is opt-in.

By default `pp` does not read standard input at all, and the cloud command sees
an empty one. To send input to a command, ask for it with `--stdin`, the way
you would with `docker run -i`.

## Forwarding standard input

```console theme={null}
$ cat input.txt | pp --stdin lake exe mytool      # -i for short
$ pp --stdin lean --run Main.lean < input.txt
```

The one exception is `lean --stdin`, where the command line itself says the
input is on stdin. It is forwarded without the flag:

```console theme={null}
$ echo 'example : 1 + 1 = 2 := rfl' | pp lean --stdin
```

## Limits

* `pp` reads standard input to the end before the command starts, so input is
  not interactive.
* Up to 64 MiB is accepted.

## Why forwarding is opt-in

A cloud command cannot simply inherit your stdin the way a local process does.
`pp` would have to read it on the command's behalf, and doing that uninvited
breaks two ordinary situations:

* **Scripts and tools that leave stdin open.** CI runners, agent harnesses and
  `subprocess.Popen(stdin=PIPE)` hand a command a pipe that never closes.
  Waiting for it would hang forever, for a command (`lake env lean File.lean`)
  that never wanted input.
* **Loops.** In `while read f; do pp lake env lean "$f"; done < files.txt`,
  reading stdin would swallow the rest of `files.txt` and end the loop after one
  iteration. This is the classic `ssh` pitfall.

Because `pp` never reads stdin unless asked, it is safe to call from both. See
[Scripts and agents](https://docs.proofpod.dev/guide/scripting.md) for patterns that rely on this.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.