runefix-cli

Crates.iorunefix-cli
lib.rsrunefix-cli
version0.1.0
created_at2025-05-31 12:07:27.040524+00
updated_at2025-05-31 12:07:27.040524+00
descriptionUnified CLI frontend for runefix tools: width detection, markdown formatter, and terminal testing
homepagehttps://github.com/runefix-labs/runefix-cli
repositoryhttps://github.com/runefix-labs/runefix-cli
max_upload_size
id1696312
size90,869
Pokeya (pokeyaro)

documentation

README

๐Ÿงฐ Runefix CLI - Unicode-Aware Display Toolkit

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.


โœจ Features

  • ๐Ÿ” 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

๐Ÿš€ Installation

Via Cargo

cargo install runefix-cli

This will install the CLI binary as runefix.

๐Ÿ› ๏ธ Initialization

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"

๐Ÿงช Example Usage

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

๐Ÿ”ง Commands

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.

๐Ÿ“ฆ Module Overview

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

๐Ÿ“Œ CHANGELOG

See CHANGELOG.md for version history.

๐Ÿ“œ License

Licensed under either of:

  • MIT License
  • Apache License (Version 2.0)

See LICENSE-MIT or LICENSE-APACHE for full terms.

๐Ÿ’ฌ Contributing

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!

Commit count: 5

cargo fmt