smart-commit-cli 0.1.0__py3-none-any.whl → 0.2.0__py3-none-any.whl
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.
- smart_commit/git/scanner.py +4 -0
- smart_commit/git/service.py +2 -0
- {smart_commit_cli-0.1.0.dist-info → smart_commit_cli-0.2.0.dist-info}/METADATA +2 -317
- {smart_commit_cli-0.1.0.dist-info → smart_commit_cli-0.2.0.dist-info}/RECORD +6 -6
- {smart_commit_cli-0.1.0.dist-info → smart_commit_cli-0.2.0.dist-info}/WHEEL +0 -0
- {smart_commit_cli-0.1.0.dist-info → smart_commit_cli-0.2.0.dist-info}/entry_points.txt +0 -0
smart_commit/git/scanner.py
CHANGED
|
@@ -138,6 +138,8 @@ class RepositoryScanner:
|
|
|
138
138
|
["git", *args],
|
|
139
139
|
cwd=self.repo_path,
|
|
140
140
|
text=True,
|
|
141
|
+
encoding="utf-8",
|
|
142
|
+
errors="replace",
|
|
141
143
|
capture_output=True,
|
|
142
144
|
check=False,
|
|
143
145
|
)
|
|
@@ -151,6 +153,8 @@ class RepositoryScanner:
|
|
|
151
153
|
["git", "rev-parse", "--show-toplevel"],
|
|
152
154
|
cwd=path,
|
|
153
155
|
text=True,
|
|
156
|
+
encoding="utf-8",
|
|
157
|
+
errors="replace",
|
|
154
158
|
capture_output=True,
|
|
155
159
|
check=False,
|
|
156
160
|
)
|
smart_commit/git/service.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: smart-commit-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: AI-powered Git commit automation
|
|
5
5
|
Author: Smart Commit Contributors
|
|
6
6
|
License: MIT
|
|
@@ -439,7 +439,7 @@ Step 7: Creating commits...
|
|
|
439
439
|
|
|
440
440
|
## Roadmap
|
|
441
441
|
|
|
442
|
-
- [
|
|
442
|
+
- [x] Interactive commit editing
|
|
443
443
|
- [ ] Learning mode (observes user edits)
|
|
444
444
|
- [ ] IDE extensions (VS Code, JetBrains)
|
|
445
445
|
- [ ] Pull request generation
|
|
@@ -485,320 +485,5 @@ Smart Commit builds on:
|
|
|
485
485
|
|
|
486
486
|
**Made with ❤️ to make Git history beautiful**
|
|
487
487
|
|
|
488
|
-
## Installation
|
|
489
|
-
|
|
490
|
-
### Requirements
|
|
491
|
-
- Python 3.12+
|
|
492
|
-
- Git
|
|
493
|
-
|
|
494
|
-
### From PyPI (Coming Soon)
|
|
495
|
-
|
|
496
|
-
```bash
|
|
497
|
-
pip install smart-commit
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
### From Source
|
|
501
|
-
|
|
502
|
-
```bash
|
|
503
|
-
git clone https://github.com/hamxa296/Smart-Commit.git
|
|
504
|
-
cd Smart-Commit
|
|
505
|
-
pip install -e .
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
### Install Dependencies
|
|
509
|
-
|
|
510
|
-
```bash
|
|
511
|
-
pip install -r requirements.txt
|
|
512
|
-
```
|
|
513
|
-
|
|
514
|
-
## Quick Start
|
|
515
|
-
|
|
516
|
-
### Initialize Smart Commit
|
|
517
|
-
|
|
518
|
-
```bash
|
|
519
|
-
smart-commit init
|
|
520
|
-
```
|
|
521
|
-
|
|
522
|
-
### Configure Your LLM
|
|
523
|
-
|
|
524
|
-
```bash
|
|
525
|
-
smart-commit config --provider openrouter --model anthropic/claude-sonnet --api-key YOUR_KEY
|
|
526
|
-
```
|
|
527
|
-
|
|
528
|
-
Or set environment variables:
|
|
529
|
-
|
|
530
|
-
```bash
|
|
531
|
-
export SMART_COMMIT_PROVIDER=openrouter
|
|
532
|
-
export SMART_COMMIT_MODEL=anthropic/claude-sonnet
|
|
533
|
-
export SMART_COMMIT_API_KEY=your-api-key
|
|
534
|
-
```
|
|
535
|
-
|
|
536
|
-
### Run Smart Commit
|
|
537
|
-
|
|
538
|
-
```bash
|
|
539
|
-
smart-commit run
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
This will:
|
|
543
|
-
1. Detect all changed files
|
|
544
|
-
2. Analyze diffs and create summaries
|
|
545
|
-
3. Generate semantic embeddings
|
|
546
|
-
4. Cluster related files
|
|
547
|
-
5. Display a preview of proposed commits
|
|
548
|
-
6. Execute commits upon confirmation
|
|
549
|
-
|
|
550
|
-
## Commands
|
|
551
|
-
|
|
552
|
-
```bash
|
|
553
|
-
# Analyze and create commits
|
|
554
|
-
smart-commit run
|
|
555
|
-
|
|
556
|
-
# Preview without executing
|
|
557
|
-
smart-commit preview
|
|
558
|
-
|
|
559
|
-
# Undo last session
|
|
560
|
-
smart-commit undo
|
|
561
|
-
|
|
562
|
-
# Configure settings
|
|
563
|
-
smart-commit config --show
|
|
564
|
-
|
|
565
|
-
# Diagnostic checks
|
|
566
|
-
smart-commit doctor
|
|
567
|
-
|
|
568
|
-
# Show version
|
|
569
|
-
smart-commit version
|
|
570
|
-
|
|
571
|
-
# Initialize repository
|
|
572
|
-
smart-commit init
|
|
573
|
-
```
|
|
574
|
-
|
|
575
|
-
## Architecture
|
|
576
|
-
|
|
577
|
-
The tool follows a modular pipeline:
|
|
578
|
-
|
|
579
|
-
```
|
|
580
|
-
Repository
|
|
581
|
-
↓
|
|
582
|
-
Git Scanner (git_service.py)
|
|
583
|
-
↓
|
|
584
|
-
Diff Parser (diff_parser.py)
|
|
585
|
-
↓
|
|
586
|
-
File Summarizer (summarizer.py)
|
|
587
|
-
↓
|
|
588
|
-
Embedding Generator (embeddings.py)
|
|
589
|
-
↓
|
|
590
|
-
Semantic Clustering (clustering.py)
|
|
591
|
-
↓
|
|
592
|
-
LLM Cluster Review (ai.py)
|
|
593
|
-
↓
|
|
594
|
-
Commit Message Generator (commit_messages.py)
|
|
595
|
-
↓
|
|
596
|
-
Interactive Preview (preview.py)
|
|
597
|
-
↓
|
|
598
|
-
Git Commit Executor (committer.py)
|
|
599
|
-
```
|
|
600
|
-
|
|
601
|
-
## Configuration
|
|
602
|
-
|
|
603
|
-
Smart Commit looks for configuration in this order:
|
|
604
|
-
|
|
605
|
-
1. `~/.smart_commit/config.yaml`
|
|
606
|
-
2. Environment variables (`SMART_COMMIT_*`)
|
|
607
|
-
3. Default values
|
|
608
|
-
|
|
609
|
-
### Example config.yaml
|
|
610
|
-
|
|
611
|
-
```yaml
|
|
612
|
-
provider: openrouter
|
|
613
|
-
model: anthropic/claude-sonnet
|
|
614
|
-
embedding_model: all-MiniLM-L6-v2
|
|
615
|
-
max_files_per_commit: 8
|
|
616
|
-
interactive: true
|
|
617
|
-
auto_push: false
|
|
618
|
-
conventional_commits: true
|
|
619
|
-
use_local_embeddings: true
|
|
620
|
-
```
|
|
621
|
-
|
|
622
|
-
## Supported LLM Providers
|
|
623
|
-
|
|
624
|
-
Smart Commit uses [LiteLLM](https://github.com/BerriAI/litellm) to support:
|
|
625
|
-
|
|
626
|
-
- OpenRouter
|
|
627
|
-
- OpenAI
|
|
628
|
-
- Anthropic
|
|
629
|
-
- Gemini
|
|
630
|
-
- Groq
|
|
631
|
-
- Azure OpenAI
|
|
632
|
-
- Local models (Ollama, LM Studio, etc.)
|
|
633
|
-
|
|
634
|
-
## Development
|
|
635
|
-
|
|
636
|
-
### Project Structure
|
|
637
|
-
|
|
638
|
-
```
|
|
639
|
-
smart_commit/
|
|
640
|
-
├── __init__.py
|
|
641
|
-
├── cli.py # Command-line interface
|
|
642
|
-
├── config.py # Configuration management
|
|
643
|
-
├── models.py # Data models
|
|
644
|
-
├── utils.py # Utility functions
|
|
645
|
-
├── git_service.py # Git operations
|
|
646
|
-
├── diff_parser.py # Diff parsing
|
|
647
|
-
├── summarizer.py # Summary generation
|
|
648
|
-
├── embeddings.py # Embedding generation
|
|
649
|
-
├── clustering.py # File clustering
|
|
650
|
-
├── ai.py # LLM analysis
|
|
651
|
-
├── commit_messages.py # Message generation
|
|
652
|
-
├── preview.py # Interactive UI
|
|
653
|
-
└── committer.py # Commit execution
|
|
654
|
-
tests/
|
|
655
|
-
├── __init__.py
|
|
656
|
-
├── test_git_service.py
|
|
657
|
-
├── test_diff_parser.py
|
|
658
|
-
└── test_clustering.py
|
|
659
|
-
pyproject.toml
|
|
660
|
-
README.md
|
|
661
|
-
```
|
|
662
|
-
|
|
663
|
-
### Development Setup
|
|
664
|
-
|
|
665
|
-
```bash
|
|
666
|
-
# Clone the repository
|
|
667
|
-
git clone https://github.com/hamxa296/Smart-Commit.git
|
|
668
|
-
cd Smart-Commit
|
|
669
|
-
|
|
670
|
-
# Create virtual environment
|
|
671
|
-
python -m venv venv
|
|
672
|
-
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
673
|
-
|
|
674
|
-
# Install in development mode with dev dependencies
|
|
675
|
-
pip install -e ".[dev]"
|
|
676
|
-
|
|
677
|
-
# Run tests
|
|
678
|
-
pytest
|
|
679
|
-
|
|
680
|
-
# Run linting
|
|
681
|
-
ruff check smart_commit tests
|
|
682
|
-
black --check smart_commit tests
|
|
683
|
-
|
|
684
|
-
# Format code
|
|
685
|
-
black smart_commit tests
|
|
686
|
-
ruff check --fix smart_commit tests
|
|
687
|
-
```
|
|
688
|
-
|
|
689
|
-
## Milestones
|
|
690
|
-
|
|
691
|
-
### Milestone 1: ✅ Foundation (Complete)
|
|
692
|
-
- Repository detection
|
|
693
|
-
- Changed file discovery
|
|
694
|
-
- Git wrapper
|
|
695
|
-
- Deliverable: Basic repository scanner
|
|
696
|
-
|
|
697
|
-
### Milestone 2: In Progress
|
|
698
|
-
- Diff parser
|
|
699
|
-
- Structured diff representation
|
|
700
|
-
- Deliverable: Readable summaries of code changes
|
|
701
|
-
|
|
702
|
-
### Milestone 3: Planned
|
|
703
|
-
- Rule-based grouping
|
|
704
|
-
- Conventional Commit generation
|
|
705
|
-
- Terminal preview
|
|
706
|
-
- Deliverable: Working MVP
|
|
707
|
-
|
|
708
|
-
### Milestone 4: Planned
|
|
709
|
-
- Embedding generation
|
|
710
|
-
- Semantic clustering
|
|
711
|
-
- Deliverable: Cross-folder logical commit grouping
|
|
712
|
-
|
|
713
|
-
### Milestone 5: Planned
|
|
714
|
-
- LLM cluster refinement
|
|
715
|
-
- AI-generated commit messages
|
|
716
|
-
- Deliverable: High-quality commit history
|
|
717
|
-
|
|
718
|
-
### Milestone 6: Planned
|
|
719
|
-
- Interactive editing
|
|
720
|
-
- Undo support
|
|
721
|
-
- Session management
|
|
722
|
-
- Deliverable: Production-ready CLI
|
|
723
|
-
|
|
724
|
-
### Milestone 7: Planned
|
|
725
|
-
- Learning mode
|
|
726
|
-
- Plugins
|
|
727
|
-
- IDE integration
|
|
728
|
-
- PR generation
|
|
729
|
-
- PyPI packaging
|
|
730
|
-
- Deliverable: Polished, extensible developer tool
|
|
731
|
-
|
|
732
|
-
## Why Smart Commit?
|
|
733
|
-
|
|
734
|
-
### Without Smart Commit
|
|
735
|
-
```
|
|
736
|
-
$ git status
|
|
737
|
-
modified: src/auth/login.ts
|
|
738
|
-
modified: src/api/routes.ts
|
|
739
|
-
modified: README.md
|
|
740
|
-
modified: src/auth/jwt.ts
|
|
741
|
-
|
|
742
|
-
$ git add src/auth/login.ts
|
|
743
|
-
$ git add src/auth/jwt.ts
|
|
744
|
-
$ git commit -m "feat(auth): improve login validation"
|
|
745
|
-
# 15 min later...
|
|
746
|
-
```
|
|
747
|
-
|
|
748
|
-
### With Smart Commit
|
|
749
|
-
```
|
|
750
|
-
$ smart-commit run
|
|
751
|
-
Found 4 changed files
|
|
752
|
-
|
|
753
|
-
✓ Proposed commits:
|
|
754
|
-
1. feat(auth): improve login validation and session handling
|
|
755
|
-
2. docs: update README
|
|
756
|
-
|
|
757
|
-
$ [accept] to execute, [e]dit to modify, [s]plit to separate
|
|
758
|
-
# 30 seconds later...
|
|
759
|
-
```
|
|
760
|
-
|
|
761
|
-
## Contributing
|
|
762
|
-
|
|
763
|
-
We welcome contributions! Areas where help is needed:
|
|
764
|
-
|
|
765
|
-
- [ ] Improve diff parsing for different languages
|
|
766
|
-
- [ ] Add support for more LLM providers
|
|
767
|
-
- [ ] Implement learning mode for user preferences
|
|
768
|
-
- [ ] Create IDE extensions (VS Code, JetBrains)
|
|
769
|
-
- [ ] Optimize clustering algorithm
|
|
770
|
-
- [ ] Add comprehensive test coverage
|
|
771
|
-
- [ ] Documentation improvements
|
|
772
|
-
|
|
773
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
774
|
-
|
|
775
|
-
## License
|
|
776
|
-
|
|
777
|
-
MIT License - See [LICENSE](LICENSE) file for details.
|
|
778
|
-
|
|
779
|
-
## Authors
|
|
780
|
-
|
|
781
|
-
- Smart Commit Contributors
|
|
782
|
-
|
|
783
|
-
## Support
|
|
784
|
-
|
|
785
|
-
- 📖 Documentation: See [docs/](docs/) directory
|
|
786
|
-
- 🐛 Bug Reports: GitHub Issues
|
|
787
|
-
- 💬 Discussions: GitHub Discussions
|
|
788
|
-
- 📧 Email: support@smartcommit.dev
|
|
789
|
-
|
|
790
|
-
## Roadmap
|
|
791
|
-
|
|
792
|
-
- [ ] Interactive commit editing
|
|
793
|
-
- [ ] Learning mode for user preferences
|
|
794
|
-
- [ ] Framework-specific plugins (React, Django, Next.js, etc.)
|
|
795
|
-
- [ ] IDE extensions (VS Code, Cursor, Windsurf, JetBrains)
|
|
796
|
-
- [ ] Pull request generation
|
|
797
|
-
- [ ] CI/CD integration
|
|
798
|
-
- [ ] Team mode with shared configurations
|
|
799
|
-
- [ ] Analytics and insights
|
|
800
|
-
|
|
801
|
-
---
|
|
802
488
|
|
|
803
|
-
**Made with ❤️ for better Git workflows**
|
|
804
489
|
|
|
@@ -37,8 +37,8 @@ smart_commit/execution/__init__.py,sha256=Ze7wnPjymbCh6YaXoIHIvu7aCUYlsx_UeAvjIi
|
|
|
37
37
|
smart_commit/execution/committer.py,sha256=wQspY3IBFoDQ2tPra9Bt_3UW3vegzpSCYgY96VRhDw4,3346
|
|
38
38
|
smart_commit/git/__init__.py,sha256=C2aOYmBvjfZf5Fu3UIkX2HomWMWI3D5lYcuxXaRjBwc,209
|
|
39
39
|
smart_commit/git/safety.py,sha256=ejy-CfX7hmiE7nV68KPRodnaN_Lwwze013Uv_xZkfoQ,2043
|
|
40
|
-
smart_commit/git/scanner.py,sha256=
|
|
41
|
-
smart_commit/git/service.py,sha256=
|
|
40
|
+
smart_commit/git/scanner.py,sha256=waGOoh2zDeusmfDRtPp_J9tY10MaqQd6bLdUIz_FMBY,6713
|
|
41
|
+
smart_commit/git/service.py,sha256=owvkp8qs2RXFCqm4jpUKbn09ltyGlKIV1LwibB_5kY8,4667
|
|
42
42
|
smart_commit/plugins/__init__.py,sha256=G09Tan4GW0IJpdcPHqsq2ZjyI_DlRVzOLzbELAOR3wE,118
|
|
43
43
|
smart_commit/plugins/base.py,sha256=EYRPfJDEtFa3GwCOabXJ6M5K1ywgSDk7wEomKGZOtRg,3626
|
|
44
44
|
smart_commit/plugins/django.py,sha256=zTwrqMgWOTiDShaL-8G1o185r-rUVlalami44AdLDpQ,1185
|
|
@@ -47,7 +47,7 @@ smart_commit/plugins/react.py,sha256=XgC7laGH3WY_Blo4hY-dovcZbnKUdka0XwwvvKlbQAY
|
|
|
47
47
|
smart_commit/preview/__init__.py,sha256=NbEIdarqxFsnPBOjvA1ByTnvzBob4asKn1EQa8gjtco,159
|
|
48
48
|
smart_commit/preview/editor.py,sha256=f-h2dM30NXG6qfLVMa8-sQ4-QUdWamAEeH2Z8cQ0m5Y,7537
|
|
49
49
|
smart_commit/preview/renderer.py,sha256=BZh-flx3X2t8RaVM_U3BuqkDNNumulD0UHOBGkKJ8oA,4057
|
|
50
|
-
smart_commit_cli-0.
|
|
51
|
-
smart_commit_cli-0.
|
|
52
|
-
smart_commit_cli-0.
|
|
53
|
-
smart_commit_cli-0.
|
|
50
|
+
smart_commit_cli-0.2.0.dist-info/METADATA,sha256=sllTxkL_EswRAwr1xG4fLFgF-8FrHXO2q9nLuZidcQE,12469
|
|
51
|
+
smart_commit_cli-0.2.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
|
|
52
|
+
smart_commit_cli-0.2.0.dist-info/entry_points.txt,sha256=TPu9XAKWRb_MxloF9ba8jYzsF-tLyVSOPpMmakl3BA0,54
|
|
53
|
+
smart_commit_cli-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|