/install diff4
diff4 - Encrypted Diff & File Sharing
diff4 encrypts diffs and files client-side (AES-256-GCM) before uploading. The server never sees plaintext. Recipients need the passphrase to decrypt.
Prerequisites
diff4must be installed and available on PATH. Usenpm i -g @diff4/clito install.- A passphrase must be configured (see setup below)
Commands
Share the latest commit diff
diff4 git-latest
Runs git diff HEAD~1, encrypts the result, and uploads. Use when the user says "preview my last commit" or "send the latest diff."
Share staged changes
diff4 git-staged
Runs git diff --staged, encrypts, and uploads. Use when the user says "preview my staged changes" or "send what's about to be committed."
Share arbitrary files
diff4 files path/to/file1.ts path/to/file2.ts
Reads each file (UTF-8 text only), bundles them as JSON, encrypts, and uploads. Supports any number of paths (relative or absolute).
Key management
diff4 key-gen [key]- Generate or set the encryption passphrasediff4 key-get- Print the current passphrase
Options
All upload commands (git-latest, git-staged, files) accept:
| Flag | Description |
|---|---|
-s, --server \x3Curl> |
Override the diff4 server URL. Default: https://diff4.com (or DIFF4_SERVER env var) |
-p, --passphrase \x3Ckey> |
Override the passphrase for this command only. Default: DIFF4_PASSPHRASE env var |
Gotchas
- Empty diffs fail gracefully.
git-latestandgit-stagedwill error if there is nothing to share. - Binary files are not supported.
diff4 filesreads files as UTF-8 text. - Server is configurable. Self-hosted instances can be set via
DIFF4_SERVERenv var or-sflag. - The passphrase must be shared out-of-band. diff4 only encrypts — recipients need the same passphrase to decrypt.
- key-gen updates existing keys. If
DIFF4_PASSPHRASEalready exists in the shell config, key-gen replaces it in-place.
Typical workflow
- User asks to see a diff or files
- Verify setup: run
diff4 key-get(if it fails, rundiff4 key-genand tell user to source their rc file) - Run the appropriate command (
git-latest,git-staged, orfiles \x3Cpaths>) - Return the URL from the response to the user
- Remind the user that recipients need the passphrase to decrypt
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install diff4 - 安装完成后,直接呼叫该 Skill 的名称或使用
/diff4触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
diff4 是什么?
Preview git diffs and files using the diff4 CLI. Use when the user wants to see code changes, review files content securely via diff4. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 72 次。
如何安装 diff4?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install diff4」即可一键安装,无需额外配置。
diff4 是免费的吗?
是的,diff4 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
diff4 支持哪些平台?
diff4 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 diff4?
由 Randy(@djyde)开发并维护,当前版本 v1.0.0。