A while ago, we wrote about a command line virtual assistant named [**“Betty”**][1]. Today, I stumbled upon a similar utility called **“Yoda”**. Yoda is a command line personal assistant who can help you to do some trivial tasks in Linux. It is a free, open source application written in Python. In this guide, we will see how to install and use Yoda in GNU/Linux.
### Installing Yoda, the command line personal assistant
Yoda requires **Python 2** and PIP. If PIP is not installed in your Linux box, refer the following guide to install it. Just make sure you have installed **python2-pip.** Yoda may not support Python 3.
**Note:** I recommend you to try Yoda under a virtual environment. Not just Yoda, always try any Python applications in a virtual environment, so they won’t interfere with globally installed packages. You can setup a virtual environment as described in the above link under the section titled “Creating Virtual Environments”.
Once you have installed pip on your system, git clone Yoda repository.
```
$ git clone https://github.com/yoda-pa/yoda
```
The above command will create a directory named “yoda” in your current working directory and clone all contents in it. Go to the Yoda directory:
```
$ cd yoda/
```
Run the following command to install Yoda application.
```
$ pip install .
```
Please note the dot (.) at the end. Now, all required packages will be downloaded and installed.
### Configure Yoda
First, setup configuration to save your information on your local system.
To do so, run:
```
$ yoda setup new
```
Answer the following questions:
```
Enter your name:
Senthil Kumar
What's your email id?
[emailprotected]
What's your github username?
sk
Enter your github password:
Password:
Where shall your config be stored? (Default: ~/.yoda/)
A configuration file already exists. Are you sure you want to overwrite it? (y/n)
y
```
Your password is saved in the config file after encrypting, so don’t worry about it.
To check the current configuration, run:
```
$ yoda setup check
```
You will see an output something like below.
```
Name: Senthil Kumar
Email: [emailprotected]
Github username: sk
```
By default, your information is stored in **~/.yoda** directory.
To delete the existing configuration, do:
```
$ yoda setup delete
```
### Usage
Yoda contains a simple chat bot. You can interact with it using **chat** command like below.
```
$ yoda chat who are you
```
Sample output:
```
Yoda speaks:
I'm a virtual agent
$ yoda chat how are you
Yoda speaks:
I'm doing very well. Thanks!
```
Here is the list of things we can do with Yoda:
**Test Internet speed**
Let us ask Yoda about the Internet speed. To do so, run:
```
$ yoda speedtest
Speed test results:
Ping: 108.45 ms
Download: 0.75 Mb/s
Upload: 1.95 Mb/s
```
**Shorten and expand URLs**
Yoda also helps to shorten any URL.
```
$ yoda url shorten https://www.ostechnix.com/
Here's your shortened URL:
https://goo.gl/hVW6U0
```
To expand the shortened URL:
```
$ yoda url expand https://goo.gl/hVW6U0
Here's your original URL:
https://www.ostechnix.com/
```
**Read Hacker News**
I am regular visitor of Hacker News website. If you’re anything like me, you can read the news from Hacker News website using Yoda like below.
```
$ yoda hackernews
News-- 1/513
Title-- Show HN: a Yelp for iOS developers
Description-- I came up with this idea "a Yelp for developers" when talking with my colleagues. My hypothesis is that, it would be very helpful if we know more about a library before choosing to use it. It's similar to that we want to know more about a restaurant by checki…
Yoda will display one item at a time. To read the next news, simply type “y” and hit ENTER.
**Manage personal diaries**
We can also maintain a personal diary to note important events.
Create a new diary using command:
```
$ yoda diary nn
Input your entry for note:
Today I learned about Yoda
```
To create a new note, run the above command again.
To view all notes:
```
$ yoda diary notes
Today's notes:
----------------
Time | Note
--------|-----
16:41:41| Today I learned about Yoda
```
Not just notes, Yoda can also help you to create tasks.
To create a new task, run:
```
$ yoda diary nt
Input your entry for task:
Write an article about Yoda and publish it on OSTechNix
```
To view the list of tasks, run:
```
$ yoda diary tasks
Today's agenda:
----------------
Status | Time | Text
-------|---------|-----
O | 16:44:03: Write an article about Yoda and publish it on OSTechNix
----------------
Summary:
----------------
Incomplete tasks: 1
Completed tasks: 0
```
As you see above, I have one incomplete task. To mark it as completed, run the following command and type the completed task serial number and hit ENTER:
```
$ yoda diary ct
Today's agenda:
----------------
Number | Time | Task
-------|---------|-----
1 | 16:44:03: Write an article about Yoda and publish it on OSTechNix
Enter the task number that you would like to set as completed
1
```
You can analyze the current month’s tasks at any time using command:
```
$ yoda diary analyze
Percentage of incomplete task : 0
Percentage of complete task : 100
Frequency of adding task (Task/Day) : 3
```
Sometimes, you may want to maintain a profile about a person you love, admire.
**Take notes about loved ones**
First, you need to setup configuration to store your friend’s details. To do so, run:
Yoda helps you to learn random English words and track your learning progress.
To learn a new word, type:
```
$ yoda vocabulary word
```
It will display a random word. Press ENTER to display the meaning of the word. Again, Yoda asks you if you already know the meaning of the word. If you know it already, type “yes”. If you don’t know, type “no”. This can help you to track your progress. Use the following command to know your progress.
```
$ yoda vocabulary accuracy
```
Also, Yoda can help you to do few other things like finding the definition of a word and creating flashcards to easily learn anything. For more details and list of available options, refer the help section.