agentsmesh diff
Show a unified diff of what the next agentsmesh generate would change, without writing anything. Use this to review pending changes before committing or to debug unexpected output.
Usage
agentsmesh diff [flags]Flags
| Flag | Description |
|---|---|
--global | Diff outputs generated from ~/.agentsmesh/ instead of the current project. |
--targets <csv> | Limit diff output to specific target IDs. |
Examples
Show all pending changes
agentsmesh diffOutput shows a unified diff for each file that would be created, modified, or deleted by the next generate.
Show changes for specific targets
agentsmesh diff --targets windsurfagentsmesh diff --targets claude-code,cursorDiff home-level global outputs
agentsmesh diff --global --targets claude-codeSample output
--- .claude/rules/security.md (current)+++ .claude/rules/security.md (generated)@@ -5,6 +5,8 @@ Never log sensitive data. Validate all external inputs.+Use parameterized queries for all database operations.+Sanitize HTML output to prevent XSS.
--- .cursor/rules/security.mdc (current)+++ .cursor/rules/security.mdc (generated)@@ -5,6 +5,8 @@ Never log sensitive data. Validate all external inputs.+Use parameterized queries for all database operations.+Sanitize HTML output to prevent XSS.Workflow
diff is most useful as a pre-commit review step:
# 1. Edit canonical filesvi .agentsmesh/rules/security.md
# 2. Preview what changes will be generatedagentsmesh diff
# 3. If it looks correct, generateagentsmesh generate
# 4. Commit both canonical and generated filesgit add .agentsmesh/ .claude/ .cursor/git commit -m "security: add SQL injection and XSS rules"Relationship to generate --dry-run
Both preview a run without writing, but they are separate commands with different output.
agentsmesh diffwrites each unified patch to stdout, then a summary line:N files would be created, N updated, N unchanged, N deleted.agentsmesh generate --dry-runwrites one status line per file —[dry-run] <status> <path> (<target>)— and no patches or summary.
Use diff when you want to read the change, generate --dry-run when you want the file list.