Package: howdoi
howdoiInstant coding answers via the command line⚡ Never open your browser to look for help again ⚡Introduction to howdoiAre you a hack programmer? Do you find yourself constantly Googling for
how to do basic programming tasks?Suppose you want to know how to format a date in bash. Why open your
browser and read through blogs (risking major distraction) when you can
simply stay in the console and ask howdoi:$ howdoi format date bash
> DATE=`date +%Y-%m-%d`howdoi will answer all sorts of queries:$ howdoi print stack trace python
> import traceback
>
> try:
>     1/0
> except:
>     print '>>> traceback <<<'
>     traceback.print_exc()
>     print '>>> end of traceback <<<'
> traceback.print_exc()

$ howdoi convert mp4 to animated gif
> video=/path/to/video.avi
> outdir=/path/to/output.gif
> mplayer "$video" \
>         -ao null \
>         -ss "00:01:00" \  # starting point
>         -endpos 10 \ # duration in second
>         -vo gif89a:fps=13:output=$outdir \
>         -vf scale=240:180

$ howdoi create tar archive
> tar -cf backup.tar --exclude "www/subf3" wwwInstallationpip install howdoiUsageNew to howdoi?howdoi howdoiRTFMIntroduction and
installationUsageContributing to
howdoiAdvanced
usageTroubleshootingCommandsusage: howdoi [-h] [-p POS] [-n NUM] [-a] [-l] [-c] [-x] [-C] [-j] [-v] [-e [ENGINE]]
[--save] [--view] [--remove] [--empty] [QUERY ...]

instant coding answers via the command line

positional arguments:
  QUERY                 the question to answer

optional arguments:
  -h, --help            show this help message and exit
  -p POS, --pos POS     select answer in specified position (default: 1)
  -n NUM, --num NUM     number of answers to return (default: 1)
  -a, --all             display the full text of the answer
  -l, --link            display only the answer link
  -c, --color           enable colorized output
  -x, --explain         explain how answer was chosen
  -C, --clear-cache     clear the cache
  -j, --json            return answers in raw json format
  -v, --version         display the current version of howdoi
  -e [ENGINE], --engine [ENGINE]
                        search engine for this query (google, bing, duckduckgo)
  --save, --stash       stash a howdoi answer
  --view                view your stash
  --remove              remove an entry in your stash
  --empty               empty your stash

environment variable examples:
  HOWDOI_COLORIZE=1
  HOWDOI_DISABLE_CACHE=1
  HOWDOI_DISABLE_SSL=1
  HOWDOI_SEARCH_ENGINE=google
  HOWDOI_URL=serverfault.comUsing the howdoi stashing feature (for more advanced features view thekeep documentation).stashing: howdoi --save QUERY
