---
title: Unix Pipes
description: Use devv with stdin/stdout for seamless shell integration.
---

# Unix Pipes

devv reads from stdin and writes to stdout, making it a natural fit in Unix pipelines.

## Reading from stdin

When data is piped in, devv uses it as the input:

```bash
cat package.json | devv json format
echo "hello" | devv base64 encode
curl -s https://api.example.com | devv json format --sort-keys
```

## Writing to stdout

All output goes to stdout, so you can chain with other tools:

```bash
devv uuid | pbcopy                           # Copy UUID to clipboard
devv json format data.json | less            # Page through formatted JSON
devv password -l 32 | tee password.txt       # Save and display
cat file.txt | devv hash - sha256 > hash.txt # Save hash to file
```

## Chaining devv commands

Pipe devv's output into another devv command:

```bash
echo '{"key":"value"}' | devv json format | devv base64 encode
devv uuid | devv hash - sha256
devv mock --count 3 | devv json minify
```

## Real-world examples

### Format clipboard JSON (macOS)

```bash
pbpaste | devv json format | pbcopy
```

### Hash a file

```bash
cat secret.txt | devv hash - sha256
```

### API response formatting

```bash
curl -s https://api.github.com/users/octocat | devv json format --sort-keys
```

### Generate seed data

```bash
devv mock --count 100 > seed-data.json
```

### Decode a JWT from env

```bash
echo "$JWT_TOKEN" | devv jwt decode
```

### CSV to formatted JSON

```bash
cat export.csv | devv pipe exec "csv-json-converter | json-formatter"
```

<Note>
When stdin is detected, devv skips the REPL and processes the piped data directly. Use `devv` with no pipe and no arguments to enter interactive mode.
</Note>
