text-diff

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Text Diff Tool

文本对比工具

Description

说明

Compare files and text content with unified diff output, side-by-side view, and patch generation.
对比文件和文本内容,支持统一diff输出、并排视图和补丁生成。

Trigger

触发方式

  • /diff
    command
  • User needs to compare files
  • User wants to see changes
  • /diff
    命令
  • 用户需要对比文件时
  • 用户想要查看变更内容时

Usage

使用方法

bash
undefined
bash
undefined

Compare two files

对比两个文件

python scripts/text_diff.py file1.txt file2.txt
python scripts/text_diff.py file1.txt file2.txt

Unified diff format

统一diff格式输出

python scripts/text_diff.py old.py new.py --unified
python scripts/text_diff.py old.py new.py --unified

Side-by-side view

并排视图

python scripts/text_diff.py file1.txt file2.txt --side-by-side
python scripts/text_diff.py file1.txt file2.txt --side-by-side

Generate patch

生成补丁

python scripts/text_diff.py old.txt new.txt --patch > changes.patch
undefined
python scripts/text_diff.py old.txt new.txt --patch > changes.patch
undefined

Tags

标签

diff
,
compare
,
patch
,
text
,
files
diff
,
compare
,
patch
,
text
,
files

Compatibility

兼容性

  • Codex: ✅
  • Claude Code: ✅
  • Codex: ✅
  • Claude Code: ✅