Search anything on Wikipedia from your terminal.
This is a experimental project written in Deno version 1.8.0, with std
version 0.89.0. Some feature might be unstable at the moment.
- Get a Wikipedia page
- Display a random Wikipedia page
- Search in different languages
You can install the executable directly from GitHub.
deno install --unstable --allow-net --allow-run --allow-env --allow-read --allow-write -n wiki-cli https://raw.githubusercontent.com/icelam/deno-wikipedia-cli/master/src/mod.ts
Run wiki-cli
in your terminal followed by any of the option flags.
A list of valid Wikipedia language codes is available at https://commons.wikimedia.org/w/api.php?action=sitematrix&smtype=language&smlangprop=code&format=json.
Usage:
wiki-cli [options]
Options:
-h, --help Show help and all available options
-c, --config Modify default behavior of wiki-cli, currently support saving default language to be used in search
-l, --language [WIKI_LANGUAGE_CODE] Temporary set the target language to be used in search, accepts a Wikipedia language code
-q, --query [KEYWORD] Pre-define the keyword used in search
-r, --random Display a random Wikipedia page
You can run this app locally using the following command:
make dev
You can run test cases using the following command:
make test
You can update the lock file by running the following command:
make lock-deps
Change log is available here. You can update the change log by running the following command:
make release
A Github workflow has been set to automatically create release when vX.X.X
tag is pushed.
- Implement logging, might introduce something like log4deno?
- Use Import Maps for better maniaging dependencies' version
- Permission detection without using
--unstable
flag - Get terminal size without using
--unstable
flag -
Better way to organize test suits, might consider using Rhum?
- Limit or revoke the permission when it is not needed (e.g. search flow does not need write permission, read permission is not needed after getting config file, net is not needed for config flow). But need to test if installed excutable would be affected on next run.
- Good reference for test cases