Fold Tool for Openclaw

A terminal-based utility designed to automatically wrap long lines of text to fit specific column widths or document margins.

dinghaibin
v1.0.0
Apr 29, 2026
0
709
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install fold-tool

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install fold-tool using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Fold Tool?

The Fold Tool is a specialized utility within the Openclaw Skills ecosystem that ensures your text files remain readable and consistent by enforcing line width constraints. It is particularly useful for developers and writers who need to format long strings of text to fit within standard terminal widths, code comment blocks, or specific documentation margins without manual editing.

By integrating this skill into your workflow, you can programmatically manage text density and layout. Whether you are prepping logs for terminal viewing or formatting README files, this tool provides a reliable way to maintain clean text structures across various Openclaw Skills environments.

Fold Tool Use Cases

  • Formatting long documentation paragraphs to fit a standard 80-character terminal width.
  • Cleaning up raw text exports that contain excessively long single lines.
  • Pre-processing text data for display in constrained mobile or CLI interfaces.
  • Ensuring code comments or git commit messages adhere to team line-length conventions.

How Fold Tool Works

  1. The user provides an input text file or stream to the utility.
  2. The tool scans the text for lines exceeding the specified width (defaulting to 80 characters).
  3. Depending on the flags used, it identifies the optimal break point—either exactly at the character limit or at the nearest preceding whitespace.
  4. It inserts a newline character at the break point and continues processing the remainder of the line.
  5. The formatted text is output to the terminal or saved to a designated file.

Fold Tool Setup

To use this utility within your environment, ensure it is installed as part of your Openclaw Skills library. You can run it directly via the CLI:

# Basic installation check
fold-tool --help

# Standard usage to wrap a file at 72 characters
fold-tool -w 72 yourfile.txt

Fold Tool Data Schema & Taxonomy

The Fold Tool processes text streams and outputs formatted strings. It does not maintain a complex database but follows a specific parameter schema:

Parameter Type Description Default
-w Integer The maximum number of characters allowed per line. 80
-s Boolean If true, forces breaks only at space characters to prevent word splitting. false
-b Boolean If true, counts bytes rather than character columns (useful for specific encodings). false

Fold Tool Advanced Features

  • Smart word-boundary detection using the -s flag to preserve vocabulary integrity.
  • Byte-level folding for binary or non-UTF8 text processing using the -b option.
  • Support for multi-file processing in a single command execution.
  • Seamless integration into larger shell pipelines to format output from other Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*