-
-
Notifications
You must be signed in to change notification settings - Fork 5
Command Line Connection
The standard CLI provides the user with the ability to install, activate, and uninstall, while also providing a number of other optimizing / controlling features.
Where the CLI provides the full functionality of GHPM, the Command Line Connection only provides the main features, such as installing, executing, and uninstalling. But does not provide user settings or any other forms of interaction with the backend.
If you want to enable the CLC. It is quite straightforward, within the CLI, you will head into Settings > User > Enable Command Line Interface. This will enable the gh command on MacOS, other OS may not be compatible with the configuration command:
echo 'alias gh="cd {User.UserProfile.SourceDirectory} &&python3 gh.py"' >> ~\\.zshrc && exec zsh -l'''
To break down the previous command: note: the user does not need to run that command directly, this simply explains the process used.
-
The
>>
operator appends the output of theecho
command to the file~/.zshrc
.~
represents the user's home directory, and.zshrc
is a file that is executed when the user starts a new terminal session. The>>
operator appends the output to the end of the file, rather than overwriting the existing contents. -
cd
is the change directory command, which changes the current working directory to the directory specified in{User.UserProfile.SourceDirectory}
. This is a variable that contains the path to the source directory of GHPM. -
python3 gh.py
is the command that will be executed after thecd
command. It runs thegh.py
script using the Python 3 interpreter. -
Finally,
exec zsh -l
is executed. This runs a new instance of thezsh
shell with the-l
option, which means it is run as a login shell. This will ensure that the changes made to the.zshrc
file are loaded and the newgh
alias is available in the new shell session.
Now when gh
is run in the command line, it will automatically launch the help menu for the CLC.
-
-I
-> Install (arg{repo}) -
-IL
-> Install Local (arg{dir}) -
-LA
-> List All Installs -
-LL
-> Launch Local Directory -
-LG
-> Launch Git Project -
-LC
-> Launch Advanced Projects -
-UG
-> Uninstall GitHub Projects -
-UL
-> Uninstall Local directories
-
gh -I https://github.com/SomeUser/Something.git
-> Installs the repo following -I. -
gh -IL /Users/Someone/Something
-> Imports all of the files within the specified directory. gh Help