Skip to content

Comments

feat: add shell-completions subcommand#76

Merged
lifeizhou-ap merged 4 commits intoblock:mainfrom
lamchau:lam/autocomplete-session
Sep 25, 2024
Merged

feat: add shell-completions subcommand#76
lifeizhou-ap merged 4 commits intoblock:mainfrom
lamchau:lam/autocomplete-session

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
@lamchau lamchau force-pushed the lam/autocomplete-session branch 4 times, most recently from 229ffbf to 131e010 Compare September 20, 2024 21:28
@lamchau lamchau force-pushed the lam/autocomplete-session branch from 131e010 to 1fdd189 Compare September 20, 2024 21:30
Copy link
Collaborator

@baxen baxen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lifeizhou-ap lifeizhou-ap merged commit 5c52138 into block:main Sep 25, 2024
lifeizhou-ap added a commit that referenced this pull request Sep 25, 2024
* main:
  feat: add shell-completions subcommand (#76)
  chore: update readme! (#96)
  chore: update docs again (#77)
  fix: remove overly general match for long running commands (#87)
@lamchau lamchau deleted the lam/autocomplete-session branch September 26, 2024 00:12
lily-de pushed a commit that referenced this pull request Oct 7, 2024
ahau-square pushed a commit that referenced this pull request May 2, 2025
cbruyndoncx pushed a commit to cbruyndoncx/goose that referenced this pull request Jul 20, 2025
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.

5 participants