Document tab completion (#6635)
This commit is contained in:
@@ -5,6 +5,9 @@ sidebar_label: CLI Commands
|
||||
toc_max_heading_level: 4
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
goose provides a command-line interface (CLI) with several commands for managing sessions, configurations and extensions. This guide covers all available CLI commands and interactive session features.
|
||||
|
||||
## Flag Naming Conventions
|
||||
@@ -88,6 +91,87 @@ goose update --reconfigure
|
||||
|
||||
---
|
||||
|
||||
#### completion
|
||||
Generate shell-specific scripts to enable tab completion of goose commands, subcommands, and options. The script is printed to stdout, so you need to redirect it to the appropriate location for your shell and then reload or source your shell configuration.
|
||||
|
||||
Once installed, you can:
|
||||
- Press Tab to see available commands and subcommands
|
||||
- Complete command names and flags automatically
|
||||
- Discover options without checking `--help`
|
||||
|
||||
**Arguments:**
|
||||
- **`<SHELL>`**: The shell to generate completions for. Supported shells: `bash`, `elvish`, `fish`, `powershell`, `zsh`
|
||||
|
||||
**Usage:**
|
||||
```bash
|
||||
# Generate completion script for your shell (outputs to stdout)
|
||||
goose completion bash
|
||||
goose completion zsh
|
||||
goose completion fish
|
||||
```
|
||||
|
||||
**Installation by Shell:**
|
||||
|
||||
<Tabs groupId="shells">
|
||||
<TabItem value="zsh" label="Zsh" default>
|
||||
|
||||
Add this line to your `~/.zshrc`:
|
||||
|
||||
```bash
|
||||
eval "$(goose completion zsh)"
|
||||
```
|
||||
|
||||
Then reload your shell:
|
||||
```bash
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="bash" label="Bash">
|
||||
|
||||
Add this line to your `~/.bashrc` or `~/.bash_profile`:
|
||||
|
||||
```bash
|
||||
eval "$(goose completion bash)"
|
||||
```
|
||||
|
||||
Then reload your shell:
|
||||
```bash
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="fish" label="Fish">
|
||||
|
||||
```bash
|
||||
goose completion fish > ~/.config/fish/completions/goose.fish
|
||||
```
|
||||
|
||||
Then restart your terminal or run `exec fish`.
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="powershell" label="PowerShell">
|
||||
|
||||
Add this line to your PowerShell profile:
|
||||
|
||||
```powershell
|
||||
goose completion powershell | Out-String | Invoke-Expression
|
||||
```
|
||||
|
||||
Then reload your profile:
|
||||
```powershell
|
||||
. $PROFILE
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
:::tip Testing
|
||||
After installing and reloading your shell, test completion by typing `goose ` and pressing Tab to see available commands, or `goose session --` and Tab to see available options.
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
### Session Management
|
||||
|
||||
:::info Session Storage Migration
|
||||
|
||||
Reference in New Issue
Block a user