viewing:  howdoi --view
removing: howdoi --remove (will be prompted which answer to delete)
emptying: howdoi --empty (empties entire stash, will be prompted to confirm)As a shortcut, if you commonly use the same parameters each time and
don't want to type them, add something similar to your .bash_profile
(or otherwise). This example gives you 5 colored results each time.alias h='function hdi(){ howdoi $* -c -n 5; }; hdi'And then to run it from the command line simply type:$ h format date bashYou can also search otherStackExchange
propertiesfor answers:HOWDOI_URL=cooking.stackexchange.com howdoi make pestoor as an alias:alias hcook='function hcook(){ HOWDOI_URL=cooking.stackexchange.com howdoi $* ; }; hcook'
hcook make pestoOther useful aliases:alias hless='function hdi(){ howdoi $* -c | less --raw-control-chars --quit-if-one-screen --no-init; }; hdi'ContributorsBenjamin Gleitzman (@gleitz)Yanlam Ko (@YKo20010)Diana Arreola (@diarreola)Eyitayo Ogunbiyi (@tayoogunbiyi)Chris Nguyen (@chrisngyn)Shageldi Ovezov (@ovezovs)Mwiza Simbeye
(@mwizasimbeye11)Shantanu Verma (@SaurusXI)Sheza Munir (@ShezaMunir)Jyoti Bisht (@joeyouss)Andmore!How to contributeWe welcome contributions that make howdoi better and improve the
existing functionalities of the project. We have created a separateguide to contributing to
howdoithat explains
how to get up and running with your first pull request.NotesWorks with Python 3.5 and newer. Unfortunately Python 2.7 support
has been discontinued :(There is aGUI that wraps
howdoiThere is aFlask webapp that wraps
howdoiAnAlfred Workflowfor howdoiSlack integration available throughslack-howdoiTelegram integration available throughhowdoi-telegramSpecial thanks to Rich Jones
(@miserlou) for the ideaMore thanks toBen Bronsteinfor the
logoVisual Studio Code Extension InstallationHead over to theMarketPlaceto install the extension.News2.0.20Update dependency versionsAdd support for Python 3.102.0.19Fix typo2.0.18Fixed issue with howdoi cache where cache misses would be printed to the console2.0.17New documentation and mkdocsFixed issue with how howdoi chooses the proper search engine (command line flags now override environment variables)Added a search engine fallback if one of the search engines failsFixed issue with howdoi cache2.0.16Fix GDPR issue for those using howdoi in countries outside the USBetter support for usingHOWDOI_URL2.0.15Add explainability with-xor--explainoptionsBetter error checking for when search engines block queriesUsing improved DuckDuckGo endpointAnswer pages now fetched in parallel for speed improvement2.0.14Fix a number of bugs by switching from parsing Google links to looking for URLs instead2.0.13More permanent fix for extracting Google links2.0.12Hotfix for Google link formatting2.0.11Hotfix for Google link formatting2.0.10Hotfix for new Google classnamesSeparate requirements.txt files for prod and dev2.0.9Cleaner command line options that also include environment variablesREADME updates2.0.8Fix issue for answers that have no code in the answer but code in the commentsAdd range checks for -n and -p flagsMoved from Travis to Github ActionsDropped Python 2.7 support2.0.7Update for new Google CSS style2.0.6Fix issue where-awould not return a proper response due to updated CSS on StackOverflow2.0.5New logo and colors!2.0.4Cachelib rollback to support Python 2.7Better error message when Google is being blocked (for example in China)2.0.3Bring back Python 2.7 support (for now)2.0.2Fixed keep support for stashing and viewing answers2.0.1Added JSON output with the -j flag (great for consuming howdoi results for use in other apps)Added stashing ability for saving useful answer for later (based onhttps://github.com/OrkoHunter/keep)Added caching for tests to prevent being rate limited by Google while developingAdded easier method for calling howdoi when imported (howdoi.howdoi)1.2.1Fix dependency issue1.2.0Massive speed improvements of startup, answer fetching, and cachingCommand line flags for alternate search enginesRemove duplicate answers1.1.14Links displayed with markdown syntaxImproved performance and caching (again)1.1.13Improved performance and cachingMore friendly answer displayAdded support for Python 3.6Removed support for Python 2.61.1.12Add additional search engine support1.1.11Fix issue with UTF-8 encoding1.1.10Include the link in output when asking for >1 answerCompatibility with linuxbrew1.1.9Fix issue with upload to PyPI1.1.8Fix colorization when HOWDOI_COLORIZE env variable is enabledFix certificate validation when SSL disabled1.1.7Add Localization support with HOWDOI_LOCALIZATION env variable (Currently only pt-br and en)1.1.6Updates for Python3Updates for caching1.1.5Updates for Python3Fix issues with cacheAllow disabling SSL when accessing Google1.1.4Added caching1.1.3Added fix to handle change in Google search page HTMLUpdated Travis CI tests1.1.2Compatibility fixes for Python3.2Travis CI tests now being run for Python 2.6, 2.7, 3.2, and 3.31.1.1Added message when question has no answer1.1Added multiple answers with -n/--num-answers flagAdded colorized output with -c/--color flagAdded answer link to the bottom of questions with -a/--all flagUnit tests now managed through Travis CI1.0Added support for Python3Switched to the requests library instead of urllib2Project status changed to Production/StableAdded troubleshooting steps to the README0.2Added sane flagsNow using/usr/bin/env pythoninstead of/usr/bin/pythonUpdated README for brew installation instructions0.1.2Added Windows executableUpdated README for pip installation instructions0.1.1Added to PyPI0.1We're doing it live!