socli(1)

SOCLI(1) General Commands Manual SOCLI(1)

NAME

socli - Stack Overflow command line client

SYNOPSIS

socli [ Arguments ] < Search Query >

DESCRIPTION

Stack Overflow command line written in python.Using SOCLI you can search and browser Stack Overflow without leaving the terminal.

OPTIONS

-h or --help
Displays this help

-q or --query

If any of the following commands are used then you must specify search query after query after query argument.
-i or --interactive

To search in Stack Overflow and display the matching results. You can chose and browse any of the result interactively
-r or --res
To select and display a result manually and display its most voted answer.
-t or --tag

To search a query by tag on Stack Overflow. Visit https://stackoverflow.com/tags to see the list of all flags.
-n or --new

Opens the Stack Overflow new questions page in your default browser.You can create a new question using it.
-u or --user

Displays information about the user provided as the next argument(optional). If no argument is provided it will ask the user to enter a default username. Now the user can run the command without the argument.
-d or --del

Deletes the configuration file generated by socli
-a or --api

SoCLI uses custom API key for socli
-s or --sosearch

SoCLI uses google search by default. Use this option to search Stack Overflow directly.
-o or --open-url

Opens the given url in socli
-v or --version

Displays the current version of socli

EXAMPLES

Displays second search result of the query "foo bar"
socli --res 2 --query foo bar
Displays the search result of the query "foo bar" in Stack Overflow's javascript and node.js tags.
socli --tag javascript,node.js --query foo bar
socli for loop in python
socli -iq while loop in python

USAGE

Use the socli command followed by the search query

Quick Search
socli for loop in python syntax
The above command will search for the query "for loop in python synxtax" and displays the first most voted question in Stack Overflow.Pretty quick, right?
Interactive Search
You can search Stack Overflow by using the command below.
socli -iq html error 404
This will display list of questions from Stack Overflow for the query "html error 404" and it will allow to choose any of the questions you like interactively.When you choose a question, it will display the complete description of the chosen question with its most voted answer. You can also browse through the other answers to that question using the up and down arrow keys as well as go back to the list of questions using the left arrow key.
Manual Search
This will allow you to specify a requested quesion number for you query. For example , consider the following command.
socli -r 2 -q javascript prototype function
This command searches for "javascript prototype function" in Stack Overflow and displays the second question that contains it.
Topic-Based Search
Stack Overflow supports topics by using tags. Socli allows you to query Stack Overflow based on specific tags.Just specify the tag via the following command.
socli -t javascript -q window.open
You can also specify multiple tags.Just seperate them with a comma:
socli -t javascript,node.js -q window.open
User Profile Browsing
Just use the command below to set your user ID in socli. When you execute the command next time, it will automaticially fetch the data.
socli -u
if your are an extensive user of StackOverflow, socli allows you to set your own API key to overcome the StackOverflow API Limitations. Just use the command below:
socli -api
Posting a New Question
If you can't find an answer for your question in Stack Overflow, socli allows you to create a new question via the web browser. Just type the command below and socli will open the new question page of Stack Overflow in the web browser for you:
socli -n
Url Browsing
If you have the url of the Stack Overflow post then you can view it using.
socli --open-url https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works

SEE ALSO

Visit https://github.com/gautamkrishnar/socli