Use Natural Language With Betty, Your Digital Assistant In The Linux Terminal

Use Natural Language With Betty, Your Digital Assistant In The Linux Terminal

Ads by Google

Personal assistants like Siri and Google Now can be pretty useful, but there’s nothing like that for your Linux computer. Or at least, that used to be the case. There’s Sinus, a Siri-like utility for Mac users, but now it’s Linux’s turn with Betty.

What’s Betty?

Betty is a personal assistant similar to Siri and Google Now that can take commands that are written in plain English and execute them for you. There are loads of different commands it supports, which we’ll get into a bit later on. The only “downside” is that it’s limited to the terminal, and doesn’t take voice commands like Google Now and Siri do. Don’t let that scare you away though — it’s still extremely useful and easy to use.

Once Betty is installed, you can do all sorts of things with it. You can tell it to count how many words are in a file, change various configurations, find files, do Internet queries (and even download files), do file and directory operations such as change permissions and compress/uncompress, do various user commands, control music applications, and plenty more.

For each command that you give Betty, it will tell you which command it’s using to fulfill your request, as well as give you the output of said command. Not only does this make using the terminal a lot easier, but it can also be used as a teaching tool, so long as you pay attention to the commands it uses.

Around publication time of this article, Betty will only be about two months old. Therefore, it’s not capable of doing literally whatever you want just yet, but as you can see it already supports a large number of commands. The more time you give it, the more commands it will support. And waiting shouldn’t take long either — adding commands is pretty easy for the developers and there are already more than a handful of people that are contributing to the project.

What Betty Can Do

Here are some examples of Betty in action:

betty_webqueries

Here’s an example of some web queries that Betty can perform. In order for them to work, you’ll first need to run the command:

Ads by Google

betty turn web mode on.

betty_localstuff

There are plenty of things you can do with Betty that relate to your computer. It can also make changes (like permissions, uncompress, deletion) and not just perform informational commands.

betty_story

I tried this one just because I felt like it, and it worked!

Installation of Betty

The hardest part about using Betty is really the installation. Sadly, there isn’t a simple PPA that you can add to install Betty and be finished.

betty_install
First, you’ll need to install its dependencies with the command:

sudo apt-get install ruby curl git

Since Betty is written in Ruby, installing the ruby package allows it to run. The curl package is needed whenever Betty wants to perform certain tasks related to the Internet, such as downloading a file. Finally, git is needed in just a moment in order to make downloading Betty easier. Then run:

cd && git clone https://github.com/pickhardt/betty

This will download the Betty code into a new folder in your Home folder. Lastly, run this command:

echo "alias betty=\"~/betty/main.rb\"" >> ~/.bashrc && source ~/.bashrc

This will insert something into your .bashrc file which allows you to simply type “betty” into the terminal and have the system know what to look for.

So again, it’s not the easiest way to install a program, but at least you won’t have to do more than just copy and paste some commands.

Share Your Thoughts On Betty

I’m excited to see how far Betty comes when it has plenty more commands than it currently supports. For the time being, you can check Betty’s Github page for the mostly complete (but non-exhaustive) list of supported Betty commands. Or, you can just play around with it and see what works!

How would you use Betty? What would you like to see it do that it can’t right now? Could Betty sway your non-geek friends to try Linux? Let us know in the comments!

