@reaatech/cli
Thin CLI wrapper that pipes stdin through a chosen helper from
@reaatech/core.
Installation
code
pnpm add @reaatech/cli
After installing globally or linking, the string-utils binary is available:
code
echo "Hello World" | string-utils --op kebab
# hello-world
Usage
code
string-utils --op <operation> [--max-length <n>] [--suffix <string>]
Reads from stdin, writes to stdout. Exits 0 on success, 1 on error.
Arguments
| Flag | Required | Description |
|---|---|---|
--op | Yes | Operation: kebab, camel, truncate, slugify |
--max-length | For truncate | Non-negative integer. Max output length including suffix. |
--suffix | No | Suffix to append on truncation (default …). Only valid with --op truncate. |
Operations
kebab — convert stdin to kebab-case
code
echo "helloWorld" | string-utils --op kebab
# hello-world
camel — convert stdin to camelCase
code
echo "hello-world" | string-utils --op camel
# helloWorld
truncate — truncate stdin to maxLength, append suffix
code
echo "hello world" | string-utils --op truncate --max-length 5
# hello…
echo "abcdef" | string-utils --op truncate --max-length 3 --suffix "..."
# abc...
slugify — convert stdin to a URL-safe slug
code
echo "Hello World!" | string-utils --op slugify
# hello-world
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (unknown op, missing --op, missing --max-length for truncate, non-integer or negative --max-length, non-numeric --max-length) |
Error output
All errors write to stderr with no prefix:
code
Error: --op is required
Error: --max-length is required for --op truncate
Error: --max-length must be a non-negative integer
