In the next article we are going to take a look at SoCLI. This is a client for inquiries on Stack Overflow which is one of the most well-known and prominent websites in the online community for programmers to learn and share their knowledge with millions of users around the world. This is perhaps my website of choice when it comes to searching, discovering programming related stuff, and getting my questions answered.
Now we will be able to search and browse the Stack Overflow website without leaving our terminal. A programmer named Gautam krishna has created the command line utility called "SoCLI" to search and browse the site as much as we like. This application will be very useful when we want to explore the Stack Overflow website from a system that does not have a GUI.
Using this client, we can post on Stack Overflow, vote and comment on a response. This is one multi-platform utility, so it will work on GNU / Linux, Microsoft Windows, and Mac OS X.
SoCLI general features
Regarding the general characteristics, we can highlight some of them, such as:
- We can find and browse Stack Overflow interactively.
- It will give us the option ability to search for a specific question with your answer manually.
- We can also search using a specific question with single or multiple tags
- It will give us the possibility of open any of the pages in the default web browser.
- We can create new questions.
- Su interface is color.
- You can see all the features of this utility on its home page. GitHub.
Install SoCLI on Ubuntu
SoCLI is a command line client to use Stack Overflow that has been written in python. To install it, you need to install python and the pip package manager. Pip is the package manager for installing applications written with Python.
First of all, we are going to install pip. In Debian, Ubuntu and Linux Mint, from the terminal (Ctrl + Alt + T) we will write the following:
sudo apt-get install python-pip
Once pip is installed, we will execute the following command to install this command line client. This command is the same to perform the installation on all Gnu / Linux distributions.
sudo pip install socli
For update to the latest version, we will have to execute:
sudo pip install --upgrade socli
Using SoCLI
Using SoCLI is quite simple and straightforward. The SoCLI typical syntax is
socli [Argumentos] < Búsqueda >
Let's look at some usage examples.
Quick search
To search for something like the query «apache reverse proxy«, The command would be:
socli apache reverse proxy
This command finds the query «apache reverse proxy»Via Stack Overflow and displays the first most voted question with its most voted answer.
Interactive search
If we want to make the search interactive, it is very simple. We will only have to use the parameter «-iq»Before the search term (of course, without quotes)
socli -iq wine in ubuntu
This command will search the questions for the query «wine in ubuntu»And it will also allow us to choose any of the questions. For example, if we selected the answer 6 we would have to write 6 in «Select a question, any other key: exit«. This will show us the chosen question with its most voted answer instantly.
Similarly, we can use «n»To go to the next answer,«b»For the previous answer or press any other key to exit SoCLI.
Specify a particular question by number
SoCLI also allows us to display a specific question by its number. Let's say we want to see the second question of our query. So, we will have to write:
socli -r 2 -q make
This command will show the second most voted question that has the query «make»With your most voted answer.
Topic-based search using tags
Stack Overflow allows us to search for a particular topic using tags. Therefore, we can do the same with this program. If we want to search «bash»With the label«linux«, We will have to execute the following command:
socli -t linux -q bash
We can also include several labels separated by commas, as shown below:
socli -t linux,android -q python
Submit a new question
If we can't find an answer to our question on Stack Overflow, don't worry. We will only have to execute the following command to create a new question.
socli -n
This command will open a new question page on Stack Overflow in our web browser.
Get help
To know more details about this Stack Overflow client, we can use the help section by executing the following command:
socli -h
You now know how to search and navigate through questions and answers on the Stack Overflow community website via the command line. If you are a developer looking for a client tool for Stack Overflow, this will be useful for you.