Skip to content

Commit 08056bd

Browse files
refactor: directory and readme
1 parent b8265d6 commit 08056bd

File tree

5 files changed

+250
-214
lines changed

5 files changed

+250
-214
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,31 @@ A powerful CLI tool that generates beautifully formatted markdown files from git
88

99
## Why?
1010

11-
So GitHub/GitLab/Bitbucket diff views works for you? Good. But sometimes those might be not your remote git provider and/or your diff view from your remote git providers might be not so friendly (at least for your eyes). This tool simply offers an alternative that lets you:
11+
So GitHub/GitLab/Bitbucket diff views works for you? Good. But sometimes those might be not your remote git provider and/or your diff view from your remote git providers might be not so friendly moreover if you have to review big changes (at least for your eyes). This tool simply offers an alternative that lets you:
1212

1313
- Generate clean, readable diffs when your remote git provider diff views are unavailable or unfriendly
1414
- Work completely offline - only needs internet access when comparing remote branches
1515
- Export diffs as markdown to attach to tickets, docs, or discussions
16+
- Share diffs with AI/LLM tools (ChatGPT, Claude, Copilot, etc.) to streamline code review, get suggestions, and catch potential issues
1617
- Automatically filter out noise like lockfiles and build artifacts
1718
- Create permanent documentation snapshots of important changes
1819
- Share diffs easily with any stakeholders
20+
- Use your IDE/editor's search and navigation features to analyze the generated diffs:
21+
- Search across all diff files to find specific changes
22+
- Use "Find in Files" to locate impacted code patterns
23+
- Leverage file tree navigation to browse changes by directory
24+
- Take advantage of markdown preview to view formatted diffs
25+
- Use split view to compare original and modified code side by side
26+
- Bookmark key changes for later review
27+
1928

2029
## Features
2130

2231
- 📝 Generates markdown files for each changed file in your git repository
2332
- 🎨 Syntax-highlighted diff output
2433
- 📊 Includes file statistics and change summaries
2534
- 🔍 Automatic exclusion of common build artifacts and sensitive files
26-
- 📁 Creates an organized directory structure with an index
35+
- 📁 Preserves your repository's directory structure and generates a searchable diff index for easy navigation
2736
- 💡 Support for comparing specific commits, branches, or tags
2837
- 🚀 Progress indicators for long-running operations
2938

index.js

Lines changed: 0 additions & 210 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "git-markdown-diff",
33
"version": "0.0.38",
44
"description": "Git diff tool that outputs markdown formatted diffs",
5-
"main": "index.js",
5+
"main": "src/sdk/GitMarkdownDiff.js",
66
"bin": {
7-
"git-markdown-diff": "./index.js"
7+
"git-markdown-diff": "./src/cli/index.js"
88
},
99
"scripts": {
1010
"test": "echo \"Error: no test specified\" && exit 1"

src/cli/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env node
2+
3+
const { program } = require("commander");
4+
const GitMarkdownDiff = require("../sdk/GitMarkdownDiff");
5+
6+
// CLI setup
7+
program
8+
.name("git-markdown-diff")
9+
.description("Generate markdown-formatted git diffs")
10+
.argument(
11+
"[startRef]",
12+
"Starting reference (commit hash, branch name, or tag)"
13+
)
14+
.argument("[endRef]", "Ending reference (commit hash, branch name, or tag)")
15+
.action(async (startRef, endRef) => {
16+
const differ = new GitMarkdownDiff();
17+
await differ.run(startRef, endRef);
18+
});
19+
20+
program.parse();

0 commit comments

Comments
 (0)