Falion
An open source, programmed in rust, privacy focused tool for reading programming resources (like StackOverFlow) fast, efficient and asynchronous from the terminal.
Report Bug | Request Feature
Table of Contents
About The Project
An open source, programmed in rust, privacy focused tool for reading programming resources (like StackOverFlow) fast, efficient and asynchronous from the terminal. By the time the results appear most of the pages are fully loaded, meaning when going through them you don't have to await for the page to load like in a browser, it just loads instantly, and the pages are parsed in way to make it easier to view them from the terminal. All the searches are done through DuckDuckGo (only through HTTPs), and the requests to the respective pages are done only for getting the html of it and nothing else, making this tool a privacy focused one. For a demo just watch the video under here, and for information about the key binds go to key binds
Supported programming sources:
These are generic resources and work for most languages, in the future i may add language specific ones, but for now this is what I am focusing on. More will come.
- StackOverFlow don't think I need to say anything about it.
- StackExchange a q&a forum like StackOverFlow that grabs questions and answers from over 170 sources.
- Github Gists here code snippets and guides are posted in form of like a file list.
- GeeksForGeeks can find various good resources on programming and other computer related things.
- DuckDuckGo Results as a last resort in case none of the above resources work for you (it's like 20+ of each on every search), you can get the basic sites you get on search and view them, tho it's not gonna be as nicely printed, but still readable so you don't have to leave the terminal
Video showcase
falion2.mp4
Built with
The stock libraries and these awesome 3rd party ones:
- reqwest for making all the HTTPs requests.
- tokio for making requests asynchronously.
- regex for scraping information about pages, like getting urls etc.
- urlencoding for encoding the query in order to be URL compliant.
- futures for handling the asynchronous tasks.
- colored for easily colorizing the terminal output.
- crossterm for manipulating the terminal, like getting key inputs, clearing it and others.
- html2text for converting html to readable text in order to display pages in terminal better.
- url for parsing strings to an URL object for easier and safer manipulation.
- indexmap for having an object Hash Map like that supports indexing.
- argparse to easily handle command line arguments.
Getting Started
Running The Program
Install with cargo
This method will work across most (if not all) Linux distributions supporting cargo, and other operating systems that support rust and cargo (I only tested on Linux).
- Install rust, cargo and all it's things using the official rustup installer
- Run the following command in your terminal of choice:
cargo install falion
- Make sure you have .cargo/bin in path, you would need to add the following line in your terminal RC file (e.g $HOME/.zshrc)
export PATH=$HOME/.cargo/bin:$PATH
On windows it should work automatically (restart if just installed), if not you can follow this guide for how to add something to path. The cargo bin folder will be {your-user-folder}\.cargo\bin
- In order to update run the install command again, and you can now follow usage for more information on how to use it.
Install from AUR
a. Using yay or any other AUR helper
yay -Sy falion-bin
b. Manually cloning and building it from AUR
- First install the basic build dependencies, if you don't already have them:
sudo pacman -Sy gcc base-devel --needed
- Then clone the build script
git clone https://aur.archlinux.org/falion-bin.git
- Cd into the new cloned repository and run the following to build the package
makepkg
- In order to install the package run the following (where * is just an any other characters place holder)
sudo pacman -U falion-bin-*.pkg.tar.zst
Install from provided binaries
a. For Arch Linux based distros (not recommended, use AUR in order to have auto updates as well)
- Download from the releases tab from the version you want (latest stable recommended), the file named like falion-bin-*.pkg.tar.zst
- From where you downloaded it run the following command in your terminal of choice (where * is just an any other characters place holder):
sudo pacman -U falion-bin-*.pkg.tar.zst
b. For Debian based distros (I'm working on a PPA, for now I recommended you use the cargo version instead)
- Download from the releases tab from the version you want (latest stable recommended), the file named like falion_*_debian_amd64.deb
- From where you downloaded it run the following command in your terminal of choice (where * is just an any other characters place holder):
sudo dpkg -i falion_*_debian_amd64.deb
Manually
Placing the executable somewhere than adding it to path. (Not recommended, installing it with cargo is better)
- Either follow compilation and build it for the platform of your choice or download from the releases tab the prebuilt Linux binary, called "falion"
- Copy the falion executable to a location you want (it will have to stay there), usually in Linux you would create a folder in /opt called falion and put the executable there, or you can place anywhere else in the home dir.
- On Linux modify your .zshrc / .bashrc / .fishrc , the hell you use, and add this line to it: (without quotation marks) "alias falion=your/path". On windows you will have to modify your path variable, here is a guide. And on Mac same as Linux.
- After you are done, you should be able to just type "falion" in terminal and you should see something pop up, saying you didn't input any query and directing you to run falion -h.
Compilation
This program only uses cross platform libraries, but I have problems compiling it for windows from Linux, when I have time I will spin up a VM to see if it compiles in windows (on MacOS it should like 99.99% compile without problems). The following steps require that you have rust installed, check their official installation page.
- Clone this repo on your PC, you can use "git clone", if you have git installed, like this:
git clone https://github.com/Obscurely/falion.git
Otherwise in the right up side of the repo page you will see a download button, download the repo as zip and extract it in a folder
- Open a new terminal/cmd window in the folder you extracted the repo in, if you can't right click on the folder and open it there do:
cd the/path
and you will get there.
- From there run this compile command in the terminal:
cargo build --release
It will take a bit depending on your system because of executable size optimizations, but be patient.
- Done, navigate to target/release and grab only the "falion" file from there. Now you can follow manually install
Usage
Basics
- First you would have to get it installed and in path, follow this, after you can continue.
- Then from the terminal (regardless of the os) you can use it by running these commands. For getting help about the program
falion -h
For getting a list of the key binds, also available on this README at key binds
falion -k
For doing a search
falion rust how to print
Or if you want to do a search and see all the warnings (like parsing problems of text etc) run it in verbose mode
falion -v rust how to print
Key binds
Key Binds list for falion!
Note: where '..' is used it means from that to that like '1..5' would mean from 1 to 5.
Main menu:
[1..5] = Access that resource.
SHIFT + [1..5] = Go to the next element in the list of that resource.
ALT + [1..5] = Go to the previous element in the list of that resource.
CTRL + n = Move to the next element in the list of every resource.
CTRL + b = Move back to the previous element in the list of every resource.
CTRL + c = Clear terminal and exit.
Sub menus for the resources:
CTRL + n = Move to the next element in the content list (like questions & answers).
CTRL + b = Move back to the previous element in the content list.
CTRL + q = Go back to the main menu.
CTRL + c = Clear terminal and exit.
These were all the key binds, enjoy using Falion!
Road Map
Adding more generic resources, but also maybe add lanaguage related one that get enabled based on the first word in the query. And also just improve it in general.
Contributing
Edit a file you want, do a pull request, I will look at it and if the change makes sense and is a good one I will accept it and that's it.
License
Is under GPL-3.0 so stick to the license conditions and have fun :)
Contact
Either post an issue in the Issues Tab or contact me at this email adddress if you have more to say: [email protected]