DiffDeck is a powerful, flexible code difference analysis tool that helps developers understand, document, and secure their code changes. It provides rich diff visualization, security scanning, and various output formats to suit different needs.
- π Smart Diff Analysis: Compare branches, commits, or local files with intelligent diff algorithms
- π‘οΈ Security Scanning: Built-in security checks for sensitive data and potential vulnerabilities
- π Multiple Output Formats: Support for plain text, Markdown, MDX, and XML outputs
- π¨ Customizable Styling: Line numbers, custom headers, and formatting options
- π Performance Optimized: Efficient processing of large codebases
- π Security First: Automatic scanning for sensitive data and security issues
- π Clipboard Integration: Direct copying of diff output to clipboard
go install github.com/KnockOutEZ/diffdeck/cmd/diffdeck@latestOr build from source:
git clone https://github.com/KnockOutEZ/diffdeck.git
cd diffdeck
go build ./cmd/diffdeck- Compare two branches:
diffdeck --from-branch develop --to-branch main- Compare with custom output:
diffdeck --from-branch develop --to-branch main --output diff.md --style markdown- Enable security scanning:
diffdeck --from-branch develop --to-branch main --security-checkDiffDeck can be configured via JSON configuration file. Default location is diffdeck.config.json.
{
"output": {
"filePath": "diffdeck-output.txt",
"style": "mdx",
"showLineNumbers": true,
"copyToClipboard": true,
"topFilesLength": 5
},
"include": ["**/*"],
"ignore": {
"patterns": [
".git/**",
"node_modules/**",
"vendor/**"
]
},
"security": {
"disableSecurityCheck": false,
"maxFileSize": 10485760
}
}"output": {
"filePath": "diffdeck-output.txt", // Output file path
"style": "mdx", // Output format: plain, markdown, mdx, xml
"showLineNumbers": true, // Include line numbers in diff
"copyToClipboard": true, // Copy output to clipboard
"topFilesLength": 5 // Number of files in summary
}"include": ["**/*"], // Files to include
"ignore": {
"patterns": [ // Files to ignore
".git/**",
"node_modules/**",
"vendor/**"
]
}"security": {
"disableSecurityCheck": false, // Enable/disable security scanning
"maxFileSize": 10485760 // Max file size to scan (10MB)
}"git": {
"defaultRemote": "", // Default remote repository
"cacheDir": "/tmp/cache", // Cache directory location
"timeout": "5m" // Git operation timeout
}# Compare branches
diffdeck --from-branch feature --to-branch main
# Use specific config file
diffdeck --config my-config.json --from-branch feature --to-branch main
# Generate markdown output
diffdeck --style markdown --output diff.md --from-branch feature --to-branch main
# Disable security checks
diffdeck --no-security-check --from-branch feature --to-branch main
# Show line numbers
diffdeck --show-line-numbers --from-branch feature --to-branch main# Custom include/ignore patterns
diffdeck --include "src/**/*.js" --ignore "**/*.test.js"
# Set custom file size limit
diffdeck --max-file-size 20971520
# Compare specific files
diffdeck --files "src/main.js,src/utils.js"
# Use custom cache directory
diffdeck --cache-dir "/custom/cache/path"diffdeck --style plainGenerates simple text output with basic formatting.
diffdeck --style markdownGenerates GitHub-flavored Markdown with syntax highlighting.
diffdeck --style mdxGenerates MDX format suitable for React documentation.
diffdeck --style xmlGenerates structured XML output for programmatic processing.
DiffDeck includes built-in security scanning capabilities:
- Sensitive data detection (API keys, tokens)
- Password pattern matching
- Private key detection
- Internal URL/IP detection
- AWS credentials scanning
Enable/disable security scanning:
# Enable
diffdeck --security-check
# Disable
diffdeck --no-security-checkDiffDeck uses glob patterns for file matching:
**/*- Match all files*.{js,ts}- Match JavaScript and TypeScript filessrc/**/*.go- Match Go files in src directory!test/**- Exclude test directory
- Use appropriate
maxFileSizelimit - Leverage ignore patterns for large directories
- Use cache directory for repeated operations
- Consider disabling security checks for large diffs
- Use specific include patterns when possible
- name: Run DiffDeck
run: |
diffdeck --from-branch ${{ github.event.pull_request.base.ref }} \
--to-branch ${{ github.event.pull_request.head.ref }} \
--output diff.md \
--style markdowndiff_check:
script:
- diffdeck --from-branch $CI_MERGE_REQUEST_TARGET_BRANCH_NAME \
--to-branch $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME \
--style markdown \
--output diff.md-
Large Files
- Increase
maxFileSizein config - Use more specific include patterns
- Increase
-
Performance Issues
- Optimize ignore patterns
- Use cache directory
- Consider disabling security checks
-
Git Integration
- Ensure correct branch names
- Check timeout settings
- Verify git credentials
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License - see LICENSE file for details.