| Crates.io | runefix-cli |
| lib.rs | runefix-cli |
| version | 0.1.0 |
| created_at | 2025-05-31 12:07:27.040524+00 |
| updated_at | 2025-05-31 12:07:27.040524+00 |
| description | Unified CLI frontend for runefix tools: width detection, markdown formatter, and terminal testing |
| homepage | https://github.com/runefix-labs/runefix-cli |
| repository | https://github.com/runefix-labs/runefix-cli |
| max_upload_size | |
| id | 1696312 |
| size | 90,869 |
Runefix CLI is a powerful, minimal, and precise command-line toolkit for working with Unicode text โ especially in CJK and terminal environments. It acts as the unified frontend for the runefix-core engine.
๐ Display-aware width calculation (CJK, emoji, symbols)
โ๏ธ Accurate grapheme and atom segmentation
๐ก๏ธ Safe slicing and truncation based on visible width
๐ง Unicode grapheme and width policy support via runefix-core
โก Zero-bloat CLI: All dependencies are carefully selected for performance, size, and clarity
๐งญ Built-in init command with XDG-compliant config path (~/.config/runefix/)
๐ Powerful slice command inspired by Python-style slicing, designed to replace cut in Unicode-aware contexts
cargo install runefix-cli
This will install the CLI binary as runefix.
After installing Runefix, you can optionally run runefix init to configure your preferred language. This step is not required โ the default fallback is English. The config file follows the XDG Base Directory Specification, and currently supports three languages:
# When you run `runefix init`, you'll be prompted:
? ๐๏ธ Select your preferred language:
> ๐บ๐ธ English (en-US)
๐จ๐ณ ็ฎไฝไธญๆ (zh-CN)
๐ฏ๐ต ๆฅๆฌ่ช (ja-JP)
# After pressing Enter, you'll see:
๐๏ธ Select your preferred language: ๐บ๐ธ English (en-US)
โ
Language saved to "~/.config/runefix/config"
Here are a few quick examples to demonstrate Runefix CLI commands:
runefix atoms "Love ๐ฉโโค๏ธโ๐โ๐จ" # Segment Unicode atoms
runefix graphemes "Hello ๐ ไธ็" # Identify grapheme clusters
runefix width --verbose "Hello ๐ ไธ็" # Measure display width
runefix slice -g "[0:3]" "ไฝ ๅฅฝ๐จโ๐ฉโ๐งโ๐ฆHelloไธ็" # Slice by grapheme index
๐ Full CLI output: examples/output.txt
| Command | Description |
|---|---|
width |
Total display width of the input |
widths |
Width of each segment |
graphemes |
Split input into Unicode grapheme clusters |
atoms |
Split input into width-sensitive visual atoms |
split |
Chunk text into lines with max width |
truncate |
Truncate string to a max visible width |
slice |
Slice string using layout-aware range |
version |
Show version and runtime info |
init |
Create config scaffold (if needed) |
Use --help with any command for more details.
commands/cmds/ โ All CLI subcommands (slice, width, truncate, etc.)
config/ โ Global config loader & context handler
i18n/ โ Multilingual support (en, zh, jp)
style/ โ Terminal print utils (color, alignment)
See CHANGELOG.md for version history.
Licensed under either of:
See LICENSE-MIT or LICENSE-APACHE for full terms.
PRs, ideas, and feedback are welcome. Star the repo to show support โญ
For issues related to Unicode behavior, grapheme segmentation, or terminal rendering, feel free to open a discussion!