Skip to content

feat(cli): add terminal-aware text wrapping for descriptions#5

Merged
drichar merged 1 commit intomainfrom
feat/cli-text-wrapping
Feb 10, 2026
Merged

feat(cli): add terminal-aware text wrapping for descriptions#5
drichar merged 1 commit intomainfrom
feat/cli-text-wrapping

Conversation

@drichar
Copy link
Contributor

@drichar drichar commented Feb 10, 2026

Summary

  • Add word-aware text wrapping for skill descriptions in info and add commands using wrap-ansi, so long descriptions reflow cleanly instead of breaking mid-word
  • Make list command truncation responsive to terminal width instead of hardcoded 80 columns

Details

Long skill descriptions (e.g., use-wallet, nfd) were hard to read because the CLI printed raw text that the terminal hard-wrapped at arbitrary positions. This adds a wrapText utility that detects terminal width via process.stdout.columns and uses wrap-ansi to word-wrap text with consistent indentation.

Changes:

  • src/format.ts (new) — wrapText(text, indent) utility
  • src/commands/info.ts — Wrap description with 2-space indent
  • src/commands/add.ts — Wrap description with 4-space indent (accounts for prefix)
  • src/commands/list.ts — Use process.stdout.columns for truncation width

Test plan

  • npx @txnlab/skills info use-wallet — description wraps at word boundaries with 2-space indent
  • npx @txnlab/skills add nfd use-wallet — descriptions wrap with 4-space indent
  • npx @txnlab/skills list — truncation adapts to terminal width
  • Resize terminal and re-run commands to verify responsive wrapping
  • bun test passes
  • bun run lint passes

Long skill descriptions were hard to read due to raw terminal line
wrapping breaking mid-word. Add `wrap-ansi` to word-wrap descriptions
to the terminal width with consistent indentation.

- Add `wrapText` utility in src/format.ts using `wrap-ansi`
- Wrap descriptions in `info` and `add` commands
- Make `list` truncation responsive to terminal width

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@drichar drichar merged commit ea834a6 into main Feb 10, 2026
1 check passed
@drichar drichar deleted the feat/cli-text-wrapping branch February 10, 2026 18:04
txnlab-release-bot bot added a commit that referenced this pull request Feb 10, 2026
# [1.1.0](v1.0.0...v1.1.0) (2026-02-10)

### Features

* **cli:** add terminal-aware text wrapping for descriptions ([#5](#5)) ([ea834a6](ea834a6))
@txnlab-release-bot
Copy link
Contributor

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant