Docs: no-session flag for running commands (#2650)

This commit is contained in:
Emma Youndtsmith
2025-05-23 13:04:16 -05:00
committed by GitHub
parent d8d78396e0
commit aada3651b3
2 changed files with 12 additions and 1 deletions

View File

@@ -260,7 +260,8 @@ Execute commands from an instruction file or stdin. Check out the [full guide](/
- **`--with-extension <COMMAND>`**: Add stdio extensions (can be used multiple times in the same command)
- **`--with-builtin <n>`**: Add builtin extensions by name (e.g., 'developer' or multiple: 'developer,github')
- **`--debug`**: Output complete tool responses, detailed parameter values, and full file paths
- **`--explain`**: Show a recipe's title, description, and parameters.
- **`--explain`**: Show a recipe's title, description, and parameters
- **`--no-session`**: Run goose commands without creating or storing a session file
**Usage:**
@@ -284,6 +285,9 @@ goose run --recipe recipe.yaml --debug
#Show recipe details
goose run --recipe recipe.yaml --explain
#Run instructions from a file without session storage
goose run --no-session -i instructions.txt
```
---

View File

@@ -91,6 +91,13 @@ goose run -n my-project -t "initial instructions"
goose run -n my-project -r
```
You can also run commands without creating or storing a session file by using the `--no-session` flag. This is useful for automated scripts, or one-off tasks where you don't need to maintain the conversation history or state. This flag routes the session output to a temporary null path (`/dev/null` on Unix or `NUL` on Windows), and discards it when complete.
```bash
# Run a command without creating a session file
goose run --no-session -t "your command here"
```
### Working with Extensions
If you want to ensure specific extensions are available when running your task, you can indicate this with arguments. This can be done using the `--with-extension`, `--with-remote-extension`, or `--with-builtin` flags: