返回顶部
j

jrv-text-diff

Compare two text files or strings side-by-side or unified. Highlights additions, deletions, and changes with color. Supports word-level diff, ignore-whitespace, and JSON/YAML structural diff modes.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
133
下载量
0
收藏
概述
安装方式
版本历史

jrv-text-diff

# jrv-text-diff Compare two texts, files, or code snippets and show exactly what changed. Supports unified diff, side-by-side view, word-level highlighting, and structural diff for JSON/YAML. ## Quick Start ```bash # Compare two files python3 scripts/text_diff.py file1.txt file2.txt # Compare inline strings python3 scripts/text_diff.py --text "hello world" --text2 "hello there" # Unified diff (patch format) python3 scripts/text_diff.py file1.txt file2.txt --format unified # Side-by-side comparison python3 scripts/text_diff.py file1.txt file2.txt --format side-by-side # Word-level diff python3 scripts/text_diff.py file1.txt file2.txt --word-diff # Ignore whitespace python3 scripts/text_diff.py file1.txt file2.txt --ignore-whitespace # JSON structural diff python3 scripts/text_diff.py data1.json data2.json --format json # YAML structural diff python3 scripts/text_diff.py config1.yaml config2.yaml --format yaml # Output diff as JSON report python3 scripts/text_diff.py file1.txt file2.txt --output-json ``` ## Commands | Command | Description | |---------|-------------| | `text_diff.py <file1> <file2>` | Compare two files (default: unified diff) | | `--text <str> --text2 <str>` | Compare two inline strings | | `--format unified` | Unified patch-style diff output | | `--format side-by-side` | Two-column comparison | | `--format context` | Context diff (like diff -c) | | `--format json` | Structural JSON diff | | `--format yaml` | Structural YAML diff | | `--word-diff` | Highlight word-level changes within lines | | `--ignore-whitespace` | Ignore leading/trailing whitespace | | `--ignore-case` | Case-insensitive comparison | | `--context N` | Lines of context (default: 3) | | `--output-json` | Output diff stats as JSON | | `--no-color` | Disable ANSI color output | ## Use Cases - **Code review**: See exactly what changed between two versions of a config or script - **Config auditing**: Spot differences between prod and staging configs - **JSON/YAML diffs**: Structural comparison ignoring key ordering - **Copy editing**: Word-level diff for prose documents - **CI pipelines**: JSON output for programmatic diff analysis ## Exit Codes - `0` — Files are identical - `1` — Files differ - `2` — Error (file not found, parse error, etc.)

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 jrv-text-diff-1776192244 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 jrv-text-diff-1776192244 技能

通过命令行安装

skillhub install jrv-text-diff-1776192244

下载 Zip 包

⬇ 下载 jrv-text-diff v1.0.0

文件大小: 4.84 KB | 发布时间: 2026-4-17 15:08

v1.0.0 最新 2026-4-17 15:08
Initial release of jrv-text-diff.

- Compare two texts, files, or code snippets with clear visualization of differences.
- Supports unified diff, side-by-side view, context diff, and structural diff for JSON/YAML.
- Word-level highlighting, ignore-whitespace, and case-insensitive comparison available.
- Command-line interface with flexible input options for files or inline strings.
- Outputs include colorized terminal diff, JSON reports, and configurable context lines.
- Appropriate exit codes for scripting and CI integration.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部