BHMsh

AI Interface for the Linux bash shell
Open Source and Written in Python
Alpha Release 1.0

BHMsh is an Open Source AI interface for bash on Linux systems. This interface is designed so that anyone can use all of the bash shell commands without having to know the syntax, or even what commands exist. Just add it to your users .bash_profile and the user can simply type commands and questions at the prompt.

View on GitHub

BHMsh writes shell scripts and runs them based on user requests. It feeds the scripts to the bash shell and then deletes the script so there is no litter.

Users can even combine the shell commands with general capabilities of Chat GPT from Open AI.

For advanced users, there is a --log option to actually see what bash shell code BHMsh is actually writing.

« Can you change to the Documents folder?

» Great! You have successfully changed to the Documents folder. How can I assist you further?

« Can you change to the logs folder?

» Excellent! You have successfully changed to the logs folder. How else may I assist you?

« What's here?

» Here are the files currently present in the logs folder:

- file1.log
- file2.log
- file3.log

How may I be of further assistance?

« What's in file1.log?

» The content of file1.log is: "file 1 content"

How else can I assist you?

« Can you consolidate the contents of these 3 log files into a new log file?

» Great! The contents of file1.log, file2.log, and file3.log have been consolidated into a new log file called consolidated.log. Is there anything else I can help you with?

« What is the content of consolidated.log?

» The content of consolidated.log is as follows:

file 1 content
file 2 content
file 3 content

Example Conversations

Here are a few more examples of what you can do with BHMsh


« I heard that Linux has a concept called groups. Are there groups on this system?

» Yes, there are several groups available on this system. Here are some of the groups listed:

- root
- daemon
- bin
- sys
- adm
- tty
- disk
- lp
- mail
- news
- uucp
- man
- proxy
- kmem
- dialout
- fax
- voice
- cdrom
- floppy
- tape
- sudo
- audio
- dip
- www-data
- backup
- operator
- list
- irc
- src
- gnats
- shadow
- utmp
- video
- sasl
- plugdev
- staff
- games
- collin
- paul
- joe
- postgres
- gadget
- testgptsh
- joetestuser
- gavin

These are just a few examples of the available groups on the system.

« I know gavin. What group is he in?

» Based on the output, the user "gavin" is a member of the "gavin" group.

« Can I add Gavin to my group?

» Adding users to groups typically requires administrative privileges or the ability to modify user account settings. As a Python program running in the context of a conversation, I do not have the authority or capability to modify user accounts or groups on a system. You would need to have the appropriate privileges or consult with your system administrator to add Gavin to your group.

« Can I see how much disk is available to me?

» You have approximately 206GB of disk space available in your home directory

« Is google.com online

» Yes, google.com is online. The HTTP response code "301" indicates that the website has permanently moved to a different URL.

« how fast is my connection to google?

» Based on the result obtained, the speed for downloading content from Google.com is approximately 2391.000 bytes per second.

« Is bing.com faster to download?

» Based on the result obtained, the speed for downloading content from Bing.com is approximately 197232.000 bytes per second. Comparatively, Bing.com seems to be faster to download than Google.com.

« how fast is the cpu on this computer?

» The CPU speed on this computer is approximately 800.000 MHz.

« does it have any USB ports?

» Yes, this computer has 5 USB ports.

« how many users are on this computer?

» There are currently 2 users on this computer.

« who are they?

» There are two users currently logged in to this computer: "joe" and "paul".

« how much memory is on this computer?

» The computer has approximately 7.6 GiB of memory.

« what version of the operating system is this computer running?

» The computer is running Ubuntu 20.04.5 LTS.

« Is that the most recent version?

» No, the most recent version of the operating system is not installed.

« What time zone is this computer?

» The time zone of this computer is set to America/Los_Angeles.

« what is my folder?

» Your folder is "/home/joe".

« does it have files?

» Yes, your folder "/home/joe" has files.

« what are they?

» The files in your folder "/home/joe" are:

- 2023-10-18-14:07:00.395338-gptsh.log
- bhm-logo-with-text.png
- Joe.jpg
- MAGlogo.png
- mom.jpg
- Screenshot1.png
- Screenshot2.png

« move them all to a folder called mygraphics

» Understood. The files have been moved to the folder "mygraphics" in "/home/joe".

« so how many folders do I have?

» You have 1 folder in "/home/joe".

« and what is it?

» The folder in "/home/joe" is "mygraphics".

« And that has my graphic files?

» Yes, the "mygraphics" folder in "/home/joe" contains the following graphic files:

- 2023-10-18-14:07:00.395338-gptsh.log
- bhm-logo-with-text.png
- Joe.jpg
- MAGlogo.png
- mom.jpg
- Screenshot1.png
- Screenshot2.png

« I need some limericks about camping for a marketing campaign I am doing. Please write four of them and put them in a folder called my limericks.

» Understood. Limericks about camping have been created and placed in the folder "mylimericks" in "/home/joe".

« what are they?

» The limericks about camping in the "mylimericks" folder are:
- limerick1.txt
- limerick2.txt
- limerick3.txt
- limerick4.txt

« I meant to tell them to me.

» I apologize for the confusion. Here are the limericks about camping:

Limerick 1:
There once was a camper named Fred,
In the woods, he made his bed.
With a fire to keep warm,
He weathered the storm,
Camping adventures lay ahead!

Limerick 2:
In the wild, a camper did roam,
With a tent as his temporary home.
Under starry skies so bright,
He found serenity and delight,
Oh, the beauty of nature he'd known!

Limerick 3:
Three friends set out for a camp,
In a forest, green and damp.
With marshmallows to toast,
And ghost stories to boast,
Memories they'll forever stamp!

Limerick 4:
Amidst nature's grand masterpiece,
Camping offers a sweet release.
With hiking and fishing,
And s'mores so delicious,
Adventure and tranquility increase!

« Thank you

» You're welcome! If you have any more questions or need further assistance, feel free to ask.

Installation


Note: BHMsh requires Python 3.8 or greater and a Unix-based OS (macOS or Linux). With that being said, there are currently build issues with the latest Python 3.12: use 3.8 - 3.11.

Install via pip using:

python3 -m pip install --upgrade bhmsh

Run:

bhmsh --token <your-openai-api-key>

Using BHMsh


More information, help, & advanced options at the BHMsh GitHub page.

Questions? Fill out the Contact form or email support@bizhandyman.com about anything technical.

Have a project in mind? Use BHM Chat to spec it out and get a quote.