diffsage 1.2.0__tar.gz

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 (72) hide show
  1. diffsage-1.2.0/LICENSE +21 -0
  2. diffsage-1.2.0/PKG-INFO +471 -0
  3. diffsage-1.2.0/README.md +432 -0
  4. diffsage-1.2.0/pyproject.toml +83 -0
  5. diffsage-1.2.0/setup.cfg +4 -0
  6. diffsage-1.2.0/src/diffsage/__init__.py +0 -0
  7. diffsage-1.2.0/src/diffsage/__main__.py +4 -0
  8. diffsage-1.2.0/src/diffsage/cli.py +38 -0
  9. diffsage-1.2.0/src/diffsage/commands/__init__.py +0 -0
  10. diffsage-1.2.0/src/diffsage/commands/ask.py +62 -0
  11. diffsage-1.2.0/src/diffsage/commands/auth.py +153 -0
  12. diffsage-1.2.0/src/diffsage/commands/commit.py +125 -0
  13. diffsage-1.2.0/src/diffsage/commands/config.py +216 -0
  14. diffsage-1.2.0/src/diffsage/commands/doctor.py +18 -0
  15. diffsage-1.2.0/src/diffsage/config/__init__.py +0 -0
  16. diffsage-1.2.0/src/diffsage/config/defaults.py +20 -0
  17. diffsage-1.2.0/src/diffsage/config/file_loader.py +21 -0
  18. diffsage-1.2.0/src/diffsage/config/loader.py +8 -0
  19. diffsage-1.2.0/src/diffsage/config/paths.py +61 -0
  20. diffsage-1.2.0/src/diffsage/config/resolver.py +118 -0
  21. diffsage-1.2.0/src/diffsage/config/schema.py +53 -0
  22. diffsage-1.2.0/src/diffsage/config/scope.py +8 -0
  23. diffsage-1.2.0/src/diffsage/config/settings.py +9 -0
  24. diffsage-1.2.0/src/diffsage/exceptions/__init__.py +34 -0
  25. diffsage-1.2.0/src/diffsage/exceptions/base.py +32 -0
  26. diffsage-1.2.0/src/diffsage/exceptions/credentials.py +8 -0
  27. diffsage-1.2.0/src/diffsage/exceptions/git.py +9 -0
  28. diffsage-1.2.0/src/diffsage/exceptions/provider.py +17 -0
  29. diffsage-1.2.0/src/diffsage/git/__init__.py +0 -0
  30. diffsage-1.2.0/src/diffsage/git/client.py +155 -0
  31. diffsage-1.2.0/src/diffsage/logging/__init__.py +0 -0
  32. diffsage-1.2.0/src/diffsage/logging/formatter.py +0 -0
  33. diffsage-1.2.0/src/diffsage/logging/logger.py +41 -0
  34. diffsage-1.2.0/src/diffsage/models/__init__.py +0 -0
  35. diffsage-1.2.0/src/diffsage/models/commit_message.py +9 -0
  36. diffsage-1.2.0/src/diffsage/models/config.py +16 -0
  37. diffsage-1.2.0/src/diffsage/models/credentials.py +8 -0
  38. diffsage-1.2.0/src/diffsage/models/doctor.py +13 -0
  39. diffsage-1.2.0/src/diffsage/models/git.py +32 -0
  40. diffsage-1.2.0/src/diffsage/models/provider.py +20 -0
  41. diffsage-1.2.0/src/diffsage/parsers/commit_message_parser.py +43 -0
  42. diffsage-1.2.0/src/diffsage/prompts/__init__.py +0 -0
  43. diffsage-1.2.0/src/diffsage/providers/__init__.py +0 -0
  44. diffsage-1.2.0/src/diffsage/providers/base.py +8 -0
  45. diffsage-1.2.0/src/diffsage/providers/factory.py +14 -0
  46. diffsage-1.2.0/src/diffsage/providers/gemini_provider.py +77 -0
  47. diffsage-1.2.0/src/diffsage/services/__init__.py +0 -0
  48. diffsage-1.2.0/src/diffsage/services/ai_service.py +63 -0
  49. diffsage-1.2.0/src/diffsage/services/commit_service.py +38 -0
  50. diffsage-1.2.0/src/diffsage/services/config_service.py +109 -0
  51. diffsage-1.2.0/src/diffsage/services/credentials_service.py +61 -0
  52. diffsage-1.2.0/src/diffsage/services/doctor_service.py +47 -0
  53. diffsage-1.2.0/src/diffsage/services/editor_service.py +75 -0
  54. diffsage-1.2.0/src/diffsage/services/git_service.py +20 -0
  55. diffsage-1.2.0/src/diffsage/services/prompt_service.py +60 -0
  56. diffsage-1.2.0/src/diffsage/storage/__init__.py +0 -0
  57. diffsage-1.2.0/src/diffsage/storage/base.py +0 -0
  58. diffsage-1.2.0/src/diffsage/storage/config_repository.py +85 -0
  59. diffsage-1.2.0/src/diffsage/storage/credentials_repository.py +121 -0
  60. diffsage-1.2.0/src/diffsage/ui/__init__.py +0 -0
  61. diffsage-1.2.0/src/diffsage/ui/ask_view.py +10 -0
  62. diffsage-1.2.0/src/diffsage/ui/auth_view.py +51 -0
  63. diffsage-1.2.0/src/diffsage/ui/base.py +15 -0
  64. diffsage-1.2.0/src/diffsage/ui/commit_view.py +100 -0
  65. diffsage-1.2.0/src/diffsage/ui/config_view.py +58 -0
  66. diffsage-1.2.0/src/diffsage/ui/doctor_view.py +39 -0
  67. diffsage-1.2.0/src/diffsage.egg-info/PKG-INFO +471 -0
  68. diffsage-1.2.0/src/diffsage.egg-info/SOURCES.txt +70 -0
  69. diffsage-1.2.0/src/diffsage.egg-info/dependency_links.txt +1 -0
  70. diffsage-1.2.0/src/diffsage.egg-info/entry_points.txt +2 -0
  71. diffsage-1.2.0/src/diffsage.egg-info/requires.txt +18 -0
  72. diffsage-1.2.0/src/diffsage.egg-info/top_level.txt +1 -0
