文本差异对比

# cn-diff-checker - 文本差异比对工具

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "文本差异对比" with this command: npx skills add freedompixels/cn-diff-checker

cn-diff-checker - 文本差异比对工具

比对两个文本/文件的差异,支持逐行、逐词、逐字符比对。

功能

  • 文本比对(字符串)
  • 文件比对
  • 逐行/逐词/逐字符模式
  • 输出ANSI彩色差异

使用方法

# 比对两个字符串
python3 cn_diff_checker.py "Hello World" "Hello Python"

# 比对两个文件
python3 cn_diff_checker.py file1.txt file2.txt

# 逐词比对
python3 cn_diff_checker.py "这是测试文本" "这是示例文本" --word

# 逐字符比对
python3 cn_diff_checker.py "abc" "abd" --char

参数

参数说明默认值
old原始文本或文件必填
new新文本或文件必填
--line逐行比对默认
--word逐词比对False
--char逐字符比对False
--output输出到文件False

示例

# 基本比对
python3 cn_diff_checker.py old.txt new.txt

# 只显示新增行
python3 cn_diff_checker.py old.txt new.txt | grep "^>"

# 只显示删除行
python3 cn_diff_checker.py old.txt new.txt | grep "^<"

依赖

  • Python 3.x(内置difflib)

注意事项

  • 自动检测文件输入(读取文件内容)
  • 字符串输入直接比对
  • Windows下ANSI颜色可能不显示

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

API Gateway

Connect to 100+ APIs (Google Workspace, Microsoft 365, GitHub, Notion, Slack, Airtable, HubSpot, etc.) with managed OAuth. Use this skill when users want to...

Registry SourceRecently Updated
73.2K369byungkyu
Coding

S2硅基灵魂与具身架构师

Interactive CLI tool to create custom AI agent personalities using 16 RPG-style classes, behavioral directives, and a mathematical DNA engine, fully local an...

Registry SourceRecently Updated
Coding

FRITZ!Box

Control AVM FRITZ!Box routers and Smarthome devices via TR-064 and Web API. Use when the user wants to manage their FRITZ!Box router (WLAN, connected devices...

Registry SourceRecently Updated
Coding

Oauth Debugger

Debug OAuth 2.0 and OIDC flows. Trace authorization code, PKCE, client credentials, and implicit flows. Diagnose redirect URI mismatches, scope issues, token...

Registry SourceRecently Updated