← 返回
未分类 中文

Wc Lines Tool

Count lines, blank lines, code lines, and comment lines in text files. Useful for code statistics, log file sizing, and document analysis.
统计文本文件中的总行数、空行、代码行和注释行。适用于代码统计、日志文件大小分析和文档分析。
dinghaibin dinghaibin 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 246
下载
💾 0
安装
1
版本
#latest

概述

WC Lines Tool — Line Counting Utility

Count lines in text input with smart detection of blank lines, code lines, comment lines, and non-empty content. Ideal for codebases, log analysis, and document statistics.

Quick Start

# Count lines in a string
wc-lines-tool "line1\nline2\nline3"

# Count lines from stdin
cat README.md | wc-lines-tool

# Count lines in a file
wc-lines-tool --file log.txt

Usage

wc-lines-tool [TEXT] [OPTIONS]
wc-lines-tool --file FILE [OPTIONS]

Options:
  --file FILE       Read from file instead of argument
  --non-blank       Count only non-empty lines
  --blank           Count only blank/empty lines
  --code            Count lines likely containing code (non-comment, non-blank)
  --max N           Report if line count exceeds N (exit 1 if over)
  --min N           Report if line count is below N (exit 1 if under)
  --json            Output as structured JSON

Examples

# Total line count
wc-lines-tool --file server.log

# Non-blank lines only
wc-lines-tool --file app.py --non-blank

# Blank line count
wc-lines-tool --file main.go --blank

# Check log file size threshold (alert if > 10000 lines)
wc-lines-tool --file errors.log --max 10000

# Machine-readable output
wc-lines-tool --file data.csv --json

Features

  • Line counting — total, blank, non-blank, code
  • File, stdin, and argument input — flexible sources
  • Threshold alerts — --min/--max with exit codes for CI/CD
  • JSON output — pipeline-friendly
  • Fast — handles large files efficiently
  • UTF-8 safe — handles arbitrary encodings

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-12 05:34 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 683 📥 330,236
it-ops-security

Whoami Tool Check

dinghaibin
身份验证工具 — 根据预期角色验证当前用户,检查sudo权限,审计用户权限。扩展whoami用于安全...
★ 0 📥 417
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 79 📥 182,729