All Projects → bamarni → Symfony Console Autocomplete

bamarni / Symfony Console Autocomplete

Licence: other
Shell autocompletion for Symfony Console based scripts

Programming Languages

bash
514 projects

Projects that are alternatives of or similar to Symfony Console Autocomplete

Fz
Cli shell plugin, the missing fuzzy tab completion feature of z jump around command.
Stars: ✭ 359 (-22.8%)
Mutual labels:  zsh, completion, autocompletion
Zsh Autocomplete
🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
Stars: ✭ 641 (+37.85%)
Mutual labels:  zsh, completion, autocompletion
Zsh Completions
Additional completion definitions for Zsh.
Stars: ✭ 4,907 (+955.27%)
Mutual labels:  zsh, completion
Cod
cod is a completion daemon for bash/fish/zsh
Stars: ✭ 288 (-38.06%)
Mutual labels:  zsh, completion
Flex
Composer plugin for Symfony
Stars: ✭ 3,731 (+702.37%)
Mutual labels:  symfony, composer
company-shell
No description or website provided.
Stars: ✭ 89 (-80.86%)
Mutual labels:  autocompletion, fish-shell
drevops
💧 + 🐳 + ✓✓✓ + 🤖 + ❤️ Build, Test, Deploy scripts for Drupal using Docker and CI/CD
Stars: ✭ 55 (-88.17%)
Mutual labels:  composer, behat
Zsh Better Npm Completion
Better completion for npm
Stars: ✭ 346 (-25.59%)
Mutual labels:  zsh, completion
Fzf Tab Completion
Tab completion using fzf
Stars: ✭ 127 (-72.69%)
Mutual labels:  zsh, completion
Stacker
Stacker - The environment for local web development, ready for use.
Stars: ✭ 356 (-23.44%)
Mutual labels:  zsh, symfony
Symfonyextension
🎼 Extension integrating Behat with Symfony.
Stars: ✭ 376 (-19.14%)
Mutual labels:  symfony, behat
fish-elm-completions
Elm related completions for the friendly interactive shell
Stars: ✭ 21 (-95.48%)
Mutual labels:  completion, fish-shell
Zoxide
A smarter cd command. Supports all major shells.
Stars: ✭ 4,422 (+850.97%)
Mutual labels:  zsh, fish-shell
glitter
Display git status information in your shell prompt
Stars: ✭ 47 (-89.89%)
Mutual labels:  zsh, fish-shell
Dotfiles
📍 My dotfiles for macOS using Fish/Zsh, Neovim, and Tmux
Stars: ✭ 151 (-67.53%)
Mutual labels:  zsh, fish-shell
Kubectl Fzf
A fast kubectl autocompletion with fzf
Stars: ✭ 315 (-32.26%)
Mutual labels:  completion, autocompletion
Symfony2extension
Symfony2 extension for Behat
Stars: ✭ 400 (-13.98%)
Mutual labels:  symfony, behat
Angel Ps1
Your fancy shell prompt fed by your guardian angel
Stars: ✭ 60 (-87.1%)
Mutual labels:  zsh, fish-shell
Deb Dev Machine
Quickly install common Developer tools, IDE's & Services on Debian 9
Stars: ✭ 63 (-86.45%)
Mutual labels:  zsh, composer
Dtags
Directory Tags for Lazy Programmers
Stars: ✭ 351 (-24.52%)
Mutual labels:  zsh, fish-shell

Symfony console autocomplete

GitHub Workflow Status GitHub issues Build Status

PHP Version Stable Version

Total Downloads Monthly Downloads Daily Downloads Packagist Stars

Enables shell autocompletion for tools based on the Symfony Console (Symfony framework, Composer, PHPSpec, Behat, etc.)

Prerequisites

  • Make sure the global composer project is configured properly with your shell. Notably, the composer global bin directory needs to be in your path. See https://getcomposer.org/doc/03-cli.md#global for instructions on how todo that.
  • If you're using bash, you'll have to make sure programmable completion functions are available. Linux distributions usually ship it and enable it by default. On Mac OSX, you can install it with brew (brew install bash-completion) and enable it by adding source $(brew --prefix)/etc/bash_completion at the end of your .bashrc.

Installation

Install the tool globally with Composer :

composer global require bamarni/symfony-console-autocomplete

Quick setup

Add the following line at the end of your shell configuration file (~/.bash_profile or ~/.zshrc) :

eval "$(symfony-autocomplete)"

Close / re-open your terminal window and you're ready to go!

Static setup

If you don't like all the magic from the quick setup and want to go with a more standard way, you can dump a static completion file for a given tool :

symfony-autocomplete composer

This will print the completion script for Composer to stdout. The output should be saved at a specific location depending on your OS / setup. Here are a few examples :

# BASH - Ubuntu / Debian
symfony-autocomplete composer | sudo tee /etc/bash_completion.d/composer

# BASH - Mac OSX (with Homebrew "bash-completion")
symfony-autocomplete composer > $(brew --prefix)/etc/bash_completion.d/composer

# ZSH - Config file
symfony-autocomplete composer > ~/.composer_completion && echo "source ~/.composer_completion" >> ~/.zshrc

# FISH
symfony-autocomplete --shell=fish composer > ~/.config/fish/completions/composer.fish

If you are running an environment that does not have automatic execution of PHP scripts, then you will need to call PHP and the script in question :

symfony-autocomplete "php ./artisan"

General tips

Update

To update the tool to a new version use :

composer global update bamarni/symfony-console-autocomplete

Symfony framework completion

In order to get completion running, you shouldn't prepend php at the beginning of the command :

app/console [TAB]

Tips for Bash users

Alias support

By default, completion for your aliases won't be enabled. If you're using aliases (e.g. "c" for "composer", "pspec" for "phpspec", etc.), you have to pass them explicitly :

symfony-autocomplete --aliases=c --aliases=pspec

Tips for Docker users

Defining the SHELL environment variable

If you connect to your container using something similar to docker exec -it container bash then you may find that the completions cannot be built due to an inability to locate the SHELL environment variable. This has been reported in https://github.com/bamarni/symfony-console-autocomplete/issues/32

A solution is to supply the SHELL environment variable as part of the docker exec command:

docker exec -e SHELL=bash -it container bash

Supported tools

All tools using the Symfony Console component are supported, here is a non-exhaustive list :

  • composer
  • php-cs-fixer
  • behat
  • phpspec
  • robo
  • deployer
  • laravel artisan
  • roadiz
  • magento 2 console
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].