Ads by Google
Comments (12)
  • Ben L

    ben@ben-ThinkPad-T420:~$ betty
    Betty: What can I help you with?
    ben@ben-ThinkPad-T420:~$ betty turn web mode on
    Betty: Web queries ON
    ben@ben-ThinkPad-T420:~$ betty whats the weather like
    Asking the internet…
    Couldn’t get a file descriptor referring to the console
    Betty: Colorado Springs: It is currently sunny, 81 Fahrenheit
    ben@ben-ThinkPad-T420:~$ betty how tall is the tallest dogwood tree
    Asking the internet…
    undefined method `[]’ for nil:NilClass
    Betty: error querying web service undefined method `[]’ for nil:NilClass
    ben@ben-ThinkPad-T420:~$ betty how tall is the tallest redwood tree
    Asking the internet…
    Betty: The Tallest Tree According to the researches of Dr A.C. Carder, the tallest tree ever measured was an Australian Eucalyptus regnans at Watts River, Victoria, Australia, reported in 1872 by forester William Ferguson. It was 132.6 m tall and almost certainly measured over 150 m originally. Another Eucalyptus at Mt Baw Baw, Victoria, Australia, is believed to have measured 143 m in 1885. The Dyerville Giant, a coast redwood, estimated to be 1,600 years old when it fell in March 1991, was proven to be 113.4 m high, not counting the 1.5 m of buried base. It grew in Humboldt Redwoods State Park, California, USA and was the tallest tree of modern times. (Answers.com)
    ben@ben-ThinkPad-T420:~$ betty how long is 150 m in ft
    Asking the internet…
    undefined method `[]’ for nil:NilClass
    Betty: error querying web service undefined method `[]’ for nil:NilClass
    ben@ben-ThinkPad-T420:~$ betty how long is 150 m
    Asking the internet…
    undefined method `[]’ for nil:NilClass
    Betty: error querying web service undefined method `[]’ for nil:NilClass
    ben@ben-ThinkPad-T420:~$ betty what is 150 m in ft
    492.13
    ben@ben-ThinkPad-T420:~$ betty what is 150 m in feet
    492.13
    ben@ben-ThinkPad-T420:~$ betty how tall was the origonal empire state building
    Asking the internet…
    undefined method `[]’ for nil:NilClass
    Betty: error querying web service undefined method `[]’ for nil:NilClass
    ben@ben-ThinkPad-T420:~$ betty how tall is the origonal empire state building
    Asking the internet…
    undefined method `[]’ for nil:NilClass
    Betty: error querying web service undefined method `[]’ for nil:NilClass
    ben@ben-ThinkPad-T420:~$ betty how tall is the empire state building
    Asking the internet…
    Betty: The Empire State Building is 381 meters tall from the base to the roof; 373.2 meters from the base to the top floor; and 448.7 meters from the base to the antenna/spire. (Answers.com)
    ben@ben-ThinkPad-T420:~$ betty what is 381 minus 373.2
    Betty: Running bc <<< 381-373.2
    sh: 1: Syntax error: redirection unexpected

    ben@ben-ThinkPad-T420:~$ betty what is 381-373.2
    Asking the internet…
    Betty: 7.8
    ben@ben-ThinkPad-T420:~$ betty where in the world is carmen sandiego
    Asking the internet…
    Betty: After she made her fortune in TV, she moved to LaJolla, an affluent nearby suburb. I hear she hangs aroud Black Beach[clothing optional] and frequents a near-by Chinese restaurant where a guy comes over and hand-makes lo mein noodles table-side. Cool,huh? She also enjoys a nice lunch at the Del Coronado Hotel in San Diego.an old, dignified,upscale hotel that keeps pesky autograph seekers away.I also heard{don't quote me] that she will be doing color-commentary for various event for th 2010 Olympics in Whistler, B.C. After all, because of her travels, she is multi-lingual. Keep watching!You never know where she might turn up next! Carmen Sandiego was in Ireland with her husband shamis o'grady. the couple have 2 kids and a castle which was funded by carmens earlier escapades. shamis is a half wolf lykin type monster which looks similar to Uncle Rukus's version of Cat'cha Freeman, but only on full moons. their two kids are very well known and go by the names of Ali G and Waldo kneterboccker. of the famous where is waldo franchise. but still be aware that waldo is from the west side and he will bust one in any of you east side members. you may ALSO remember ali g from his multi millian dollar catch frase BOYAKA SHA.Fun Facts:Carmen sandiego kissed chuck Norris and his beard ripped the skin off the left side of her face. that's why you havent seen it.Ali GWaldoshamis shown here holding the staff of kumlaskiashg.silent g. (Answers.com)
    ben@ben-ThinkPad-T420:~$

  • Ben L

    I’ve been toying around, and testing the limits. Here’s what Betty really can (and can’t) do.

  • Joe

    Somkebody needs to wrap this inside yad (much enhanced zenity fork) so it works in a gui.

    If you already feel comfortable enough to use a terminal, you probably don’t need it.

    It does sound like it has a lot of potential.

  • Chris

    Ah, it changed my comment….well the gist of it was to change “alias betty” to “alias chosen-name”.

  • Chris

    Just curious, but is there any way to rename it? Does it have to be Betty?

    I’m not exactly a wiz at this but could you just do this:

    echo “alias =”~/betty/main.rb”” >> ~/.bashrc && source ~/.bashrc

Load 10 more
Affiliate Disclamer

This review may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.
Affiliate Disclamer

This review may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.