Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add shell-completions subcommand #76

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

lamchau
Copy link
Contributor

@lamchau lamchau commented Sep 18, 2024

extracted from an experimental 'daemon/lsp mode' branch which may overhaul how session management is handled. at the very least, landing this would be a good starting point to enable discoverability of commands and adoption.

  • shell-completions --install support for bash, fish, or zsh (appends to standard config files)
  • shell-completions --generate support for bash, fish, or zsh (custom location with install text)
  • support for goose session resume <session_name>

this can only be tested via an entrypoint (i.e. installed not via uv)

pipx install . --preinstall goose-plugins-block --force

Usage

This will install to the set user-defined $SHELL

goose shell-completions --install
Usage: goose shell-completions [OPTIONS] [[bash|zsh|fish]]

  Manage shell completions for goose

Options:
  --install   Install shell completions
  --generate  Generate shell completions
  --help      Show this message and exit.

Note: For bash and zsh, the user will need to source {rc_file} before it can take effect.

Alternatively, you can generate the completions and manually install run them yourself

goose shell-completions --generate bash > path/to/custom-bash
goose shell-completions --generate fish > path/to/completion.fish
goose shell-completions --generate zsh > path/to/custom-zsh

Example installations with autocompletion per $SHELL

image

Guard for exclusive options --generate or --install only

image

Autocomplete for session (via fish; goose session resume a<tab>)

image

@lamchau lamchau force-pushed the lam/autocomplete-session branch 4 times, most recently from 811ed30 to bfd19f3 Compare September 18, 2024 17:57
@lamchau lamchau changed the title feat: add 'install-shell-completions' subcommand feat: add 'shell-completions' subcommand Sep 18, 2024
@lamchau lamchau changed the title feat: add 'shell-completions' subcommand feat: add shell-completions subcommand Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants