DeepEye a CLI that simply help you make search queries through files quickly using plain text or regex expressions, while having detailed output about it. The project meant to be simple and HELPFUL
If you visited this repo., will be nice if you leave a ⭐️ means a lot :)
Suggestions and helps are welcome.
➜ deepeye -h
DeepEye: a CLI that will allow you to run advanced search queries
through multipe text files, while having customized + detailed output.
The "deepeye" program was mainly focused on helping terminal users,
to quickly search in files in both plain text and regex queries.
Willing to contribute? : "https://github.com/aallali/deepeye/"
Author: Abdellah Allali <hi@allali.me>
Birth: 24/05/2023
First release: 30/05/2023
Usage:
deepeye <filename> [flags]
Flags:
-c, --clean choose to clean output in case you want to store in file. default:false
-h, --help help for deepeye
-k, --keyword string Keyword to match in file.
-l, --lines int limit number of lines to output. (default 10)
--range int the range of characters around the match to print. default:0
-r, --regex string regex expression to match in file.
-s, --silent if you want to silent the comand, only resume will be printed. default:false
-u, --update check for updates. default:false
-v, --version output the current installed version of DeepEye CLI. default:false
➜ deepeye -v
DeepEye v0.0.2
➜ deepeye -u
Checking ...
You are running the latest version of DeepEye: 0.0.2
- products_sample.csv a simple file with dummy data of random products (+14k lines).
- search for all EAN numbers in the csv file which is 12-13 number (universal format)
deepeye ./products_sample.csv -r="[0-9]{12,13}"
(all the found 14815 are printed to console here, just cut last part here)
(the prefix {L:14...}
tell the line number where the match has been found in file)
- same previous query but print 10 characters around the match (margin 10 characters) using --range flag
deepeye ./products_sample.csv -r="[0-9]{12,13}" --range=10
- same previous query but print full line of match using --range=-1 flag
deepeye ./products_sample.csv -r="[0-9]{12,13}" --range=-1
- same previous query but without printing the matched results using the silent flag
-s
deepeye ./products_sample.csv -r="[0-9]{12,13}" -s
(only stats are printed)
- search for this random ean and print the full line, as it shows here, this product exists in row number : 14808
deepeye ./products_sample.csv -k="book" --range=-1
- ✅ search with text keyword
- ✅ search with regex expression
- ✅ add option to choose output : full line of match OR match with N chars range around it (
flag:--range
) - ✅ add option to limit number of lines to output. (#8)
- ⏳ make the auto update functionality
- ✅ write installer script (need improvements)
- ⏳ add queries history option (pick already used queries)
- ✅ add --clean option to clean the output (matched value only) in case want to write them to file directly from terminal
./deepeye ... > output.txt
(#PR-6)
✅ = Ready to use ⏳ = In progress
-
🚨 write unit tests! (20%)
-
⏳ make real fix to use case of
SpotAndMargin(...)
in Regex option to prevent it from running over unmatched regex but same keyword. (issue:5) -
✅ fix returning all lines when using option --range=-1 (issue:8)
🚨 = Urgent
flag/args | default | accepted values | description |
---|---|---|---|
path/to/file | required as first argument | valid file path | path the file to search in |
-k --keyword |
required ( if -r not present ) |
string | if you want to search with a static keyword, e.g: -k=";1337;" |
-r --regex |
required ( if -k not present ) |
regex expression | if you want to search with a regex expression , e.g: -r="(?<=;)[0-9]+(?=;)" |
-s --silent |
false |
boolean | if you want to print the statistics of result only, without matched lines |
--range |
0 |
number ( positive or -1 ) |
the range of characters desired to print around the match (margin), 0 : print only the matched string x : print x characters on the left and right of matched string-1 : print full line |
-l --lines |
10 | number ( positive or -1 ) |
limit number of lines to output |
-c --clean |
false | boolean | choose to clean output in case you want to store in file |
-h --help |
false | boolean | print the help guide to use the command |
-v --version |
false | boolean | print installed version of DeepEye |
-u --update |
false | boolean | check for any available updates |
- run the command :
or clone the clone and compile it yourself.
wget -qO- https://github.com/aallali/DeepEye/raw/main/install.sh | sudo bash
MIT License