Convert Figma logo to code with AI

zquestz logos

Open a web search in your terminal.

2,316
113
2,316
1

Top Related Projects

6,086

:mag: Google from the terminal

13,357

Privacy-respecting metasearch engine

🖥 📊 🕹 🛠 A curated list of command line apps

38,282

the only cheat sheet you need

Quick Overview

zquestz/s is a command-line tool for quickly searching the web from your terminal. It supports multiple search providers and allows users to open search results directly in their default browser. The tool is designed to be fast, customizable, and easy to use.

Pros

  • Supports a wide range of search providers (Google, DuckDuckGo, GitHub, Stack Overflow, and many more)
  • Customizable with the ability to add custom search providers
  • Offers a variety of output formats (text, JSON, CSV)
  • Cross-platform support (Linux, macOS, Windows)

Cons

  • Requires command-line familiarity, which may not be suitable for all users
  • Limited advanced search features compared to web-based search interfaces
  • Depends on external browsers to open search results
  • May require additional setup for some search providers

Getting Started

To install zquestz/s, you can use one of the following methods:

  1. Using Homebrew (macOS):
brew install s-search
  1. Using Go:
go install github.com/zquestz/s@latest
  1. Download a pre-built binary from the releases page.

Basic usage:

s [flags] <query>

Example searches:

s golang                    # Search for "golang" using the default provider
s -p stackoverflow golang   # Search for "golang" on Stack Overflow
s -p github zquestz/s       # Search for "zquestz/s" on GitHub

To list all available providers:

s -l

To set a custom default provider:

s -p duckduckgo

For more advanced usage and configuration options, refer to the project's README.

Competitor Comparisons

6,086

:mag: Google from the terminal

Pros of googler

  • More focused on Google search functionality, providing advanced options specific to Google
  • Supports Google News, Google Site Search, and Google Scholar
  • Offers colorized output for better readability in the terminal

Cons of googler

  • Limited to Google search only, while s supports multiple search engines
  • Requires Python installation, whereas s is a standalone binary
  • Less frequently updated compared to s

Code comparison

googler:

def fetch_results(url):
    response = urlopen(url)
    return response.read().decode('utf-8')

s:

func (e *Engine) Search(ctx context.Context, query string) (*SearchResponse, error) {
    url := e.BuildURL(query)
    return e.FetchResults(ctx, url)
}

The code snippets show basic result fetching functions. googler uses Python's urlopen, while s employs a more structured approach with Go's context and custom types.

Both projects aim to provide command-line search capabilities, but s offers a broader range of search engines and a simpler installation process. googler, on the other hand, provides more Google-specific features and a colorized output. The choice between them depends on whether you need multi-engine support or prefer Google-focused functionality.

13,357

Privacy-respecting metasearch engine

Pros of searx

  • Self-hosted and privacy-focused metasearch engine
  • Highly customizable with many configuration options
  • Supports a wide range of search engines and services

Cons of searx

  • More complex setup and maintenance
  • Requires server infrastructure to host
  • May have slower response times due to aggregating multiple sources

Code comparison

searx (Python):

results = []
for engine in engines:
    engine_results = engine.search(query)
    results.extend(engine_results)

s (Go):

func Search(query string, provider string) {
    url := fmt.Sprintf(providers[provider], url.QueryEscape(query))
    open.Run(url)
}

searx is a more comprehensive metasearch engine that aggregates results from multiple sources, while s is a simpler command-line tool for quickly opening web searches in a browser. searx offers more privacy and customization but requires more setup, whereas s is easier to use but less feature-rich.

searx is better suited for users who prioritize privacy and want a self-hosted solution with extensive customization options. s is ideal for users who want a quick and easy way to perform web searches from the command line without additional infrastructure.

🖥 📊 🕹 🛠 A curated list of command line apps

Pros of awesome-cli-apps

  • Comprehensive collection of CLI apps across various categories
  • Community-driven with regular updates and contributions
  • Serves as a valuable resource for discovering new CLI tools

Cons of awesome-cli-apps

  • Not a standalone application, just a curated list
  • Requires manual installation of individual apps
  • May include outdated or deprecated tools

Code comparison

s:

