Web search from the terminal. Just opens in your browser.
Usage:
s <query> [flags]
Flags:
-b, --binary string binary to launch search URI
-c, --cert string path to cert.pem for TLS
--completion string completion script for bash, zsh, fish or powershell
-h, --help help for s
-k, --key string path to key.pem for TLS
-l, --list-providers list supported providers
--list-tags list available tags
-o, --output output only mode
--port int server port (default 8080)
-p, --provider string search provider (default "presearch")
-s, --server launch web server
-t, --tag string search tag
-v, --verbose verbose mode
--version display version
Make sure that GOPATH
and GOBIN
env vars are set. Then run:
go install github.com/zquestz/s@latest
Alternatively, you can use Homebrew:
brew install s-search
Arch Linux users can install from the AUR:
yay -S s
Search for puppies on presearch.
s puppies
Search for dragonflies on google.
s -p google dragonflies
Search for a wifi router on amazon
s -p amazon wifi router
Search for rhinos on wikipedia
s -p wikipedia rhinos
Search providers tagged "video" for muppets.
s -t video muppets
We can do partial matching of provider and tag names. This searches Facebook for hamsters.
s -p fa hamsters
Or toasters on amazon.
s -p am toasters
This searches "tech-news" tagged providers for ssd info.
s -t te ssd
Or shopping sites for blankets.
s -t sh blankets
Autocompletion is supported for providers and tags. To set up autocompletion:
sudo bash -c "s --completion bash > /etc/bash_completion.d/s"
sudo bash -c "s --completion bash > /usr/local/etc/bash_completion.d/s"
Generate a _s
completion script and put it somewhere in your $fpath
:
sudo zsh -c "s --completion zsh > /usr/local/share/zsh/site-functions/_s"
s --completion fish > ~/.config/fish/completions/s.fish
(& s --completion powershell) | Out-String | Invoke-Expression
Setup an alias in your .profile
for your favorite providers.
alias sa="s -p amazon"
alias sw="s -p wikipedia"
Use w3m to find cats instead of just your default browser.
s -b w3m cats
Search for conspiracy theories in incognito mode.
s -b "chromium --incognito" conspiracy theories
s -b "firefox --private-window" conspiracy theories
Search in a specific subreddit.
s -p reddit /r/cscareerquestions best startups.
A web interface is also provided. Just pass the -s
flag.
Start a server on port 8080 (default).
s -s
Start a server with TLS on port 8443.
s -s -c /path/to/cert.pem -k /path/to/key.pem --port 8443
Feel free to try it out at https://jumps.io/.
To setup your own default configuration just create ~/.config/s/config
. The configuration file is in UCL format.
For more information about UCL visit: https://github.com/vstakhov/libucl
The following keys are supported:
- blacklist (array of providers to exclude)
- binary (binary to launch search URI)
- cert (path to cert.pem for TLS)
- customProviders (array of custom providers)
- key (path to key.pem for TLS)
- output (output only mode)
- port (server port)
- provider (search provider)
- tag (search tag)
- verbose (verbose mode)
- whitelist (array of providers to include)
Set your default provider to duckduckgo:
provider: duckduckgo
To only search a few providers:
whitelist: [google, amazon, wikipedia]
To exclude providers you don't need:
blacklist: [dumpert]
To add a custom provider:
customProviders [
{
name: example
url: "https://example.com?q=%s"
tags: [example]
}
]
Custom providers require a few things:
- An alphanumeric name.
^[a-zA-Z0-9_]*$
- A
%s
token for the query string. - A valid URL scheme.
- 500px
- 8tracks
- aliexpress
- allocine
- amazon
- archpkg
- archwiki
- ardmediathek
- arstechnica
- arxiv
- atmospherejs
- aur
- baidu
- bandcamp
- bgr
- bigbasket
- bing
- brave
- buzzfeed
- cnn
- codepen
- coursera
- cplusplus
- cppreference
- crates
- crunchyroll
- debianpkg
- dict
- diigo
- dockerhub
- dribbble
- duckduckgo
- dumpert
- ecosia
- engadget
- explainshell
- flake8rules
- flickr
- flipkart
- foursquare
- freebsdman
- freshports
- gibiru
- giphy
- gist
- github
- gmail
- go
- godoc
- goodreads
- googledocs
- hackernews
- idealo
- ietf
- ifttt
- imdb
- imgur
- kagi
- kaufda
- libgen
- lmgtfy
- macports
- magnetdl
- mdn
- medium
- metacpan
- msdn
- naver
- netflix
- nhaccuatui
- npm
- npr
- nvd
- openbsdman
- overstock
- packagist
- perplexity
- presearch
- protondb
- phandroid
- phind
- php
- postgresql
- pydoc
- pypi
- python
- quora
- qwant
- regex
- rottentomatoes
- rubygems
- shodan
- soundcloud
- spotify
- stackoverflow
- steam
- taobao
- thepiratebay
- theregister
- twitchtv
- ultimateguitar
- unity3d
- vimeo
- wikipedia
- wolframalpha
- yahoo
- yandex
- youtube
- zdf
- zhihu
- Josh Ellithorpe (zquestz)
- Christian Petersen (fnky)
- Preet Bhinder (mbhinder)
- Robert-Jan Keizer (KeizerDev)
- Vitor Cortez (vekat)
- David Liu (tw4dl)
- Lex Broner (akb)
- Diego Jara (djap96)
- Luvsandondov Lkhamsuren (lkhamsurenl)
- Eray Aydın (erayaydin)
- Murilo Santana (mvrilo)
- Jun He (knarfeh)
- Xavier Bruhiere (hackliff)
s is released under the MIT license.