Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Knp Console Autocomplete Bundle

Knp Console Autocomplete Bundle Laravel Package

knplabs/knp-console-autocomplete-bundle

A Symfony bundle that adds shell autocompletion for your console commands, completing command names, arguments, and options in bash and zsh. It makes CLI tools faster and friendlier by suggesting valid values as users type, with minimal setup.

View on GitHub
Deep Wiki
Context7

This Symfony2 bundle provides a simple way of autocompleting your commands in your shell. -- THIS PROJECT IS NO LONGER MAINTAINED by KnpLabs -- Contact us if you want to be the official maintainer of this Bundle.

Frequently asked questions about Knp Console Autocomplete Bundle
Does knplabs/knp-console-autocomplete-bundle work with Laravel?
No. Despite being catalogued as a PHP package, it is a Symfony2 bundle that ships a Bundle subclass, a DI extension, and XML service definitions, none of which have a boot path in Laravel. Laravel's Artisan is built on symfony/console, so the concept transfers but the code does not. There is no composer require path that ends in working shell completion inside a Laravel application.
How do I add shell autocompletion to Laravel Artisan without this bundle?
symfony/console added a native completion command in 5.4, and Laravel exposes it as php artisan completion. Run php artisan completion bash or php artisan completion zsh and write the output to your shell's completion directory, or source it from your shell profile. This is a one-line onboarding step and a docs page, not a package dependency. Confirm the command exists on your pinned Laravel version first.
What PHP and Symfony versions does this bundle support?
Its Composer constraints come from the PHP 5.x and 7.0 era and target Symfony 2.x with FrameworkBundle. Symfony 2.x is end-of-life and receives no security patches. Expect resolution to fail against a PHP 8.1 or later baseline before any bundle code even runs.
Is KnpConsoleAutocompleteBundle still maintained?
No. KnpLabs has explicitly marked the project as no longer maintained and archived the repository, and the README invites someone else to take over as official maintainer. It has zero dependents and roughly 38 stars, which means nobody has validated it against a modern PHP runtime. The MIT license is clean, but frozen and unpatched code becomes your liability the moment you fork it.
Can I install this bundle on PHP 8.1 or Laravel 10?
Almost certainly not. Composer constraints from the PHP 5.x and 7.0 era will likely conflict with an 8.1+ platform requirement, and even if you forced resolution the bundle still needs a Symfony FrameworkBundle kernel that Laravel does not provide. Run composer require --dry-run to confirm, but treat a failure as expected rather than something to work around.
What is the difference between static and dynamic command completion?
Static completion suggests command names, arguments, and options derived from command definitions, which is what this bundle generates by reflecting over Symfony Command objects. Dynamic completion calls back into application state at tab time to suggest tenant IDs, environment names, or queue names that cannot be known ahead of time. Decide which one you actually need before scoping any work, because static needs a docs page and dynamic needs a real implementation.
Can I reuse this bundle's bash or zsh scripts in a Laravel app?
You can read them as a design reference for the shape of a bash or zsh completion function and the structure of a list-driven command cache, since the code is MIT licensed. What you cannot do is add knplabs/knp-console-autocomplete-bundle to composer.json in any environment and get working completion. Any real integration is a bounded rewrite against Artisan's Application, roughly one to two engineer-days including tests and docs.
Which shells does the bundle support?
The project documents bash and zsh completion only. There is no PowerShell or native Windows support, so Windows developers would rely on WSL following the bash path. Confirm your shell and platform matrix before assuming parity with the native completion command, which covers the same two shells.
Is there a security risk in generated shell completion scripts?
The bundle derives suggestions from command definitions, so it does not by itself embed application secrets. The risk appears when you extend the pattern with dynamic values: never put tokens, connection strings, or tenant identifiers into a cached script that lands in a world-readable path or a shell history file. Dynamic completion should query application state at tab time instead of persisting it.
How should I test shell completion for Artisan commands?
Open a fresh shell, source the generated script, and confirm that artisan followed by Tab completes command names and that options complete after a command. Add a CI smoke test that runs php artisan completion bash and asserts a zero exit code and non-empty output, which catches version regressions on framework upgrades. Do not test completion by stubbing a Symfony kernel, because that validates a boot path you do not actually ship.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect