Skip to content

Search anything on Wikipedia from your terminal. An experimental project written in Deno. (Deno version 1.2.2, std version 0.63.0) 🦕

License

Notifications You must be signed in to change notification settings

icelam/deno-wikipedia-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deno Wikipedia CLI

Deno Wikipedia CLI

Search anything on Wikipedia from your terminal.

Made with Deno Built with TypeScript License Unit test Language grade: JavaScript Current version

Important Notes

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.

Features

  • Get a Wikipedia page
  • Display a random Wikipedia page
  • Search in different languages

Installation

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

Usage

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

Preview

Development

You can run this app locally using the following command:

make dev

Tests

You can run test cases using the following command:

make test

Update lock file

You can update the lock file by running the following command:

make lock-deps

Change Log / Release

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.

Roadmap

  • 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?

Others

  • 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

About

Search anything on Wikipedia from your terminal. An experimental project written in Deno. (Deno version 1.2.2, std version 0.63.0) 🦕

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published