← 返回
未分类

text-diff

yjkj999999
未分类 community v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 21
下载
💾 0
安装
1
版本
#latest

概述

text-diff

Show line-by-line differences between two text files using Python's difflib.

Description

A utility skill for comparing two text files and displaying their differences in a readable format. Supports unified diff output and side-by-side comparison modes.

Usage

# Show unified diff between two files
python ~/.openclaw/skills/text-diff/text_diff.py unified file1.txt file2.txt

# Show side-by-side comparison
python ~/.openclaw/skills/text-diff/text_diff.py side-by-side file1.txt file2.txt

# Show context diff (3 lines of context)
python ~/.openclaw/skills/text-diff/text_diff.py context file1.txt file2.txt

# Compare with custom context lines
python ~/.openclaw/skills/text-diff/text_diff.py unified file1.txt file2.txt -c 5

Options

  • unified: Show unified diff format (default)
  • context: Show context diff format
  • side-by-side: Show line-by-line comparison
  • -c, --context: Number of context lines (default: 3)
  • -o, --output: Save diff to file instead of stdout
  • --no-color: Disable colored output

Examples

# Basic unified diff
python ~/.openclaw/skills/text-diff/text_diff.py unified old.txt new.txt

# Side-by-side comparison with no colors (for piping)
python ~/.openclaw/skills/text-diff/text_diff.py side-by-side old.txt new.txt --no-color

# Save diff to file
python ~/.openclaw/skills/text-diff/text_diff.py unified old.txt new.txt -o diff.txt

# Compare with 10 lines of context
python ~/.openclaw/skills/text-diff/text_diff.py context old.txt new.txt -c 10

Output Format

Unified Diff

--- old.txt
+++ new.txt
@@ -1,5 +1,5 @@
 line 1
 line 2
-line 3 (removed)
+line 3 (added)
 line 4
 line 5

Side-by-Side

OLD                          | NEW
---------------------------- | ----------------------------
line 1                       | line 1
line 2                       | line 2
line 3 (removed)             | line 3 (added)
line 4                       | line 4

Exit Codes

  • 0: Files are identical
  • 1: Files differ
  • `

版本历史

共 1 个版本

  • v1.0.0 从ClawHub迁移发布 当前
    2026-06-07 11:47 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

design-media

agnes-image-gen

user_15292d5a
使用 Agnes AI 的图片生成模型生成图片,支持文生图(agnes-image-2.1-flash)和图生图(agnes-image-2.0-flash)。支持自定义 API Key,用户可使用自己的 Agnes Key。优化重点:降低
★ 1 📥 250
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,198
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 198 📥 68,342