wc-tool for Openclaw

A robust multi-file utility for counting lines, words, characters, and bytes with structured output support.

dinghaibin
v1.0.0
May 11, 2026
0
601
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install wc-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 wc-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 wc-tool?

The wc-tool is a high-performance utility designed for developers and data analysts who need precise document statistics. As a versatile entry in the Openclaw Skills library, it provides a multibyte-aware counting mechanism that handles everything from simple text files to complex source code across multiple directories.

Beyond basic counting, this tool is built for the modern automation workflow. It seamlessly integrates into shell pipelines and offers structured JSON output, making it an essential component for those building automated data volume estimation or code metrics reporting systems.

wc-tool Use Cases

  • Analyzing source code volume by counting lines across multiple repositories.
  • Validating document lengths for character-limited submissions or data entry.
  • Estimating data storage requirements by calculating total byte counts across file sets.
  • Automating CI/CD pipelines to monitor file growth or detect excessively long lines of code.
  • Processing dynamic lists of files generated by other CLI tools via standard input.

How wc-tool Works

  1. The user invokes the command with specific flags and a list of target files or a piped stream.
  2. The tool parses the input to determine which metrics (lines, words, chars, bytes) are requested.
  3. It performs a multibyte-aware scan of each file, ensuring accurate character counts even for non-ASCII text.
  4. If multiple files are provided, it calculates individual metrics for each file and maintains a running grand total.
  5. The final output is rendered to the terminal or as a JSON object, depending on the specified configuration.

wc-tool Setup

To integrate this utility into your environment as part of your Openclaw Skills collection, use the following steps:

# Standard usage via CLI
wc-tool [FILE...]

# Using piped input
cat data.txt | wc-tool -l

# Reading from a null-separated list
find . -name "*.txt" -print0 | wc-tool --files0-from=-

wc-tool Data Schema & Taxonomy

The wc-tool organizes statistical data into clear categories for both human readability and machine parsing:

Metric Description Flag
Lines Total newline characters -l
Words Total space-delimited strings -w
Characters Multibyte-aware character count -m
Bytes Total raw byte size -c
Max Line Length of the longest line -L

When using the --json flag, the data is returned as a structured object containing per-file statistics and a total summary block.

wc-tool Advanced Features

  • JSON Output Mode: Direct integration with scripting languages like Python or Node.js by providing machine-readable results.
  • Multibyte Awareness: Correctly handles UTF-8 and other character encodings to provide accurate character counts vs byte counts.
  • Maximum Line Detection: Identify code style violations or formatting issues by finding the longest line in a file.
  • Null-Separated Inputs: Support for --files0-from allows processing of filenames containing spaces or special characters safely.
  • Pipeline Optimization: Designed for zero-buffer performance when used in complex Linux/Unix pipe chains.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*