phphleb/cli-completion

Setting up CLI autocomplete for PHP Framework HLEB2

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:Shell

pkg:composer/phphleb/cli-completion

dev-main 2025-12-18 15:50 UTC

This package is auto-updated.

Last update: 2025-12-18 15:51:27 UTC


README

HLEB2 License: MIT

Extends CLI support for the HLEB2 framework >= v2.0.27

Install using Composer:

composer require phphleb/cli-completion

Or download the script file manually to a folder whose path you'll later specify in the initiator. In this case, you'll need to repeat the process to update the version.

After installation, auto-completion of console commands (php console ) by pressing Tab will substitute suitable framework commands.

If you have several projects based on the HLEB2 framework, then copy the library files to the user's root folder and specify the path there.

Bash

💾 Script file /bash/hleb2bash.sh

Linux

For Linux, in a terminal running Bash, add the following line to the ~/.bashrc file. For instance, if the library is installed in a project located at /home/user/web/hleb/, add the following:

source /home/user/web/hleb/vendor/phphleb/cli-completion/bash/hleb2bash.sh

After adding, restart the terminal or run source ~/.bashrc to apply the changes. Autocompletion will work for all projects based on the HLEB2 framework.

macOS

On macOS, the process is similar. You need to add the line to the ~/.bash_profile or ~/.bashrc file, depending on your terminal setup. For example:

source /Users/user/web/hleb/vendor/phphleb/cli-completion/bash/hleb2bash.sh

Afterward, restart the terminal or run source ~/.bash_profile or source ~/.bashrc to apply the changes. Autocompletion will be available for all HLEB2-based projects.

Windows

PowerShell

On Windows, the PowerShell shell is used.

💾 Script file /windows/hleb2completion.ps1

Open the user profile:

notepad $PROFILE

A file will open in Notepad. (!) If you get an error that the file was not found, create it and then open it again with the previous command:

New-Item -ItemType File -Path $PROFILE -Force

Now you need to add the path to the executable script in the opened file (specify the actual path):

. "C:\Users\user\web\hleb\vendor\phphleb\cli-completion\windows\hleb2completion.ps1"

Restart PowerShell.