docs: add stdin (#1769)

This commit is contained in:
Adewale Abati
2025-03-19 19:03:11 +01:00
committed by GitHub
parent 35cbddbf8d
commit d14e5f4de7
3 changed files with 20 additions and 1 deletions

View File

@@ -171,7 +171,7 @@ Execute commands from an instruction file or stdin. Check out the [full guide](/
**Options:**
- **`-i, --instructions <FILE>`**: Path to instruction file containing commands
- **`-i, --instructions <FILE>`**: Path to instruction file containing commands. Use - for stdin.
- **`-t, --text <TEXT>`**: Input text to provide to Goose directly
- **`-s, --interactive`**: Continue in interactive mode after processing initial input
- **`-n, --name <NAME>`**: Name for this run session (e.g. 'daily-tasks')

View File

@@ -48,6 +48,24 @@ Here's an example of an instruction file that runs a security audit on project d
Save findings in 'security_audit.md' with severity levels highlighted.
```
### With stdin
You can also pass instructions to Goose using standard input via `-i -`. This is useful when you want to pipe commands from another tool or script into Goose.
#### Simple echo pipe
```bash
echo "What is 2+2?" | goose run -i -
```
#### Multi-line instructions
```bash
cat << EOF | goose run -i -
Please help me with these tasks:
1. Calculate 15% of 85
2. Convert 32°C to Fahrenheit
EOF
```
## Key Features
### Interactive Mode