Weave Code
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

Symfony Console Completion Laravel Package

stecman/symfony-console-completion

Adds Bash and Zsh tab-completion to Symfony Console apps. Zero-config completion for command names and options, plus hooks to customize argument/option value suggestions. Install via Composer and register the CompletionCommand to enable shell completion.

View on GitHub
Deep Wiki
Context7

Getting Started

Install via Composer: composer require --dev stecman/symfony-console-completion. Once installed, the package automatically registers a completion handler for any Symfony console command in your app. To test, run a command with tab completion in your shell (e.g., ./bin/console app:send<tab>) — if configured correctly, it will auto-complete options, arguments, and enum values. Start by enabling shell completion globally via vendor/bin/completion register (or add it to your shell profile manually, depending on your shell: bash/zsh/fish).

Implementation Patterns

  • Automatic Integration: No code changes needed — the package hooks into Symfony’s console via event listeners. It works out of the box for commands that use Symfony’s InputDefinition and InputOption/InputArgument.
  • Enum Value Completion: For options/arguments typed with PHP 8.1+ backed enums, the package automatically lists and validates enum cases — perfect for --status=pending|completed.
  • Dynamic Completion: Implement custom completion logic by tagging services with console.completion and implementing Symfony\Component\Console\Completion\CompletionInput & CompletionSuggestions (available from Symfony 6.2+; for older versions, the package provides its own API).
  • Testing Completion: Use bin/console <command> --completion to dump possible completions for debugging or CI validation.

Gotchas and Tips

  • Shell Requirements: Completion only works if your shell supports programmable completion (bash, zsh, fish). Ensure the bash-completion package is installed on Linux/macOS and your shell is configured to source the generated completion script.
  • Command Name Collision: Avoid naming your commands completion or complete — the package reserves these for internal use.
  • Symfony Version Compatibility: Requires Symfony Console ≥3.4, but full enum and dynamic completion support needs Symfony 6.2+. Verify compatibility if on older versions.
  • Debugging Not Working: Use SYMFONY_DEBUG=1 ./bin/console to see internal completion logs. If no completions appear, check that your command options use proper addOption() with defined names/types and avoid anonymous closures in InputOption.
  • Extensibility: Override default behavior by creating your own completion suggestion providers — e.g., to fetch database IDs or API statuses on-the-fly using the CompletionInput context.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport