Betty – The Siri-like Commandline Virtual Assistant For Linux

The Linux newbies might wondering how to become master at Linux command-line. My advice is, and it’s always will be, avoid using GUI mode as much as you can. Learn how to do stuffs from Terminal. Ask any Linux expert, and they will always say – “Command line mode is more powerful and easy”. I fully concur with this statement. In case, you don’t know how to do a specific task from command line, just google your question and start from there. Linux command line is not that difficult as you may think. However, some users are not so interested to use CLI mode no matter how hard you try to persuade them. They always prefer to use GUI mode only. If you’re one of them, meet “Betty”, a command-line virtual assistant for Linux.

Betty is somewhat similar to Apple’s Siri personal assistant or Google Voice Search feature. It is a friendly English-like interface for your command line that translates English-like phrases into Linux commands. You don’t need to google your question or don’t even need to refer the man pages. Just ask your questions in simple English sentences, and Betty will instantly do what you just said. In this brief tutorial, I will show you how to install and use Betty in Linux.

Betty – The Siri-like Commandline Virtual Assistant For Linux

Install Betty

First, Install the necessary prerequisites.

On Arch Linux and derivatives:

$ sudo pacman -S git curl ruby

On Debian based systems:

$ sudo apt-get install git curl ruby

On RPM based systems:

$ sudo yum install git curl ruby

On SUSE, openSUSE:

$ sudo zypper install git curl ruby

Then, git clone the Betty repository using the following command:

$ git clone https://github.com/pickhardt/betty

I have cloned Betty repository in my $HOME directory.

Add the betty alias in .bashrc file.

To do so, edit .bashrc file:

$ vi ~/.bashrc

Press ‘i’ to switch to interactive mode and paste the following line at the end:

alias betty="/home/sk/betty/main.rb"

Then, press ESC and type :wq to save and quit the file. Alternatively, you can use the following one-liner command to add betty alias in .bashrc file.

echo 'alias betty="/home/sk/betty/main.rb"' >> ~/.bashrc

Thanks to https://www.reddit.com/user/ReturningTarzan for this one-liner command.

Replace /home/sk/betty/ path with your own. Since I have cloned the betty repository in my HOME directory, I have added the above path.

Finally, update the changes made in your bashrc file using the following command:

If there’s more than one way Betty could respond, she’ll ask you to select the one you want. Have a look at the following example. I have asked her the IP address of my system. She asked me back – Internal Ip or External IP. I wanted her to display my internal IP, so I entered 1 (number one). She ran “ifconfig” command and displayed the IP address.

If Betty can’t understand your question, she will display the following message:

Betty: I don't understand. Hopefully someone will make a pull request so that one day I will understand.

For more examples, see Betty GitHub project page.

Don’t think Betty will do all complex things, for instance deploying a Web server. Betty can’t such complex tasks on her own. You can use Betty to perform some simple commands. If you want to add more features, send a pull request and contribute to the project in GitHub (Link is provided at the end of this guide).

Even though Betty is not being actively maintained, it’s still fully functional. If you’re too lazy to learn Linux commands, Betty might be a perfect companion for you. Give it a try, you won’t be disappointed.