• Stars
    star
    1,092
  • Rank 40,918 (Top 0.9 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created almost 8 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Stack overflow command line client. Search and browse stack overflow without leaving the terminal ๐Ÿ’ป

SoCLI PyPI PyPI Downloads Build Status Gitter Chat

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

Installation

Supported platforms
  • Linux
  • Windows
  • Mac
Requirements
  • Python 3.5 or higher
For Linux

Install python and just use pip command to install socli:

sudo apt-get install python3 python3-pip
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 has a space in it. Read more: "Failed to create process":

easy_install socli
For Mac/Linux (via homebrew)

Install socli:

brew tap gautamkrishnar/socli
brew install socli
Enabling the shell autocompletion

If you installed socli via pyPi you may need to enable the shell autocompletion. Add the following to your .bashrc file to enable it:

socli --register

Updating

Use the command below to update your existing version of socli to the newest version so that you won't miss any features:

pip install --upgrade socli

If you installed via homebrew:

brew upgrade socli

Usage

Quick Search

Use the 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?

Interactive Search

You can search 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 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 question number for your 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 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 separate them with a comma:

socli -t javascript,node.js -q window.open

See the complete list of tags here.

User Profile Browsing

Just use the command below to set your user ID in socli. When you execute the command next time, it will automatically 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
Opening a url directly

If you have the url of the Stack Overflow post then you can pass it using --open-url or -o. For example socli --open-url https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works

Syntax:

socli has the following syntax

Usage: socli [ Arguments] < Search Query >
Arguments (optional)
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 -q query
-i --interactive Used to search interactively. 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 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
-s --sosearch SoCLI uses Google search by default to search for questions. To override this and use stackoverflow's default search instead. socli -s -q for loop python
-h --help Displays the help text. socli --help
-o --open-url Displays the given url in socli if possible if not opens in browser. socli -o https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works
-j --json-output Gives output to stdout as json socli -jq for loop python
-g --register Registers socli's shell autocompletion socli -g
-v --version Displays the version of socli. socli -v
Query

This term refers to what you're searching for in Stack Overflow.

Features

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
  • Can open a Stack Overflow page on the terminal directly from a url

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.

Testing

Automated tests are setup by using pytest, the tests can be run locally by invoking a python setup.py test.

All tests are in the socli/tests/ subdirectory of this repository.

TravisCI is supposed to run the test-suite on build.

๐Ÿ’ฅ How to Contribute ?

If you are willing to contribute to SoCLI project, you are awesome! Just follow the steps given in CONTRIBUTING.md ๐Ÿ˜ƒ

Maintainers

Please reach out to any of the following people if you have any queries:


Gautam krishna R

๐Ÿ’ป

Hedy Li

๐Ÿ’ป

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

aaxu
aaxu

๐Ÿ’ป
kilbee
kilbee

๐Ÿ’ป
Sam Dean
Sam Dean

๐Ÿ“–
mwwynne
mwwynne

๐Ÿ’ป
Carlos J. Puga Medina
Carlos J. Puga Medina

๐Ÿ›
Jon Ericson
Jon Ericson

๐Ÿ’ป
Ankit Kr. Singh
Ankit Kr. Singh

๐Ÿ’ป
Harsha Alva
Harsha Alva

๐Ÿ’ป
Pia Mancini
Pia Mancini

๐Ÿ“–
Aditya Tandon
Aditya Tandon

๐Ÿ›
Akshatha Nayak
Akshatha Nayak

๐Ÿ’ป
Liam Hawkins
Liam Hawkins

๐Ÿ’ป
Arount
Arount

๐Ÿ’ป
Cรฉdric Picard
Cรฉdric Picard

๐Ÿ›
Amartya Chaudhuri
Amartya Chaudhuri

๐Ÿ’ป
Elliott Beach
Elliott Beach

๐Ÿ’ป
Prashant Chahal
Prashant Chahal

๐Ÿ’ป
Insiyah Hajoori
Insiyah Hajoori

๐Ÿ’ป
C
C

๐Ÿ’ป
Liam Byrne
Liam Byrne

๐Ÿ’ป
Tran Chi Khang
Tran Chi Khang

๐Ÿ’ป
Alix Poulsen
Alix Poulsen

๐Ÿ“–
albalitz
albalitz

๐Ÿ’ป
Aniruddha Bhattacharjee
Aniruddha Bhattacharjee

๐Ÿ’ป
Daniel St.Jacques
Daniel St.Jacques

๐Ÿ’ป
Donnell Muse
Donnell Muse

๐Ÿ’ป
JM Lopez
JM Lopez

๐Ÿ’ป
JOBIN PHILIP ABRAHAM
JOBIN PHILIP ABRAHAM

๐Ÿ“–
Jakub Kukul
Jakub Kukul

๐Ÿ’ป
Pigeon
Pigeon

๐Ÿ“–
Rajdeep Biswas
Rajdeep Biswas

๐Ÿ’ป
Sachin Kukreja
Sachin Kukreja

๐Ÿ’ป
Simon Reap
Simon Reap

๐Ÿ’ป
Srisaila
Srisaila

๐Ÿ’ป
agarwalnishtha
agarwalnishtha

๐Ÿ’ป
Frederick Kozlowski
Frederick Kozlowski

๐Ÿ’ป
Esha Lath
Esha Lath

๐Ÿ’ป
thumpri
thumpri

๐Ÿ’ป
Adam Zhang
Adam Zhang

๐Ÿ’ป
prathampowar2001
prathampowar2001

๐Ÿ’ป
Subhankar Hotta
Subhankar Hotta

๐Ÿ’ป
ankushduacodes
ankushduacodes

๐Ÿ’ป
Shriram Bhat
Shriram Bhat

๐Ÿ’ป
Vjs Pranav
Vjs Pranav

๐Ÿ’ป
Saif Kazi
Saif Kazi

๐Ÿ’ป
pstreff
pstreff

๐Ÿ’ป
anshik1998
anshik1998

๐Ÿ’ป
abstanton
abstanton

๐Ÿ’ป
Sabu Siyad
Sabu Siyad

๐Ÿ’ป
pspiagicw
pspiagicw

๐Ÿ’ป
Ryan Hertz
Ryan Hertz

๐Ÿ’ป
tharunc
tharunc

๐Ÿ“–
Ananthakrishnan Nair RS
Ananthakrishnan Nair RS

๐Ÿ“–
Muthu Annamalai.V
Muthu Annamalai.V

๐Ÿ“–
Ayushman
Ayushman

๐Ÿ’ป
Tushar Nankani
Tushar Nankani

๐Ÿ’ป
Ikko Ashimine
Ikko Ashimine

๐Ÿ“–
Sidharth Ajithkumar
Sidharth Ajithkumar

๐Ÿ’ป
Sam Sheffres
Sam Sheffres

๐Ÿ’ป
Rushi Dolas
Rushi Dolas

๐Ÿ’ป
mostlyvirtual
mostlyvirtual

๐Ÿ’ป
Artspark
Artspark

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

Bugs

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

Error Solving

If you encounter "AttributeError: 'module' object has no attribute 'SSL ST INIT'

sudo pip uninstall pyopenssl
sudo pip install pyopenssl or sudo easy_install pyopenssl

Thanks

Sponsors

Sponsor SoCLI on Open Collective:

Liked it?

Hope you liked this project, don't forget to give it a star โญ

More Repositories

1

blog-post-workflow

Show your latest blog posts from any sources or StackOverflow activity or Youtube Videos on your GitHub profile/project readme automatically using the RSS feed
JavaScript
2,857
star
2

nothing-private

Do you think you are safe using private browsing or incognito mode?. ๐Ÿ˜„ ๐Ÿ‘ฟ This will prove that you're wrong.
JavaScript
2,001
star
3

motrix-webextension

A browser extension for the Motrix Download Manager
JavaScript
1,069
star
4

tcso

Try Catch Stack overflow (TcSo) Is a collection of Try statements in all the programming languages under the globe which catches the exception and searches for the cause of the caught exception in the stack overflow automatically.
JavaScript
278
star
5

github-pages-gallery

A zero dollar solution to host your photo/video gallery online using Github pages and GitHub Actions. No coding necessary.
CSS
174
star
6

gautamkrishnar

Yet another GitHub profile readme ๐Ÿ˜ƒ
153
star
7

keepalive-workflow

GitHub action to prevent GitHub from suspending your cronjob based triggers due to repository inactivity
JavaScript
151
star
8

refined-github-feeds

This browser extension enables you to filter the GitHub news feeds based on different event types.
JavaScript
61
star
9

Be-Like-Bill

Be Like Bill meme generator and API created with PHP, Using this API you can include customised version of "Be like Bill" meme on your website.
PHP
55
star
10

Openbooks

An online reopository to share books. Created in the loving memory of the internet's own boy Aaron swartz, on his birthday.
HTML
49
star
11

Lychee-openshift-quickstart

OpenShift Lychee Quickstart
PHP
12
star
12

hatter

An AIML Python chat bot
Python
11
star
13

naughtychecker.js

NodeJS module to check Naughty Strings, it is a set of strings which have a high probability of causing issues when used as user-input data.
JavaScript
9
star
14

grav-openshift-quickstart

OpenShift Grav Quickstart
PHP
9
star
15

Anchor-CMS-openshift-quickstart

OpenShift Anchor CMS Quickstart
PHP
6
star
16

unijson.php

A universal PHP script to generate JSON from any MySQL database
PHP
6
star
17

Codiad-openshift-quickstart

OpenShift Codiad Web IDE Quickstart
PHP
5
star
18

homebrew-socli

Homebrew formula for the socli on macOS and linux
Ruby
3
star
19

Shell-Scripts

A collection of useful shell scripts for daily use. It will surely saves you a lots of time.
Shell
3
star
20

CodeIgniter-openshift-quickstart

OpenShift CodeIgniter Quickstart
HTML
3
star
21

ASTRA

A fully integrated workflow management system for government offices with built in queuing and complaint registration system.
JavaScript
3
star
22

profanity-finder.js

Simple profanity finding library for javascript to detect swear language.Created for nodejs.
JavaScript
3
star
23

Easy-folder-creator

Create 100s or 10000s of folders at a time. Just enter the required number of folders and the app will create it for you.
C++
2
star
24

gautamkrishnar.github.io

Personal website
HTML
2
star
25

azure-extplorer-extension

Extplorer extension for Microsoft Azure Websites
PHP
2
star
26

mac-toolkit

A set of tools to fine tune your Mac experience
Swift
1
star
27

joker

Random jokes from the best sources...
Python
1
star
28

Simple-referrer

A databaseless rerrer tracker written in javascript and php.
JavaScript
1
star
29

MSP-Resources

A repository of presentations and resources on Microsoft products for Microsoft student partners and fans
1
star
30

exobay

A self-hosted, OpenSource, Extensible API / Website performance and uptime monitoring service
HTML
1
star
31

Ensemble-16-website

Website of Ensemble 16 techno fest of Computer Science and Engg, Rajiv Gandhi Institute of Technology Kottayam
CSS
1
star
32

Christmas-Quiz

A Christmas quiz created in python
1
star
33

php-file-uploader

PHP file uploader with progress bar
PHP
1
star
34

hungrymenot

hungrymenot website
PHP
1
star
35

IEEE-Zeus-2.0

Source code of IEEE Zeus 2.0 website, Zeus is the signature event of IEEE RIT SB.
CSS
1
star
36

IEEE-Zeus-1.0

Source code of IEEE Zeus 1.0 website, Zeus is the signature event of IEEE RIT SB.
CSS
1
star
37

enquesta

Website of Enquesta 16, National level quiz competition held at Rajiv gandhi institute of technology Kottayam.
CSS
1
star
38

mozillakerala

Mozilla Kerala App
JavaScript
1
star
39

openshift-quickstart

One click quickstart to make your website online in Redhat's openshift cloud without typing a single command
PHP
1
star