npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

socli-3.8

v3.8.8

Published

stack overflow client

Downloads

5

Readme

SoCLI PyPI version Build Status Collaborizm

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 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

Updating

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

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 seporate 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 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

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 |

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

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.

Contributing

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:
git clone https://github.com/{YOUR_USERNAME}/socli.git
  1. Switch to the directory: cd socli
  2. Create your new branch: git checkout -b feature name
  3. Make necessary changes to this source code
  4. Add changes to git index by using git add --all .
  5. Commit your changes: git commit -am 'Added new feature'
  6. Push to the branch: git push
  7. Submit a new pull request :smile:

Contributors

Special thanks to these superheroes:

Bugs

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

Thanks

Sponsors

Sponsor SoCLI on Collaborizm or on Open Collective:

Liked it?

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