WordCount for Openclaw

A high-performance bash utility for calculating precise line, word, character, and byte counts with full support for CJK text.

longgteng
v1.0.0
Mar 3, 2026
0
0
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install wordcount

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 wordcount 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 WordCount?

WordCount is a robust, zero-dependency Bash implementation designed for developers who need to quantify text data quickly. It provides a reliable way to analyze document length, code files, and raw text strings directly within your terminal or automation pipeline. As part of the ecosystem of Openclaw Skills, it serves as a foundational tool for text preprocessing and validation.

This skill is particularly valuable for users working with multi-byte characters, as it correctly identifies CJK character counts where standard tools might fail. By providing output in a structured format, it allows for seamless integration into larger data processing workflows and AI agent decision-making processes.

WordCount Use Cases

  • Quantifying the length of documents and articles before publication or submission.
  • Measuring the character count of text snippets to ensure they fit within LLM context window limits.
  • Checking file lengths and line counts in automated CI/CD or data processing scripts.
  • Analyzing CJK text where standard word counting tools provide inaccurate results.

How WordCount Works

  1. The user provides input to the skill via a file path using the --file flag, direct text via --text, or through a standard input pipe.
  2. The script processes the input stream using native bash logic to ensure maximum portability and speed.
  3. It calculates metrics across four dimensions: line count, word count, character count (with multi-byte support), and total bytes.
  4. The resulting data is formatted into a clean JSON object and returned to the caller or the AI agent.

WordCount Setup

To use WordCount as part of your Openclaw Skills collection, ensure the script is executable and accessible within your scripts directory.

# Make the script executable
chmod +x ./scripts/wordcount

# Run it against a file
./scripts/wordcount --file documents/report.md

WordCount Data Schema & Taxonomy

The skill generates a JSON response with the following schema to ensure compatibility with other Openclaw Skills:

Property Type Description
lines integer The total number of lines in the input.
words integer The count of whitespace-separated words.
characters integer The total character count, supporting CJK multi-byte characters.
bytes integer The raw size of the input in bytes.

WordCount Advanced Features

  • Native support for CJK (Chinese, Japanese, Korean) characters ensures accurate metrics for international text.
  • Zero external dependencies, relying solely on pure Bash for environments where minimal overhead is required.
  • Flexible input methods allowing for direct text analysis, file-based processing, or piped data streams.
  • Agent-optimized decision logic that triggers automatically when users inquire about text length or size.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*