• Stars
    star
    1,320
  • Rank 35,625 (Top 0.8 %)
  • Language
    Shell
  • License
    GNU General Publi...
  • Created almost 4 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tuxi is a cli assistant. Get answers of your questions instantly.

TUXI

A CLI tool that scrapes Google search results and SERPs that provides instant and concise answers

Video Preview Gif

How does this work?

The script uses pup to scrape Google search results and SERPs. If the query returns several results, Tuxi will choose the most relevant result on the basis of priority.

In addition to scraping, tuxi also uses jq, awk and sed to process and return results, and recode to unescape html.

Watch this video for more info

Also checkout BugsWriter's YouTube channel for more scripts like this.

Requirements

  • pup - CLI tool for processing HTML.
  • recode - Charset converter tool and library.
  • jq - Command-line JSON processor.

Installation

cURL

cURL tuxi to your $PATH and give execute permissions.

$ sudo curl -sL "https://raw.githubusercontent.com/Bugswriter/tuxi/main/tuxi" -o /usr/local/bin/tuxi
$ sudo chmod +x /usr/local/bin/tuxi

To update, just do curl again, no need to chmod anymore.
To uninstall, simply remove tuxi from your $PATH, for example sudo rm -f /usr/local/bin/tuxi.

Make

$ git clone https://github.com/Bugswriter/tuxi.git && cd tuxi/
$ sudo make install

To update, just git pull on your local tuxi repository and reinstall with sudo make install.
To uninstall, simply run sudo make uninstall.

Arch Linux AUR

Tuxi is available as the tuxi-git package in the AUR.

$ yay -S tuxi-git

Usage

$ tuxi "Is Linux better than Windows?"
---
Linux has a reputation for being fast and smooth while
Windows 10 is known to become slow and slow over
time. Linux runs faster than Windows 8.1 and Windows 10
along with a modern desktop environment and qualities of the
operating system while windows are slow on older hardware.
---
  • Quotations are optional, but should be used if you want to search with special characters (?=!|&<>%$#/\).
  • You can also write your query as a statement, e.g: tuxi linus torvalds birthday.
  • The -r option will make the output not have formatting, which can be convenient for use in scripts.
  • The -q option silences "Did you mean?" and Tuxi's greeting on calling tuxi.

Use -h to display the help message.

Usage: tuxi [options] query
OR: query source | tuxi [options]

Options:
  -h                    Show this help message and exit.
  -v                    Print tuxi version info and exit.

  -r                    Raw search results.
                        (no pretty output, no colors)

  -q                    Only output search results.
                        (silences "Did you mean?", greeting, usage)

  -a                    Prints all valid answers.

  -u                    Prints out the top handful of URLs for your search query
                        (this is automatically printed out if tuxi can't find you an answer)

  -b                    Tries to select the best answer based on keywords at the start and end of your query.
                        (experimental - eg: define WORD, SONG lyrics, PERSON quotes, weather CITY, FILM cast)

  -t                    Pick answers to test.
                        (you can specify multiple answers using tuxi_NAME in your query)

  -l                    use LANG_[lang] in your query to override the language used
                        (eg: tuxi -l LANG_en_US my search query)

tuxi supports the following environment variables:
  TUXI_LANG=[lang]      sets default search language (eg: TUXI_LANG='en_US')

  TUXI_DELAY=[int]      if you find more than one answer is being printed (and you're not using -a)
                        increase this number by a little (you want it to be as low as possible)
                        default value is 250 (eg: TUXI_DELAY=270)

developer flags:
  -d                    prints debug info along with results
  -s                    saves HTML for this query to /home/dave/.cache/tuxi/[date]-[query].html

  -c                    use most recent cached result and query
                        this can be combined with -t flag to more quickly test for different answers

  -p                    disable pipe support (it can break some scripts including our own test script)

Report bugs at https://github.com/Bugswriter/tuxi/issues

Features

Easily change query language
Line 8 in tuxi contains the language variable which can be changed according the user's preference. However, tuxi will use the system default langauge if none is set.

Gives corrections

$ tuxi linux torvalds birthday
> Did you mean linus?
---
28 December 1969
---

When you know it's actually linux torvalds -q option

$ tuxi -q linux torvalds birthday
---
28 December 1969
---

Raw formatting for output (no colors) -r option

Useful for e.g scripting notify-send.

$ tuxi -r linux torvalds birthday
> Did you mean linus?
28 December 1969

Math operations

$ tuxi "log(30)"
---
1.4771212547196624
---

Translate

$ tuxi "I love you in japanese"
---
γ‚γŸγ—γ―γ€γ‚γͺγŸγ‚’ζ„›γ—γ¦γ„γΎγ™
---
$ tuxi "γ‚γŸγ—γ―γ€γ‚γͺγŸγ‚’ζ„›γ—γ¦γ„γΎγ™ in english"
---
I love you
---

And much more (lyrics, weather, conversions...)

License

This project is licensed under GPL-3.0.

Contributing

If you want to contribute, please see CONTRIBUTING.

More Repositories

1

notflix

Notflix is a shell script to search and stream torrent.
Shell
1,891
star
2

redyt

Search reddit with CLI
Shell
120
star
3

arch-linux-magic

Shell
91
star
4

myyt

Script I wrote to search youtube with command line easily.
Shell
83
star
5

pirokit

Shell
77
star
6

music_fairy

Simple voice assistant for playing any song/music
Shell
40
star
7

dotfiles

Lua
37
star
8

BugsWritersEmacs

This is my personal emacs config. I Love Emacs.
Emacs Lisp
34
star
9

.emacs.d

Emacs Lisp
22
star
10

blog

My personal blog app (written in flask)
Python
10
star
11

dwmblocks

C
10
star
12

dwm

C
8
star
13

gcontacts-alternative

JavaScript
7
star
14

website

HTML
5
star
15

lookbook

The search engine for all book in SRMS Library. Follow us for more content!
CSS
4
star
16

bugsnavi

3
star
17

corona-death-update

Sasti Siri is a voice program. She tell you how many people died due to corona.
Python
3
star
18

ffmagic

Python
3
star
19

zola-journal-template

HTML
3
star
20

excel-table-creator

A python script for creating excel table without using excel easily.
Python
3
star
21

paid-detector

Python
3
star
22

hyprdots

2
star
23

amptest

2
star
24

iiser-poc

HTML
2
star
25

op-server-scripts

Shell
2
star
26

fooddish

2
star
27

virtual-automation-of-self-driving-car

Python
2
star
28

contact-app

Vue
2
star
29

bulk-compressor

Python
2
star
30

simple-base64-upload

HTML
1
star
31

vuelocker

Vue
1
star
32

metawood

1
star
33

ecomsite

HTML
1
star
34

bugswriter-dot-com

CSS
1
star
35

alexa-api

Python
1
star
36

getwall

1
star
37

zest-website

JavaScript
1
star
38

project-report

TeX
1
star
39

bipolar-assignment

Python
1
star
40

milapi

Python
1
star
41

pve2influx

Python
1
star
42

offerclub

Python
1
star
43

Bugswriter

1
star
44

test

Processing
1
star
45

cook50

Cook50 is a virtual cookbook.
Python
1
star
46

speed-test

JavaScript
1
star