Skip to content

llm cmdcomp should be able to return its shell integration codes #4

@KingMob

Description

@KingMob

Problem

It's not immediately obvious where the llm-cmd-comp.{bash,zsh,fish} files are after installing the plugin. We can dig for them, but given the variety of ways llm can be installed, this may be tricky.

Alternatively, we can copy and paste the file contents from the repo, but that runs into the issue of never being updated if the plugin changes.

Proposed solution

llm cmdcomp should be able to output the necessary shell integration codes.

Many programs that integrate with shells do this already. E.g. from my .zshrc and .bashrc files:

source <(COMPLETE=zsh jj)
eval "$(uv generate-shell-completion zsh)"
eval "$(mise activate bash)"
eval "$(direnv hook bash)"
eval "$(starship init bash)"
eval "$(zoxide init bash)"

It could be similar to those, e.g., llm cmdcomp --init zsh or llm cmdcomp --hook bash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions