bing-cli
Execute Bing Search queries from the terminal including Web, News, Related Search, AutoSuggest, and Images. Images are displayed as colorized-ASCII art or as inline images directly (if using iTerm2).
Note: This project is not affiliated with Microsoft Corporation
Installation
First, install GraphicsMagick to support the image search features GraphicsMagick. In Mac OS X, you can simply use Homebrew and do:
$ brew install graphicsmagick
Then, the Bing-CLI module is installed globally via npm:
$ npm install bing-cli -g
Usage
This package is meant to be used as a command-line tool.
$ bing <search query> -c <n>$ bing image <query> -full -unsafe -c <n> -type <imageType> -size <imageSize> -bw -grey -pixels -blocks -bg <rgb>$ bing images <query> -unsafe -c <n>$ bing news$ bing news <query>$ bing related <query>$ bing suggest <query>$ bing -version
Examples
This package is meant to be used as a command-line tool.
$ bing puff the magic dragon$ bing -c 3 "sql server on linux"$ bing images famous people$ bing image yosemite -full$ bing image apple logo -size small -full -scale 05 -ascii -bw -invert$ bing image hawaii -ascii -pixels$ bing news$ bing news politics$ bing news azure aws google cloud$ bing related apache spark$ bing suggest gaussi$ bing netscaler manual fileType:pdf$ bing image homeawaycom logo -ascii -blocks -size medium -invert -scale 08
Configuration
Subscribing to APIs
Bing-CLI requires API keys from Microsoft to work at scale. There is a trial set of API keys included with limited query quota that is enough for trying it out.
Sustained usage will require that you get your API keys, you will need to sign up for Microsoft Congnitive Services by creating a new account with an email, or by signing up with your GitHub or LinkedIn account. Once you do this, you can click on the Pricing link to subscribe to a free-tier of services (more than enough for personal use) for the following APIs:
- Bing Web Search - Free
- Bing Autosuggest - Free
Setting Environment Variables
Once you subscribe to each API, you can then click the Show link to reveal the API keys. Then copy these keys and put them in the exports for the .bash_profile (as mentioned above).
export BING_SEARCH_KEY=<your key here>export BING_AUTOSUGGEST_KEY=<your key here>
Make sure to restart the shell or source .bash_profile (or other shell profile file) for the changes to take effect.
$ source ~/.bash_profile
Development
Testing
npm test
Bugs
Please report any bugs here.
Changelog
Available here.
License
MIT