Files
tkmind_go/documentation/docs/guides/goose-cli-commands.md
T

255 lines
5.4 KiB
Markdown
Raw Normal View History

2025-01-24 13:04:43 -08:00
---
2025-02-20 11:03:56 +01:00
sidebar_position: 4
2025-01-24 13:04:43 -08:00
---
# CLI Commands
Goose provides a command-line interface (CLI) with several commands for managing sessions, configurations and extensions. Below is a list of the available commands and their descriptions:
## Commands
### help
Used to display the help menu
**Usage:**
```bash
goose --help
```
2025-02-24 08:03:37 -06:00
---
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
### configure [options]
Configure Goose settings - providers, extensions, etc.
2025-01-24 13:04:43 -08:00
**Usage:**
```bash
2025-02-24 08:03:37 -06:00
goose configure
2025-01-24 13:04:43 -08:00
```
2025-02-24 08:03:37 -06:00
---
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
### session [options]
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
- Start a session and give it a name
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
**Options:**
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
**`-n, --name <name>`**
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
**Usage:**
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
```bash
goose session --name <name>
```
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
- Resume a previous session
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
**Options:**
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
**`-r, --resume`**
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
**Usage:**
```bash
goose session --resume --name <name>
```
- Start a session with the specified extension
**Options:**
**`--with-extension <command>`**
**Usage:**
```bash
goose session --with-extension <command>
```
2025-03-20 22:57:11 -05:00
**Examples:**
```bash
goose session --with-extension "npx -y @modelcontextprotocol/server-memory"
```
With environment variable:
```bash
goose session --with-extension "GITHUB_PERSONAL_ACCESS_TOKEN=<YOUR_TOKEN> npx -y @modelcontextprotocol/server-github"
```
2025-02-24 08:03:37 -06:00
- Start a session with the specified [built-in extension](/docs/getting-started/using-extensions#built-in-extensions) enabled (e.g. 'developer')
**Options:**
**`--with-builtin <id>`**
**Usage:**
```bash
goose session --with-builtin <id>
```
2025-03-20 22:57:11 -05:00
**Example:**
```bash
goose session --with-builtin computercontroller
```
2025-02-24 08:03:37 -06:00
---
### session list [options]
List all saved sessions.
- **`-v, --verbose`**: (Optional) Includes session file paths in the output.
- **`-f, --format <format>`**: Specify output format (`text` or `json`). Default is `text`.
**Usage:**
```bash
# List all sessions in text format (default)
goose session list
```
```bash
# List sessions with file paths
goose session list --verbose
```
```bash
# List sessions in JSON format
goose session list --format json
```
---
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
### info [options]
2025-01-24 13:04:43 -08:00
2025-03-04 15:44:24 -05:00
Shows Goose information, including the version, configuration file location, session storage, and logs.
- **`-v, --verbose`**: (Optional) Show detailed configuration settings, including environment variables and enabled extensions.
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
**Usage:**
2025-01-24 13:04:43 -08:00
```bash
2025-02-24 08:03:37 -06:00
goose info
2025-01-24 13:04:43 -08:00
```
2025-02-24 08:03:37 -06:00
---
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
### version
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
Used to check the current Goose version you have installed
**Usage:**
2025-01-24 13:04:43 -08:00
```bash
2025-02-24 08:03:37 -06:00
goose --version
2025-01-24 13:04:43 -08:00
```
2025-02-24 08:03:37 -06:00
---
2025-01-24 13:04:43 -08:00
### update [options]
Update the Goose CLI to a newer version.
**Options:**
- **`--canary, -c`**: Update to the canary (development) version instead of the stable version
- **`--reconfigure, -r`**: Forces Goose to reset configuration settings during the update process
**Usage:**
```bash
# Update to latest stable version
goose update
# Update to latest canary version
goose update --canary
# Update and reconfigure settings
goose update --reconfigure
```
---
2025-02-24 08:03:37 -06:00
### mcp
Run an enabled MCP server specified by `<name>` (e.g. 'Google Drive')
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
**Usage:**
2025-01-24 13:04:43 -08:00
```bash
2025-02-24 08:03:37 -06:00
goose mcp <name>
2025-01-24 13:04:43 -08:00
```
2025-02-24 08:03:37 -06:00
---
2025-01-24 13:04:43 -08:00
### run [options]
2025-03-13 12:46:04 +01:00
Execute commands from an instruction file or stdin. Check out the [full guide](/docs/guides/running-tasks) for more info.
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
**Options:**
2025-03-19 19:03:11 +01:00
- **`-i, --instructions <FILE>`**: Path to instruction file containing commands. Use - for stdin.
- **`-t, --text <TEXT>`**: Input text to provide to Goose directly
2025-03-13 12:46:04 +01:00
- **`-s, --interactive`**: Continue in interactive mode after processing initial input
- **`-n, --name <NAME>`**: Name for this run session (e.g. 'daily-tasks')
- **`-r, --resume`**: Resume from a previous run
2025-03-13 12:46:04 +01:00
- **`-p, --path <PATH>`**: Path for this run session (e.g. './playground.jsonl')
- **`--with-extension <COMMAND>`**: Add stdio extensions (can be used multiple times in the same command)
- **`--with-builtin <NAME>`**: Add builtin extensions by name (e.g., 'developer' or multiple: 'developer,github')
2025-01-24 13:04:43 -08:00
**Usage:**
2025-02-24 08:03:37 -06:00
2025-01-24 13:04:43 -08:00
```bash
goose run --instructions plan.md
```
2025-02-24 08:03:37 -06:00
---
2025-01-24 13:04:43 -08:00
2025-02-24 08:03:37 -06:00
### agents
2025-02-24 08:03:37 -06:00
Used to show the available implementations of the agent loop itself
2025-01-24 13:04:43 -08:00
**Usage:**
2025-02-24 08:03:37 -06:00
2025-01-24 13:04:43 -08:00
```bash
2025-02-24 08:03:37 -06:00
goose agents
2025-03-04 15:44:24 -05:00
```
2025-03-20 12:59:02 +01:00
---
## Prompt Completion
The CLI provides a set of slash commands that can be accessed during a session. These commands support tab completion for easier use.
#### Available Commands
- `/exit` or `/quit` - Exit the current session
- `/t` - Toggle between Light/Dark/Ansi themes
- `/extension <command>` - Add a stdio extension (format: ENV1=val1 command args...)
- `/builtin <names>` - Add builtin extensions by name (comma-separated)
- `/prompts [--extension <name>]` - List all available prompts, optionally filtered by extension
- `/prompt <n> [--info] [key=value...]` - Get prompt info or execute a prompt
- `/mode <name>` - Set the goose mode to use ('auto', 'approve', 'chat')
- `/plan <message>` - Create a structured plan based on the given message
2025-03-20 12:59:02 +01:00
- `/?` or `/help` - Display this help message
All commands support tab completion. Press `<Tab>` after a slash (/) to cycle through available commands or to complete partial commands.
#### Examples
```bash
# Create a plan for triaging test failures
/plan let's create a plan for triaging test failures
2025-03-20 12:59:02 +01:00
# List all prompts from the developer extension
/prompts --extension developer
# Switch to chat mode
/mode chat
```
2025-03-04 15:44:24 -05:00
---
## Keyboard Shortcuts
Goose CLI supports several shortcuts and built-in commands for easier navigation.
- **`Ctrl+C`** - Interrupt the current request
- **`Ctrl+J`** - Add a newline
- **Up/Down arrows** - Navigate through command history