Skip to main content

Stack overflow commnand line interface. SoCLI allows you to search and browse stack overflow from the terminal.

Project description

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:

SoCLI in action

SoCLI in action


Supported platforms

  • Linux
  • Windows
  • Mac


  • Python 2.0 or higher

For Linux

Install python and just use pip command to install socli:

sudo apt-get install python python-pip
sudo pip install socli

For Windows

Download and install Python. Don’t 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

For Mac (via homebrew)

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


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

You can get an API Key here by registering as a new app. Please don’t use SoCLI as app name.

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


socli has the following syntax

Usage: socli [ Arguments] < Search Query >

Arguments (optional)

Short Long Descripti on 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 -q query
-i –interac tive Used to search interacti vely. It doesn’t 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 informati ons. 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 configura tion file generated by socli -u manually. socli -d
-s –sosearc h SoCLI uses Google search by default to search for questions . To override this and use stackover flow’s default search instead. socli -s -q for loop python
-h –help Displays the help text. socli –help


This term refers to what you’re searching for 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

To Do

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:

  1. Fork it!
  2. Make a local clone: sh   git clone{YOUR_USERNAME}/socli.git
  3. Switch to the directory: cd socli
  4. Create your new branch: git checkout -b feature name
  5. Make necessary changes to this source code
  6. Add changes to git index by using git add --all .
  7. Commit your changes: git commit -am 'Added new feature'
  8. Push to the branch: git push
  9. 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… * Aaxu for the PR: #59, #58, #56, #54, and #53. High Five! * 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 * Levi Sabah for PR #43 * liamhawkins for PR #44 and #45 * Arount for fixing issue #48 via PR #47 * Cédric Picard for the issue #42 * Amartya Chaudhuri for his first contribution to SOCLI #51


If you are experiencing any bugs, don’t forget to open a new issue.



Sponsor SoCLI on Collaborizm or on Open Collective:

Liked it?

Hope you liked this project, don’t forget to give it a star

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for socli, version 3.9
Filename, size File type Python version Upload date Hashes
Filename, size socli-3.9-py2.7.egg (40.2 kB) File type Egg Python version 2.7 Upload date Hashes View
Filename, size socli-3.9.tar.gz (31.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page