Skip to content

feat: Add shell completion support for bash, zsh, and fish#8851

Merged
mudler merged 1 commit intomudler:masterfrom
localai-bot:feat/shell-completion-H3
Mar 8, 2026
Merged

feat: Add shell completion support for bash, zsh, and fish#8851
mudler merged 1 commit intomudler:masterfrom
localai-bot:feat/shell-completion-H3

Conversation

@localai-bot
Copy link
Copy Markdown
Contributor

Shell Completion Support

This PR adds shell completion support for LocalAI CLI using the Kong CLI framework.

Changes

  • Added dynamic completion script generation for bash, zsh, and fish
  • Completion scripts are generated from the Kong CLI model, automatically staying in sync with CLI changes
  • Added documentation for installation instructions

Usage

# Generate and install bash completions
source <(local-ai completion bash)

# Generate and install zsh completions
source <(local-ai completion zsh)

# Generate and install fish completions
local-ai completion fish | source

Testing

  • Unit tests added in core/cli/completion_test.go
  • Completion scripts verified for all three shell types

Resolves: UX Review Issue H3

- Add core/cli/completion.go with dynamic completion script generation
- Add core/cli/completion_test.go with unit tests
- Modify cmd/local-ai/main.go to support completion command
- Modify core/cli/cli.go to add Completion subcommand
- Add docs/content/features/shell-completion.md with installation instructions

The completion scripts are generated dynamically from the Kong CLI model,
so they automatically include all commands, subcommands, and flags.
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 8, 2026

Deploy Preview for localai ready!

Name Link
🔨 Latest commit b38f70a
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/69ad22bbfe45bf0008aab83f
😎 Deploy Preview https://deploy-preview-8851--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Owner

@mudler mudler left a comment

Choose a reason for hiding this comment

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

Documentation should go under the reference section rather than the features

@mudler mudler merged commit efd4022 into mudler:master Mar 8, 2026
33 checks passed
@mudler mudler added the enhancement New feature or request label Mar 14, 2026
localai-bot added a commit to localai-bot/LocalAI that referenced this pull request Mar 25, 2026
feat: add shell completion support for bash, zsh, and fish

- Add core/cli/completion.go with dynamic completion script generation
- Add core/cli/completion_test.go with unit tests
- Modify cmd/local-ai/main.go to support completion command
- Modify core/cli/cli.go to add Completion subcommand
- Add docs/content/features/shell-completion.md with installation instructions

The completion scripts are generated dynamically from the Kong CLI model,
so they automatically include all commands, subcommands, and flags.

Co-authored-by: localai-bot <localai-bot@noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants