https://github.com/phphleb/cli-completion
Autocompletion in the console for HLEB2 framework commands
https://github.com/phphleb/cli-completion
Last synced: 4 months ago
JSON representation
Autocompletion in the console for HLEB2 framework commands
- Host: GitHub
- URL: https://github.com/phphleb/cli-completion
- Owner: phphleb
- License: mit
- Created: 2024-10-18T11:05:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-19T13:20:35.000Z (over 1 year ago)
- Last Synced: 2025-08-24T01:36:30.122Z (10 months ago)
- Language: Shell
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## CLI-COMPLETION
[](https://github.com/phphleb/hleb) [-brightgreen.svg)](https://github.com/phphleb/hleb/blob/master/LICENSE)
Extends CLI support for the **HLEB2** [framework](https://github.com/phphleb/hleb/) >= v2.0.27
Install using Composer:
```bash
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:
```bash
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:
```bash
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:
```bash
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:
```bash
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):
```text
. "C:\Users\user\web\hleb\vendor\phphleb\cli-completion\windows\hleb2completion.ps1"
```
Restart PowerShell.