diffsage-1.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Gunitha Rathnayake
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,471 @@
1
+ Metadata-Version: 2.4
2
+ Name: diffsage
3
+ Version: 1.2.0
4
+ Summary: AI-powered Git workflow assistant
5
+ Author: Gunitha Rathnayake
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/GunithaR/Diffsage
8
+ Project-URL: Repository, https://github.com/GunithaR/Diffsage
9
+ Project-URL: Issues, https://github.com/GunithaR/Diffsage/issues
10
+ Keywords: git,ai,cli,developer-tools,commit
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Topic :: Software Development :: Version Control :: Git
18
+ Requires-Python: <3.13,>=3.12
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: typer<0.28,>=0.27
22
+ Requires-Dist: click<9,>=8.3.3
23
+ Requires-Dist: rich<15,>=14
24
+ Requires-Dist: pydantic<3,>=2.11
25
+ Requires-Dist: platformdirs>=4.0.0
26
+ Requires-Dist: tomlkit<1,>=0.13
27
+ Requires-Dist: httpx<0.29,>=0.28
28
+ Requires-Dist: PyYAML<7,>=6.0
29
+ Requires-Dist: python-dotenv<2,>=1.1
30
+ Requires-Dist: google-genai<2,>=1
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest<10,>=9; extra == "dev"
33
+ Requires-Dist: pytest-cov<7,>=6; extra == "dev"
34
+ Requires-Dist: ruff<0.13,>=0.12; extra == "dev"
35
+ Requires-Dist: pre-commit<5,>=4; extra == "dev"
36
+ Requires-Dist: build<2,>=1; extra == "dev"
37
+ Requires-Dist: pip-audit<3,>=2; extra == "dev"
38
+ Dynamic: license-file
39
+
40
+ # DiffSage
41
+
42
+ > **An AI-aware Git workflow toolkit for developers, automation, and AI agents.**
43
+
44
+ DiffSage is a modern command-line toolkit that enhances Git workflows with AI while keeping **Git as the single source of truth**. Rather than replacing Git or competing with AI coding assistants, DiffSage provides a reliable, structured interface that helps developers and automation execute Git workflows consistently.
45
+
46
+ ---
47
+
48
+ ## Why DiffSage?
49
+
50
+ AI coding assistants have dramatically improved code generation, but Git workflows still require reliable execution, proper validation, and consistent handling of repository state.
51
+
52
+ Today, developers often rely on:
53
+
54
+ - Manual Git commands
55
+ - Shell scripts
56
+ - AI-generated terminal commands
57
+ - Ad-hoc automation
58
+
59
+ Each approach solves part of the problem but leaves Git workflow logic scattered across tools.
60
+
61
+ DiffSage centralizes that logic into a single toolkit.
62
+
63
+ Instead of reinventing Git operations in every script or AI workflow, developers and automation can invoke DiffSage commands that handle repository validation, Git interactions, AI integration, and workflow execution through a consistent interface.
64
+
65
+ ---
66
+
67
+ # Philosophy
68
+
69
+ DiffSage is built around several core principles.
70
+
71
+ ### Git remains the source of truth
72
+
73
+ DiffSage builds on top of Git.
74
+
75
+ It never replaces Git.
76
+
77
+ Every operation ultimately delegates to Git while providing a safer and more consistent developer experience.
78
+
79
+ ### AI assists — it doesn't control
80
+
81
+ Artificial intelligence enhances Git workflows by generating suggestions, summaries, and explanations.
82
+
83
+ The developer always retains the final decision.
84
+
85
+ ### Reliability over cleverness
86
+
87
+ Predictable workflows are more valuable than overly complex automation.
88
+
89
+ Every feature should prioritize correctness, validation, and graceful failure.
90
+
91
+ ### Designed for automation
92
+
93
+ DiffSage is designed to be consumed by:
94
+
95
+ - Developers
96
+ - Automation scripts
97
+ - AI agents
98
+
99
+ Each consumer interacts through the same consistent interface.
100
+
101
+ ---
102
+
103
+ # Features
104
+
105
+ Current capabilities include:
106
+
107
+ - AI-assisted Conventional Commit generation
108
+ - Interactive commit workflow
109
+ - Commit message editing using the user's preferred editor
110
+ - Commit message regeneration
111
+ - Global, local, and resolved configuration management
112
+ - Git repository validation
113
+ - Environment diagnostics via `diffsage doctor`
114
+ - Provider abstraction for AI integrations
115
+ - Provider credential management with named profiles
116
+ - AI provider authentication and error handling
117
+ - Layered architecture
118
+ - Comprehensive automated test suite
119
+
120
+ ---
121
+
122
+ # What DiffSage Is
123
+
124
+ DiffSage is:
125
+
126
+ - An AI-aware Git workflow toolkit
127
+ - A command-line application
128
+ - Git-first
129
+ - Automation-friendly
130
+ - Extensible through a layered architecture
131
+ - Designed for both developers and AI-driven workflows
132
+
133
+ ---
134
+
135
+ # What DiffSage Is Not
136
+
137
+ DiffSage is **not**:
138
+
139
+ - A Git replacement
140
+ - A code editor
141
+ - A chatbot
142
+ - A code generation platform
143
+ - A project management tool
144
+ - An IDE replacement
145
+ - A general-purpose AI assistant
146
+
147
+ Its scope is intentionally focused on improving Git workflows.
148
+
149
+ ---
150
+
151
+ # Project Status
152
+
153
+ > **Current Stage:** Active Development
154
+
155
+ DiffSage is currently under active development.
156
+
157
+ The project is being developed privately while the core architecture, documentation, and workflow foundation are finalized.
158
+
159
+ The long-term goal is to open source the project once it reaches a stable and well-documented foundation.
160
+
161
+ ---
162
+
163
+ # Installation
164
+
165
+ Clone the repository:
166
+
167
+ ```bash
168
+ git clone <repository-url>
169
+ cd DiffSage
170
+ ```
171
+
172
+ Create a virtual environment:
173
+
174
+ ```bash
175
+ python -m venv .venv
176
+ ```
177
+
178
+ Activate it:
179
+
180
+ macOS / Linux
181
+
182
+ ```bash
183
+ source .venv/bin/activate
184
+ ```
185
+
186
+ Windows
187
+
188
+ ```powershell
189
+ .venv\Scripts\activate
190
+ ```
191
+
192
+ Install the project:
193
+
194
+ ```bash
195
+ pip install -e ".[dev]"
196
+ ```
197
+
198
+ ---
199
+
200
+ # Configuration
201
+
202
+ DiffSage supports layered configuration through global and repository-local TOML files.
203
+
204
+ Application configuration controls how DiffSage behaves and can be managed through global, repository-local, and environment-based configuration.
205
+
206
+ Provider credentials are managed separately from application configuration.
207
+ Provider credentials are managed separately from application configuration and are not part of the Settings configuration model.
208
+
209
+ ```env
210
+ DIFFSAGE_PROVIDER=gemini
211
+ DIFFSAGE_AI_MODEL=gemini-3.5-flash-lite
212
+ DIFFSAGE_LOG_LEVEL=INFO
213
+ DIFFSAGE_TIMEOUT=60
214
+ DIFFSAGE_MAX_RETRIES=3
215
+ ```
216
+
217
+ Configuration can also be managed directly from the CLI:
218
+
219
+ ```bash
220
+ diffsage config list
221
+ diffsage config get provider
222
+ diffsage config set provider gemini
223
+ diffsage config unset provider
224
+ ```
225
+
226
+ ---
227
+
228
+ # Quick Start
229
+
230
+ Set up your provider credential:
231
+
232
+ ```bash
233
+ diffsage auth set gemini YOUR_API_KEY
234
+ ```
235
+
236
+ Verify your environment:
237
+
238
+ ```bash
239
+ diffsage doctor
240
+ ```
241
+
242
+ View the current configuration:
243
+
244
+ ```bash
245
+ diffsage config list
246
+ ```
247
+
248
+ Ask the configured AI provider a question:
249
+
250
+ ```bash
251
+ diffsage ask "Explain the current staged changes"
252
+ ```
253
+
254
+ Generate a commit message:
255
+
256
+ ```bash
257
+ diffsage commit
258
+ ```
259
+
260
+ Interactive workflow:
261
+
262
+ ```text
263
+ Generate commit message
264
+ │
265
+ ▼
266
+ Display AI suggestion
267
+ │
268
+ ▼
269
+ [Y] Commit
270
+ [E] Edit
271
+ [R] Regenerate
272
+ [N] Cancel
273
+ ```
274
+
275
+ Named credential profiles are also supported:
276
+
277
+ ```bash
278
+
279
+ diffsage auth set gemini YOUR_API_KEY --name paid
280
+ ```
281
+
282
+ View configured credentials:
283
+
284
+ ```bash
285
+ diffsage auth list
286
+ diffsage auth get gemini
287
+ ```
288
+
289
+ Remove a credential:
290
+
291
+ ```bash
292
+ diffsage auth unset gemini
293
+ ```
294
+
295
+ ---
296
+
297
+ # Commands
298
+
299
+ | Command | Description |
300
+ |----------|-------------|
301
+ | `diffsage doctor` | Validate the local DiffSage environment |
302
+ | `diffsage commit` | Generate and manage AI-assisted commit messages |
303
+ | `diffsage config list` | Display the current DiffSage configuration |
304
+ | `diffsage config get` | Display the value of a configuration setting |
305
+ | `diffsage config set` | Update a configuration setting |
306
+ | `diffsage config unset` | Remove a configuration setting |
307
+ | `diffsage auth set` | Store a provider credential |
308
+ | `diffsage auth get` | Display a credential with the API key masked |
309
+ | `diffsage auth list` | List configured credentials |
310
+ | `diffsage auth unset` | Remove a provider credential |
311
+ | `diffsage ask` | Ask the configured AI provider a question |
312
+
313
+ More commands will be introduced as the project evolves.
314
+
315
+ ---
316
+
317
+ # Architecture Overview
318
+
319
+ DiffSage follows a layered architecture to separate responsibilities and improve maintainability.
320
+
321
+ ```text
322
+ CLI
323
+ │
324
+ ▼
325
+ Commands
326
+ │
327
+ ├── Configuration
328
+ │
329
+ ├── Authentication
330
+ │
331
+ ▼
332
+ Services
333
+ │
334
+ ├── Git
335
+ ├── AI
336
+ ├── Prompt Generation
337
+ └── Credentials
338
+ │
339
+ ▼
340
+ Providers / Storage
341
+ ```
342
+
343
+ Key architectural principles include:
344
+
345
+ - Single Responsibility Principle
346
+ - Separation of concerns
347
+ - Dependency inversion
348
+ - Provider abstraction
349
+ - Testability
350
+ - Extensibility
351
+
352
+ Detailed documentation is available under the `docs/` directory.
353
+
354
+ ---
355
+
356
+ # Project Structure
357
+
358
+ ```text
359
+ src/
360
+ └── diffsage/
361
+ ├── commands/
362
+ ├── config/
363
+ ├── exceptions/
364
+ ├── git/
365
+ ├── logging/
366
+ ├── models/
367
+ ├── parsers/
368
+ ├── prompts/
369
+ ├── providers/
370
+ ├── services/
371
+ ├── storage/
372
+ └── ui/
373
+
374
+ tests/
375
+
376
+ docs/
377
+ ```
378
+
379
+ ---
380
+
381
+ # Documentation
382
+
383
+ Additional project documentation is available within the repository.
384
+
385
+ | Document | Purpose |
386
+ |----------|---------|
387
+ | `docs/architecture.md` | High-level architecture |
388
+ | `docs/conventions.md` | Coding conventions and project standards |
389
+ | `docs/vision.md` | Project vision and scope |
390
+ | `docs/changelog.md` | Project changes and milestones |
391
+ | `docs/adrs/ADR-*` | Architecture Decision Records (ADRs) |
392
+
393
+ Future documentation will include:
394
+
395
+ - Contributing Guide
396
+
397
+ ---
398
+
399
+ # Roadmap
400
+
401
+ The long-term roadmap focuses on strengthening Git workflows rather than expanding into unrelated developer tooling.
402
+
403
+ Planned capabilities include:
404
+
405
+ - Pull request generation
406
+ - Branch naming assistance
407
+ - Merge assistance
408
+ - Repository summaries
409
+ - Git workflow automation
410
+ - Machine-readable output for automation
411
+ - Additional AI provider integrations
412
+
413
+ Every planned feature must satisfy the project's mission:
414
+
415
+ > **Improve Git workflows while making them more reliable and easier to automate.**
416
+
417
+ ---
418
+
419
+ # AI-Agent Compatibility
420
+
421
+ DiffSage is designed to work equally well for humans and automation.
422
+
423
+ Instead of requiring every automation tool or AI agent to implement Git workflow logic independently, DiffSage provides a reusable interface that encapsulates:
424
+
425
+ - Repository validation
426
+ - Git operations
427
+ - AI integration
428
+ - Workflow execution
429
+ - Error handling
430
+
431
+ This allows developers, scripts, and AI-driven workflows to interact with Git through a consistent, well-defined toolkit.
432
+
433
+ DiffSage does **not** replace AI coding assistants.
434
+
435
+ Instead, it complements them by providing reliable Git workflow capabilities.
436
+
437
+ ---
438
+
439
+ # Design Principles
440
+
441
+ Every feature in DiffSage should satisfy the following principles:
442
+
443
+ - Strengthen Git workflows
444
+ - Improve workflow reliability
445
+ - Simplify automation
446
+ - Preserve human control
447
+ - Maintain architectural consistency
448
+
449
+ Features that fall outside these principles intentionally remain out of scope.
450
+
451
+ ---
452
+
453
+ # Contributing
454
+
455
+ Contribution guidelines will be published when the project becomes publicly available.
456
+
457
+ Future contributors will be encouraged to review:
458
+
459
+ - Architecture documentation
460
+ - Coding conventions
461
+ - ADRs
462
+
463
+ before submitting changes.
464
+
465
+ ---
466
+
467
+ # License
468
+
469
+ This project is licensed under the MIT License.
470
+
471
+ See the `LICENSE` file for details.