jrp
generates Japanese random phrases.
This tool uses WordNet Japan sqlite database file.
You can generate and save the generated phrases to the history and manage them via the CLI.
Also, you can favorite the generated phrases and manage them.
Available Subcommands:
download, dl, d π¦ Download WordNet Japan sqlite database file from the official web site.
generate, gen, g β¨ Generate Japanese random phrases.
You can abbreviate "generate" sub command. ("jrp" and "jrp generate" are the same.)
interactive, int, i π¬ Generate Japanese random phrases interactively.
history, hist, h π Manage the histories of the "generate" command.
favorite, fav, f β Favorite the histories of the "generate" command.
unfavorite, unf, u β Unfavorite the favorited histories of the "generate" command.
completion comp, c π§ Generate the autocompletion script for the specified shell.
version ver, v π Show the version of jrp.
help π€ Help for jrp.
Flags:
-n, --number π’ number of phrases to generate (default 1, e.g. : 10)
-p, --prefix π‘ prefix of phrases to generate
-s, --suffix π‘ suffix of phrases to generate
-d, --dry-run π§ͺ generate phrases without saving as the histories
-f, --format π format of the output (default "table", e.g. : "plain")
-i, --interactive π¬ generate Japanese random phrases interactively
-t, --timeout β timeout in seconds for the interactive mode (default 30, e.g. : 10)
-h, --help π€ help for jrp
-v, --version π version for jrp
Argument:
number π’ number of phrases to generate (e.g. : 10)
jrp
can generate Japanese random phrases interactively.
You can favorite, save, skip, and exit interactively while generating phrases.
To use this mode, run either command below.
# Those commands below are equivalent.
# And they have their aliases. Please check the help message.
jrp interactive
# or
jrp --interactive
# or
jrp generate interactive
# or
jrp generate --interactive
Press either key below for your action.
u
- Favorite, continue.
i
- Favorite, exit.
j
- Save, continue.
k
- Save, exit.
m
- Skip, continue.
other
- Skip, exit.
Default : $XDG_DATA_HOME/jrp/wnjpn.db
or $HOME/.local/share/jrp/wnjpn.db
export JRP_WNJPN_DB=/path/to/your/directory/wnjpn.db
Default : $XDG_DATA_HOME/jrp/jrp.db
or $HOME/.local/share/jrp/jrp.db
export JRP_DB=/path/to/your/directory/jrp.db
go install github.com/yanosea/jrp/v2/app/presentation/cli/jrp@latest
brew tap yanosea/tap
brew install yanosea/tap/jrp
Go to the Releases and download the latest binary for your platform.
Reinstall jrp
!
go install github.com/yanosea/jrp/v2/app/presentation/cli/jrp@latest
brew update
brew upgrade jrp
Download the latest binary from the Releases page and replace the old binary in your $PATH
.
rm $GOPATH/bin/jrp
# maybe you have to execute with sudo
rm -fr $GOPATH/pkg/mod/github.com/yanosea/jrp*
brew uninstall jrp
brew untap yanosea/tap/jrp
Remove the binary you downloaded and placed in your $PATH
.
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.
rm $HOME/.local/share/jrp/wnjpn.db
rm $HOME/.local/share/jrp/jrp.db
jrp
also provides RESTful API server that you can use to get Japanese random phrases.
# If you installed with go, you can run the server with the command below.
jrp-server
# If you cloned the repository, you can run the server with the command below.
go run app/presentation/api/jrp-server/main.go
# Then, you can access the API server with the URL below.
curl http://localhost:8080/api/jrp
Swagger documentation is available at: http://localhost:8080/swagger/index.html
Method | Path | Description |
---|---|---|
GET | /api/jrp |
Get a generated Japanese random phrase |
You have to download the WordNet Japan sqlite database file from WordNet Japan before running the server.
Default : 8080
export JRP_SERVER_PORT=8080
Default : $XDG_DATA_HOME/jrp/wnjpn.db
or $HOME/.local/share/jrp/wnjpn.db
export JRP_SERVER_WNJPN_DB=/path/to/your/directory/wnjpn.db
go install github.com/yanosea/jrp/v2/app/presentation/api/jrp-server@latest
git clone github.com/yanosea/jrp
cd jrp
go run app/presentation/api/jrp-server/main.go
Reinstall jrp-server
!
go install github.com/yanosea/jrp/v2/app/presentation/api/jrp-server@latest
Pull the latest changes into your local repository.
rm $GOPATH/bin/jrp
# maybe you have to execute with sudo
rm -fr $GOPATH/pkg/mod/github.com/yanosea/jrp*
Remove the directory you cloned.
If you've set jrp-server 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.
rm $HOME/.local/share/jrp/wnjpn.db
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!
Feel free to point me in the right directionπ