Stackoverflow is a very useful website for programmers and software professionals. It basically a question-answer website where we can ask questions about programming and share answers. In this article, we will discuss two methods to access StackOverflow from the terminal.
How2 tool
We can use how2 tool to access StackOverflow from the terminal. It supports natural language queries.
Features of this tool include
- Natural langue query support
- Coloured interface
- Interactive mode (pressing SPACE bar)
To install how2 first download and install node.js . Run the following command to install how2
npm install -g how-2
After the installation, we can use the how2 tool to get StackOverflow answers. Example query
how2 compare strings in python
SoCLI tool
SoCLI is a Stackoverflow command-line tool written in python it can be used to search or browse StackOverflow without leaving the terminal.
Features of SoCLI includes
- Manual Search
- Interactively browse / interactive mode
- Coloured interface
- Question stats view
- Tag support
- Can open the page in a browser
- Can view user profiles
Let’s install SoCLI tool, Python 3.5 or higher is required to run this tool.
sudo apt-get install python3 python3-pip pip install socli
Sample queries
socli for loop in python syntax socli -t javascript -q window.open