yanosea / jrp

'jrp' is the CLI tool to generate Japanese random phrase(s).
MIT License
2 stars 0 forks source link
![golangci-lint](https://github.com/yanosea/jrp/actions/workflows/golangci-lint.yml/badge.svg) ![release](https://github.com/yanosea/jrp/actions/workflows/release.yml/badge.svg)
# 🎲 jrp ![Language:Go](https://img.shields.io/static/v1?label=Language&message=Go&color=blue&style=flat-square) ![License:MIT](https://img.shields.io/static/v1?label=License&message=MIT&color=blue&style=flat-square) [![Latest Release](https://img.shields.io/github/v/release/yanosea/jrp?style=flat-square)](https://github.com/yanosea/jrp/releases/latest)
[Coverage Report](https://yanosea.github.io/jrp/coverage.html)
![demo](docs/demo.gif "demo")

ℹ️ About

jrp is the CLI tool to generate Japanese random phrase(s). (It's jokeey tool!)
You can save the generated phrase(s) to the history and manage them.
Also, you can save the generated phrase(s) to the favorite and manage them.

This tool uses WordNet Japan sqlite database file.

πŸ’» Usage

Usage:
  jrp [flags]
  jrp [command]

Available Subcommands:
  download, dl,   d  πŸ“¦ Download WordNet Japan sqlite database file from the official web site.
  generate, gen,  g  ✨ Generate Japanese random phrase(s). You can abbreviate "generate" sub command. ("jrp" and "jrp generate" are the same.)
  history,  hist, h  πŸ“œ Manage the history of the "generate" command.
  favorite, fav,  f  ⭐ Manage the favorited phrase(s) of the history of "generate" command.
  help               🀝 Help for jrp.
  completion         πŸ”§ Generate the autocompletion script for the specified shell.
  version            πŸ”– Show the version of jrp.

Flags:
  -n, --number   πŸ”’ number of phrases to generate (default 1, e.g: 10)
  -p  --prefix   πŸ’¬ prefix of phrase(s) to generate
  -s  --suffix   πŸ’¬ suffix of phrase(s) to generate
  -d  --dry-run  πŸ§ͺ generate phrase(s) without saving to the history
  -P, --plain    πŸ“ plain text output instead of table output
  -h, --help     🀝 help for jrp
  -v, --version  πŸ”– version for jrp

Arguments:
  number  πŸ”’ number of phrases to generate (e.g: 10)

🌍 Environments

πŸ“ Directory to store WordNet Japan sqlite database file

Default : $XDG_DATA_HOME/jrp or $HOME/.local/share/jrp

export JRP_WNJPN_DB_FILE_DIR=/path/to/your/directory

πŸ“ Directory to store jrp sqlite database file

Default : $XDG_DATA_HOME/jrp or $HOME/.local/share/jrp

export JRP_DB_FILE_DIR=/path/to/your/directory

πŸ”§ Installation

🐭 Using go

go install github.com/yanosea/jrp@latest

🍺 Using homebrew

brew tap yanosea/tap
brew install yanosea/tap/jrp

πŸ“¦ Download from release

Go to the Releases and download the latest binary for your platform.

✨ Update

🐭 Using go

reinstall jrp!

go install github.com/yanosea/jrp@latest

🍺 Using homebrew

brew update
brew upgrade jrp

πŸ“¦ Download from release

Download the latest binary from the Releases page and replace the old binary in your $PATH.

🧹 Uninstallation

πŸ”§ Uninstall jrp

🐭 Using go

rm $GOPATH/bin/jrp
sudo rm -fr $GOPATH/pkg/mod/github.com/yanosea/jrp@*

🍺 Using homebrew

brew uninstall jrp
brew untap yanosea/tap/jrp

πŸ“¦ Download from release

Remove the binary you downloaded and placed in your $PATH.

πŸ—‘οΈ Remove data files

If you've set jrp envs, please replace $HOME/.local/share/jrp with envs you've set.
These below commands are in the case of default. Ofcourse you can remove whole the directory.

πŸ’Ύ Remove WordNet Japan sqlite database file

rm $HOME/.local/share/jrp/wnjpn.db

πŸ’Ύ Remove jrp sqlite database file

rm $HOME/.local/share/jrp/jrp.db

πŸ“ƒ License

πŸ”“MIT

πŸ–ŠοΈ Author

🏹 yanosea

πŸ”₯ Motivation

I love the smart phone application PhrasePlus!
I wanted to run an application with equivalent functionality to this in the terminal, so I created it!

🀝 Contributing

Feel free to point me in the right directionπŸ™