func main() {
    flags := parseFlags()
    query := strings.Join(flag.Args(), " ")
    provider := s.NewProvider(flags)
    url := provider.BuildURI(query)
    s.DisplayURL(url)
    s.OpenURI(url)
}

awesome-cli-apps:

## Entertainment

- [football-cli](https://github.com/ManrajGrover/football-cli) - Get live scores, fixtures, standings of almost every football competition/league.
- [pockyt](https://github.com/achembarpu/pockyt) - Read, manage, and automate your [Pocket](https://getpocket.com) collection.
- [newsboat](https://github.com/newsboat/newsboat) - An RSS/Atom feed reader for the text console.

Summary

s is a command-line tool for quick web searches, while awesome-cli-apps is a curated list of CLI applications. s provides a specific functionality, whereas awesome-cli-apps offers a wide range of tools for various purposes. s is more focused and requires less setup, while awesome-cli-apps provides a broader selection but requires individual app installations.

38,282

the only cheat sheet you need

Pros of cheat.sh

  • Provides a vast collection of cheat sheets and code snippets for various programming languages and tools
  • Offers a command-line interface and a web-based interface for easy access
  • Supports multiple output formats, including plain text, colorized output, and syntax highlighting

Cons of cheat.sh

  • Limited to providing pre-defined cheat sheets and snippets
  • May not always have the most up-to-date information for rapidly evolving technologies

Code comparison

cheat.sh:

curl cheat.sh/python/list

s:

s python list

Key differences

  • cheat.sh focuses on providing quick access to cheat sheets and code snippets
  • s is a command-line search utility that queries various search engines and websites
  • cheat.sh is more specialized for programming-related queries, while s offers broader search capabilities
  • s allows users to customize search providers and open results in a web browser
  • cheat.sh provides more detailed and curated information for specific programming topics

Both tools serve different purposes: cheat.sh is ideal for quick programming reference, while s is better suited for general web searches from the command line.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

s

License ReportCard Build Release

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

Install

go get -v github.com/zquestz/s
cd $GOPATH/src/github.com/zquestz/s
make
make install

Alternatively, you can use Homebrew:

brew install s-search

Examples

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

Provider/Tag Expansion

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

Provider/Tag Autocompletion

Autocompletion is supported for providers and tags. To set up autocompletion:

Bash Linux

s --completion bash > /etc/bash_completion.d/s

Bash MacOS

s --completion bash > /usr/local/etc/bash_completion.d/s

Zsh

Generate a _s completion script and put it somewhere in your $fpath:

s --completion zsh > /usr/local/share/zsh/site-functions/_s

Fish

s --completion fish > ~/.config/fish/completions/s.fish

Powershell

(& s --completion powershell) | Out-String | Invoke-Expression

Advanced

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.

Server Mode

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

Configuration

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: "http://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.

Supported Providers

  • 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
  • facebook
  • flake8rules
  • flickr
  • flipkart
  • foursquare
  • freebsdman
  • freshports
  • gibiru
  • giphy
  • gist
  • github
  • gmail
  • go
  • godoc
  • goodreads
  • google
  • googledocs
  • hackernews
  • idealo
  • ietf
  • ifttt
  • imdb
  • imgur
  • instagram
  • kagi
  • kaufda
  • libgen
  • linkedin
  • lmgtfy
  • macports
  • magnetdl
  • mdn
  • medium
  • metacpan
  • msdn
  • naver
  • netflix
  • nhaccuatui
  • npm
  • npr
  • nvd
  • openbsdman
  • overstock
  • packagist
  • perplexity
  • presearch
  • protondb
  • phandroid
  • phind
  • php
  • pinterest
  • postgresql
  • pydoc
  • pypi
  • python
  • quora
  • qwant
  • reddit
  • regex
  • rottentomatoes
  • rubygems
  • shodan
  • soundcloud
  • spotify
  • stackoverflow
  • steam
  • taobao
  • thepiratebay
  • theregister
  • twitchtv
  • twitter
  • ultimateguitar
  • unity3d
  • vimeo
  • wikipedia
  • wolframalpha
  • yahoo
  • yandex
  • youtube
  • zdf
  • zhihu

Contributors

License

s is released under the MIT license.