Crates.io | charcoal-dict |
lib.rs | charcoal-dict |
version | 0.2.8 |
source | src |
created_at | 2022-12-26 05:23:31.070712 |
updated_at | 2024-04-17 08:51:10.024565 |
description | A command line dictionary |
homepage | https://github.com/LighghtEeloo/charcoal |
repository | https://github.com/LighghtEeloo/charcoal |
max_upload_size | |
id | 745576 |
size | 931,114 |
An alternative to wudao-dict. With colorized output and optional speech.
Arch (-ish):
yay -S charcoal
Brew:
brew install lighghteeloo/charcoal/charcoal
Build from source:
cargo install charcoal-dict
Aliasing common command to chr
, wd
or anything shorter is recommended (cc
if you don't mind?)
alias chr="charcoal query -s"
No manually designated dependencies are required. See Cargo.toml
if you are interested in the crates charcoal is using.
charcoal query <QUERY>
where query can be shortened as q
, search
, or s
.
With -s
or --speak-as true
one can force the happening of a speech.
You may want to edit the configuration file in an easy way. charcoal
gets you covered:
charcoal edit
And with --reset
it will generate a brand new configuration in case anything gets wrong.
For more details on configuration file, see Configuration section.
Charcoal caches up your queries, both text and audio. While it's nice for repetitive queries, it takes up some space. If you want, you can clean them with:
charcoal clean
For more details on cache, see Caching Strategy section.
To see more options, run
charcoal help
for help on subcommands, or
charcoal query --help
for each subcommand, say, query
.
Configurations are straight forward. Just change the booleans and they're yours.
Clone and build from source:
git clone git@github.com:LighghtEeloo/charcoal.git
cd charcoal
cargo build --all
Alias:
cd charcoal
cargo build --all
alias chr="RUST_LOG=info target/debug/charcoal query -s"
As a tiny cli tool, charcoal
can't guarantee 100% cache consistency; however, its caching strategy is delicately designed such that inconsistency is rare and of little harm.
Only ascii with out space will be saved by name, under cache
directory, to achieve better compatibility; the rest will be hashed and then saved under vault
directory.
Both text and audio will be cached.
This repo uses MIT License.
Though it's unlikely, this software may harm data. Use at your own risk.
No privacy collection will be performed.
@TomCC7 for kindly supporting, testing and making suggestions for charcoal
.
@BinhaoQin for providing advice (and patience!) on PKGBUILD.
@Gorgeous-Patrick for updating outdated readme.