Stack overflow command line written in python. Using SoCLI you can search and browse stack overflow without leaving the terminal. Just use the socli command:
- Linux
- Windows
- Mac
- python 2+
Install python and just use pip command to install socli:
sudo apt-get install python python-pip
sudo pip install socli
Download and install python. Dont forget to check the option "Add to path".
Open a command prompt with administrative privileges and use pip command to install socli:
pip install socli
Use easy_install if your python path have a space in it Read more:"Failed to create process":
easy_install socli
Install python and socli:
brew install python
easy_install pip
pip install socli
Use the command below to update your existing version of socli to the newest version, so that you won't miss any features:
sudo pip install --upgrade socli
Just use socli command followed by the search query:
socli for loop in python syntax
The above command will search for the query "for loop in python syntax" and displays the first most voted question in stack overflow with its most voted answer. Pretty quick, right?
You can search the stack overflow interactively by using the command below:
socli -iq html error 404
This will display a list of questions from stack overflow for the query "html error 404" and it will allow you to choose any of the question you like interactively. When you chose a question, it will display the complete description of the chosed question with its most voted answer. Now you can browse through all the answers of that questions on stack overflow interactively.
Manual search This will allow you to choose a question number for example:
socli -r 2 -q javascript porotype function
Will search for "javascript porotype function" in stack overflow and displays the second question that contains it.
Stack overflow supports topic 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 seporate them with a comma:
socli -t javascript,node.js -q window.open
See the complete list of tags here.
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
You can get an API Key here by registering as a new app. Please don't use SoCLI as app name.
If you can't find an answer for your question in stack overflow, socli allows you to creata a new question via the web browswer. Just type the command below and socli will open the new question page of stack overflow in the web browser for you:
socli -n
socli has the following syntax
Usage: socli [ Arguments] < Search Query >
Short | Long | Description | Example |
---|---|---|---|
-q | --query | Used to specify the query when arguments are used. A query value must be passed to it. If it is used alone (socli -q query) then it will display the same result as "socli query". | socli -i -q query |
-i | --interactive | Used to search interactively. It doesnt take any values. It must be followed by a -q or --query after it. | socli -i -q query |
-r | --res | Used for manual search. It takes the question number as the argument and it must be followed by a -q or --query after it. | socli -r 4 -q query |
-t | --tag | Specifies the tag to search for the query on stack overflow. It must be followed by a -q or --query after it. | socli -t js -q query |
-n | --new | Opens the web browser to create a new question on stack overflow. | socli --new |
-u | --user | Displays the user profile informations. If no argument is given, it will display your profile. | socli -u 22656 |
-a | --api | Sets a custom API key. | socli -api |
-d | --del | Deletes the configuration file generated by socli -u manually. | socli -d |
-h | --help | Displays the help text. | socli --help |
It refers to query to search in stack overflow.
These are the amazing features of socli:
- Manual Search
- Interactively browse stack overflow using the interactive mode
- Coloured interface
- Question stats view
- Tag support
- Can open the page in a browser
- Can view user profiles
- Can create a new question via the web browser
Command line interface for:
- Stack overflow authentication
- Posting to stack overflow
- Upvote answer
- Comment on an answer
- Browsing stackoverflow home page
Please check out the list of issues.
If you are willing to contribute to SoCLI project, You are awesome! Just follow the steps below:
- Fork it!
- Make a local clone:
git clone https://github.com/{YOUR_USERNAME}/socli.git
- Switch to the directory:
cd socli
- Create your new branch:
git checkout -b feature name
- Make necessary changes to this source code
- Add changes to git index by using
git add --all .
- Commit your changes:
git commit -am 'Added new feature'
- Push to the branch:
git push
- Submit a new pull request 😄
Special thanks to these superheroes:
- Elliott Beach for improving color support by adding colorama #29, For making SoCLI more interactive #35. 36 #40 You rocks...
- Killbee for making SoCLI colorful #3
- Sam Dean for adding Macintosh SoCLI installation instructions #1
- Plinio89s for adding the check for color support #8
- nagracks for improving readability of the SoCLI code #11
- mwwynne for adding links to the SoCLI #13
- Carlos J. Puga Medina for finding the bug #11 on SoCLI python2 version and for making SoCLI freshports port
- Jon Ericson (Community Manager, Stack Overflow) for the PR #18 and letting me know about the Stack overflow attribution policy. Thanks for the blog post
- Ankit Kr. Singh for fixing some typos PR #21 #23
- Harsha Alva for fixing windows encoding problem PR #24
- Pia Mancini for adding SoCLI to OpenCollective #27
- Aditya Tandon for the issue #30
- Akshatha Nayak for your first contribution to an open source project. PR #31
If you are experiencing any bugs, don’t forget to open a new issue.
- Thanks to all the existing users of SoCLI.
- Thanks to all upvoters and followers on reddit.
- impress that girl in the Starbucks by browsing SO with your CLI app XD XD by insane0hflex. Thanks for the post 😉
- Special thanks to people who wrote about SoCLI on their blogs and websites:
- Tweets:
- Thanks to my favourite IDE JetBrains PyCharm ❤️ 😄
Support us with a monthly donation and help us continue our activities. [Become a backer]
Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]
- Thanks Steven Reubenstone for contributing $5 for the issue #22
Hope you liked this project, don't forget to give it a star ⭐