@johnowennixon/diffdash 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +174 -0
  2. package/out/diffdash.cjs +33014 -0
  3. package/package.json +75 -0
package/README.md ADDED
@@ -0,0 +1,174 @@
1
+ # DiffDash
2
+
3
+ A command-line tool to generate Git commit messages using AI.
4
+
5
+ ## Features
6
+
7
+ * Generates Git commit messages in natural English
8
+ * Adds a footer to the generated commit messages
9
+ * Options to disable or auto-approve various stages of the process
10
+ * Able to add a prefix or suffix to the summary line
11
+ * Optionally select from a choice of LLM models
12
+ * Compare messages generated from all configured models
13
+ * Configuration using standard API provider environment variables
14
+ * Uses the Vercel AI SDK
15
+ * Uses structured JSON with compatible models
16
+ * Substantially written using AI coding (Claude Code, Roo Code, and Amp)
17
+
18
+ ## Installation from npmjs.com
19
+
20
+ ```bash
21
+ npm install -g @johnowennixon/diffdash
22
+ ```
23
+
24
+ ## API Keys
25
+
26
+ DiffDash requires at least one API key for an LLM provider. These must be provided as environment variables.
27
+
28
+ ```bash
29
+ # For Anthropic
30
+ export ANTHROPIC_API_KEY=your-api-key
31
+
32
+ # For DeepSeek
33
+ export DEEPSEEK_API_KEY=your-api-key
34
+
35
+ # For Google Gemini
36
+ export GEMINI_API_KEY=your-api-key
37
+
38
+ # For OpenAI
39
+ export OPENAI_API_KEY=your-api-key
40
+
41
+ # For Requesty
42
+ export REQUESTY_API_KEY=your-api-key
43
+
44
+ # For OpenRouter
45
+ export OPENROUTER_API_KEY=your-api-key
46
+ ```
47
+
48
+ ## Usage
49
+
50
+ ```bash
51
+ # Basic usage (uses defaults)
52
+ diffdash
53
+
54
+ # Add a prefix to the commit message summary line
55
+ diffdash --add-prefix "[FIX]"
56
+
57
+ # Add a suffix to the commit message summary line
58
+ diffdash --add-suffix "(closes #123)"
59
+
60
+ # Automatically stage all changes, but still prompt for commit and push
61
+ diffdash --auto-add
62
+
63
+ # Automatically stage and commit changes, but still prompt for push
64
+ diffdash --auto-add --auto-commit
65
+
66
+ # Fully automated workflow (stage, commit, and push without prompts)
67
+ diffdash --auto-add --auto-commit --auto-push
68
+
69
+ # Generate message for already staged changes only (won't stage any new changes)
70
+ diffdash --disable-add
71
+
72
+ # Skip displaying the status of staged files before commit
73
+ diffdash --disable-status
74
+
75
+ # Don't display the generated commit message
76
+ diffdash --disable-preview
77
+
78
+ # Generate message but don't commit (exit after displaying the message)
79
+ diffdash --disable-commit
80
+
81
+ # Generate message and commit, but don't push or prompt to push
82
+ diffdash --disable-push
83
+
84
+ # Skip git hooks when pushing
85
+ diffdash --no-verify
86
+
87
+ # Display commit messages generated by all models
88
+ diffdash --compare
89
+
90
+ # Use the fallback LLM model
91
+ diffdash --llm-fallback
92
+
93
+ # Specify the LLM model by name
94
+ diffdash --llm-model claude-3.5-haiku
95
+
96
+ # Debug options
97
+ diffdash --debug-llm-inputs --debug-llm-outputs
98
+ ```
99
+
100
+ ## Command Line Arguments
101
+
102
+ All command-line arguments are optional.
103
+
104
+ | Argument | Description |
105
+ |--------|-------------|
106
+ | `--help` | show a help message and exit |
107
+ | `--version` | show program version information and exit |
108
+ | `--add-prefix PREFIX` | add a prefix to the commit message summary line |
109
+ | `--add-suffix SUFFIX` | add a suffix to the commit message summary line |
110
+ | `--auto-add` | automatically stage all changes without confirmation |
111
+ | `--auto-commit` | automatically commit changes without confirmation |
112
+ | `--auto-push` | automatically push changes after commit without confirmation |
113
+ | `--disable-add` | disable adding unstaged changes - exit if no changes staged |
114
+ | `--disable-status` | disable listing the staged files before generating a message |
115
+ | `--disable-preview` | disable previewing the generated message|
116
+ | `--disable-commit` | disable committing changes - exit after generating the message |
117
+ | `--disable-push` | disable pushing changes - exit after making the commit |
118
+ | `--push-no-verify` | bypass git hooks when pushing to Git |
119
+ | `--push-force` | apply force when pushing to Git |
120
+ | `--llm-list` | display a list of available Large Language Models and exit |
121
+ | `--llm-compare` | compare the generated messages from all models - but do not commit |
122
+ | `--llm-router` | prefer to access the LLM via a router rather than direct |
123
+ | `--llm-fallback` | use the fallback LLM model instead of the default |
124
+ | `--llm-model MODEL` | choose the LLM model by name (the default is normally best) |
125
+ | `--llm-excludes MODELS` | models to exclude from comparison (comma separated) |
126
+ | `--silent` | suppress all normal output - errors and aborts still display |
127
+ | `--debug-llm-inputs` | show inputs (including all prompts) sent to the LLM |
128
+ | `--debug-llm-outputs` | show outputs received from the LLM |
129
+
130
+ ## Files containing secrets
131
+
132
+ Files containing secrets should probably not be in Git. But if they are, you can add an entry to a `.gitattributes` file with value `-diff` to prevent them being viewable by a Git diff. This will prevent DiffDash from sending any contents to the LLM. For example:
133
+
134
+ ```text
135
+ # This is file .gitattributes
136
+
137
+ .env -diff
138
+ ```
139
+
140
+ ## Development
141
+
142
+ To install on your laptop:
143
+
144
+ ```bash
145
+ # Clone the repository
146
+ git clone https://github.com/johnowennixon/diffdash.git
147
+ cd diffdash
148
+
149
+ # Install dependencies
150
+ pnpm install
151
+
152
+ # Build the project
153
+ pnpm run build
154
+
155
+ # Make binaries executable
156
+ npm link
157
+ ```
158
+
159
+ To rebuild after editing:
160
+
161
+ ```bash
162
+ # Lint the code
163
+ pnpm run lint
164
+
165
+ # Fix formatting issues (if required)
166
+ pnpm run fix
167
+
168
+ # Build the project
169
+ pnpm run build
170
+ ```
171
+
172
+ ## License
173
+
174
+ 0BSD