gims 0.5.3 → 0.6.1

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.
package/.gimsrc ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "provider": "gemini",
3
+ "model": "",
4
+ "conventional": true,
5
+ "copy": true,
6
+ "autoStage": false,
7
+ "maxDiffSize": 100000,
8
+ "cacheEnabled": true,
9
+ "progressIndicators": true
10
+ }
@@ -0,0 +1,21 @@
1
+ # GIMS - Git Made Simple
2
+
3
+ GIMS is an AI-powered Git CLI tool that automatically generates meaningful commit messages from code changes. It's designed to replace generic commit messages with descriptive, professional ones that tell a story.
4
+
5
+ ## Core Value Proposition
6
+ - Eliminates the need to write commit messages manually
7
+ - Uses AI (OpenAI, Google Gemini, Groq) to analyze code diffs and generate contextual messages
8
+ - Provides a streamlined Git workflow with single-command operations
9
+ - Supports both local and remote operations with intelligent fallbacks
10
+
11
+ ## Key Features
12
+ - AI-powered commit message generation from code diffs
13
+ - One-command workflow: analyze, commit, and push (`g o`)
14
+ - Smart suggestions with clipboard integration (`g s`)
15
+ - Conventional Commits support
16
+ - Numbered commit history and branch management
17
+ - Safe operations with confirmations and dry-run support
18
+ - Graceful fallbacks for large diffs and offline use
19
+
20
+ ## Target Users
21
+ Developers who want to maintain clean Git history without spending time crafting commit messages, especially those working on projects where commit message quality matters for collaboration and code review.
@@ -0,0 +1,72 @@
1
+ # Project Structure
2
+
3
+ ## Directory Layout
4
+ ```
5
+ gims/
6
+ ├── bin/
7
+ │ └── gims.js # Main CLI executable and entry point
8
+ ├── node_modules/ # npm dependencies (auto-generated)
9
+ ├── .npm-cache/ # npm cache directory (auto-generated)
10
+ ├── .github/ # GitHub workflows and templates
11
+ ├── .git/ # Git repository data
12
+ ├── .kiro/ # Kiro AI assistant configuration
13
+ │ └── steering/ # AI guidance documents
14
+ ├── package.json # Project metadata and dependencies
15
+ ├── package-lock.json # Dependency lock file
16
+ ├── README.md # Comprehensive project documentation
17
+ ├── LICENSE # MIT license
18
+ └── .gitignore # Git ignore patterns
19
+ ```
20
+
21
+ ## Key Files
22
+
23
+ ### `bin/gims.js`
24
+ - **Purpose**: Single-file CLI application containing all functionality
25
+ - **Structure**: Monolithic approach with utility functions, command handlers, and AI integration
26
+ - **Exports**: Executable binary via shebang (`#!/usr/bin/env node`)
27
+ - **Commands**: All CLI commands and subcommands defined in this file
28
+
29
+ ### `package.json`
30
+ - **Binary entries**: `gims` and `g` both point to `bin/gims.js`
31
+ - **Main entry**: Points to `bin/gims.js`
32
+ - **Scripts**: Minimal test script placeholder
33
+ - **Keywords**: Focused on git, cli, ai, commit, developer-tools
34
+
35
+ ### Configuration Files
36
+ - **`.gimsrc`**: Optional JSON config (project root or home directory)
37
+ - **Environment variables**: API keys and default settings
38
+ - **Git integration**: Uses existing `.git` directory and configuration
39
+
40
+ ## Architecture Principles
41
+
42
+ ### Single-File Design
43
+ - All functionality consolidated in `bin/gims.js` for simplicity
44
+ - No separate modules or complex directory structure
45
+ - Easy to understand, debug, and maintain
46
+ - Reduces complexity for a CLI tool
47
+
48
+ ### Command Structure
49
+ - Uses commander.js for CLI parsing and command organization
50
+ - Short aliases for all commands (`g o`, `g s`, `g l`, etc.)
51
+ - Consistent option patterns across commands
52
+ - Global options available to all subcommands
53
+
54
+ ### File Naming Conventions
55
+ - Executable files in `bin/` directory
56
+ - Configuration files use dotfile convention (`.gimsrc`)
57
+ - Standard npm project files (package.json, README.md, LICENSE)
58
+ - No custom file extensions or special naming schemes
59
+
60
+ ## Development Guidelines
61
+
62
+ ### Adding New Features
63
+ - Add new commands directly to `bin/gims.js`
64
+ - Follow existing pattern of command definition with commander.js
65
+ - Maintain consistent error handling and logging patterns
66
+ - Add appropriate help text and examples
67
+
68
+ ### Configuration Management
69
+ - Environment variables for sensitive data (API keys)
70
+ - JSON config files for user preferences
71
+ - Runtime detection and fallback logic
72
+ - Validate configuration at startup when needed
@@ -0,0 +1,68 @@
1
+ # Technology Stack
2
+
3
+ ## Runtime & Language
4
+ - **Node.js**: >= 18.18.0 (Node 20+ recommended)
5
+ - **JavaScript**: CommonJS modules (`"type": "commonjs"`)
6
+ - **Package Manager**: npm (with package-lock.json)
7
+
8
+ ## Core Dependencies
9
+ - **commander**: CLI framework for command parsing and structure
10
+ - **simple-git**: Git operations and repository management
11
+ - **clipboardy**: Cross-platform clipboard operations
12
+ - **@google/genai**: Google Gemini AI integration
13
+ - **openai**: OpenAI API client
14
+
15
+ ## Architecture Patterns
16
+ - Single-file CLI application (`bin/gims.js`)
17
+ - Functional programming approach with utility functions
18
+ - Configuration via environment variables and `.gimsrc` JSON files
19
+ - Graceful fallbacks and error handling throughout
20
+ - ANSI color utilities without external dependencies
21
+
22
+ ## Code Style Conventions
23
+ - Use `const` for immutable values, avoid `var`
24
+ - Prefer template literals for string interpolation
25
+ - Use async/await for asynchronous operations
26
+ - Implement comprehensive error handling with try/catch
27
+ - Keep functions focused and modular
28
+ - Use descriptive variable names (e.g., `rawDiff`, `prefProvider`)
29
+ - Comment complex logic and AI prompt engineering sections
30
+
31
+ ## Common Commands
32
+
33
+ ### Development
34
+ ```bash
35
+ # Install dependencies
36
+ npm install
37
+
38
+ # Test installation
39
+ npm test # Currently returns "No tests yet"
40
+
41
+ # Global installation for testing
42
+ npm install -g .
43
+ ```
44
+
45
+ ### Publishing
46
+ ```bash
47
+ # Update version
48
+ npm version patch|minor|major
49
+
50
+ # Publish to npm
51
+ npm publish
52
+ ```
53
+
54
+ ### Local Development Testing
55
+ ```bash
56
+ # Link for local testing
57
+ npm link
58
+
59
+ # Test CLI commands
60
+ gims --help
61
+ g --help
62
+ ```
63
+
64
+ ## Configuration Management
65
+ - Environment variables for API keys (`OPENAI_API_KEY`, `GEMINI_API_KEY`, `GROQ_API_KEY`)
66
+ - Optional `.gimsrc` JSON config in project root or home directory
67
+ - Runtime provider detection and fallback logic
68
+ - Support for custom models and base URLs
package/CHANGELOG.md ADDED
@@ -0,0 +1,116 @@
1
+ # Changelog
2
+
3
+ ## [0.6.0] - Enhanced GIMS - 2024-12-19
4
+
5
+ ### 🚀 Major Features Added
6
+
7
+ #### **Interactive & Enhanced UX**
8
+ - **Interactive Commit Wizard** (`g int`) - Guided workflow with multiple AI suggestions
9
+ - **Enhanced Status** (`g status`) - Git status with AI insights and project analysis
10
+ - **Preview Mode** (`g preview`) - See commit preview with AI message and diff analysis
11
+ - **Setup Wizard** (`g setup`) - Interactive first-time configuration
12
+ - **Progress Indicators** - Visual feedback for all AI operations
13
+
14
+ #### **Smart Configuration Management**
15
+ - **Config Command** (`g config`) - Manage settings with `--set`, `--get`, `--list`
16
+ - **Project Type Detection** - Automatically detects React, Node, Python, etc.
17
+ - **Enhanced .gimsrc** - More configuration options and better validation
18
+ - **Global vs Local Config** - Project-specific or user-wide settings
19
+
20
+ #### **Advanced Git Operations**
21
+ - **Smart Sync** (`g sync`) - Intelligent pull with rebase/merge options
22
+ - **Enhanced Stash** (`g stash`) - AI-generated stash descriptions
23
+ - **Better Amend** (`g amend`) - Smart amend with AI message generation or `--no-edit`
24
+ - **Enhanced List** (`g ls`) - Unified list command with `--detailed` and `--limit` options
25
+
26
+ #### **AI & Performance Improvements**
27
+ - **Multiple Suggestions** (`g s --multiple`) - Generate 3 different commit message options
28
+ - **Caching System** - Cache AI responses for faster repeated operations
29
+ - **Provider Fallback Chain** - Automatic fallback between AI providers
30
+ - **Better Error Handling** - Actionable guidance and helpful suggestions
31
+
32
+ ### 🔧 Architecture Improvements
33
+
34
+ #### **Modular Design**
35
+ - Split monolithic `gims.js` into focused modules:
36
+ - `lib/utils/` - Colors, progress indicators
37
+ - `lib/config/` - Configuration management
38
+ - `lib/git/` - Git analysis and insights
39
+ - `lib/ai/` - AI provider management
40
+ - `lib/commands/` - Interactive commands
41
+
42
+ #### **Enhanced Components**
43
+ - **GitAnalyzer** - Smart git status analysis with insights
44
+ - **AIProviderManager** - Improved AI handling with caching and fallbacks
45
+ - **ConfigManager** - Comprehensive configuration with validation
46
+ - **InteractiveCommands** - User interaction and guided workflows
47
+ - **Progress** - Visual feedback system
48
+
49
+ ### 📊 User Experience Enhancements
50
+
51
+ #### **Better Feedback**
52
+ - Progress spinners for AI operations
53
+ - Success/warning/error indicators with colors
54
+ - Actionable error messages with suggestions
55
+ - Step-by-step guidance in interactive mode
56
+
57
+ #### **Smart Defaults**
58
+ - Auto-detection of project type and commit style
59
+ - Intelligent provider selection
60
+ - Context-aware configuration suggestions
61
+
62
+ #### **Enhanced Commands**
63
+ - All existing commands improved with progress indicators
64
+ - Better error handling and user guidance
65
+ - Consistent color coding and formatting
66
+ - More informative output
67
+
68
+ ### 🛠️ Configuration Options Added
69
+
70
+ #### **New Environment Variables**
71
+ - `GIMS_AUTO_STAGE` - Auto-stage changes by default
72
+ - `GIMS_CACHE` - Enable/disable AI response caching
73
+ - `GIMS_PROGRESS` - Show/hide progress indicators
74
+ - `GIMS_MAX_DIFF_SIZE` - Maximum diff size for AI processing
75
+
76
+ #### **New .gimsrc Options**
77
+ ```json
78
+ {
79
+ "autoStage": false,
80
+ "cacheEnabled": true,
81
+ "progressIndicators": true,
82
+ "maxDiffSize": 100000,
83
+ "projectType": "react"
84
+ }
85
+ ```
86
+
87
+ ### 📈 Performance Improvements
88
+ - **Caching**: AI responses cached for 1 hour
89
+ - **Modular Loading**: Components loaded on-demand
90
+ - **Better Memory Management**: Efficient diff processing
91
+ - **Faster Startup**: Optimized initialization
92
+
93
+ ### 🔄 Breaking Changes
94
+ - Removed `largelist` command (merged into `list --detailed`)
95
+ - Changed some internal APIs (affects programmatic usage only)
96
+ - Updated minimum Node.js version recommendation to 20+
97
+
98
+ ### 🐛 Bug Fixes
99
+ - Fixed git status parsing for different git versions
100
+ - Improved error handling for large diffs
101
+ - Better clipboard handling across platforms
102
+ - Fixed configuration file validation
103
+
104
+ ### 📚 Documentation
105
+ - Completely updated README with new features
106
+ - Added comprehensive examples for all new commands
107
+ - Enhanced configuration documentation
108
+ - Added troubleshooting guide
109
+
110
+ ---
111
+
112
+ ## [0.5.4] - Previous Version
113
+ - Basic AI-powered commit messages
114
+ - Simple configuration
115
+ - Core git operations
116
+ - Single-file architecture
@@ -0,0 +1,74 @@
1
+ # 🚀 GIMS Quick Reference
2
+
3
+ ## Single-Letter Workflow Commands
4
+
5
+ ```bash
6
+ g s # Status - Enhanced git status with AI insights
7
+ g i # Interactive - Guided commit wizard
8
+ g p # Preview - See what will be committed
9
+ g l # Local - AI commit locally
10
+ g o # Online - AI commit + push
11
+ g h # History - Numbered commit log
12
+ g a # Amend - Smart amend with AI
13
+ g u # Undo - Undo last commit
14
+ ```
15
+
16
+ ## Quick Setup
17
+
18
+ ```bash
19
+ # Choose your AI provider (one-time setup)
20
+ g setup --api-key gemini # 🚀 Recommended: Fast & free
21
+ g setup --api-key openai # 💎 High quality
22
+ g setup --api-key groq # ⚡ Ultra fast
23
+
24
+ # Or run full setup wizard
25
+ g setup
26
+ ```
27
+
28
+ ## Essential Workflow
29
+
30
+ ```bash
31
+ # 1. Check what's changed
32
+ g s
33
+
34
+ # 2. Commit with AI (choose one)
35
+ g i # Interactive mode (guided)
36
+ g o # One-command: commit + push
37
+ g l # Local commit only
38
+
39
+ # 3. View history
40
+ g h # Recent commits
41
+ g h --detailed --limit 10 # Detailed view
42
+ ```
43
+
44
+ ## Default AI Models
45
+
46
+ - **Gemini**: `gemini-2.0-flash-exp` (Fast, free, recommended)
47
+ - **OpenAI**: `gpt-4o-mini` (Cost-effective, high quality)
48
+ - **Groq**: `llama-3.1-8b-instant` (Ultra-fast inference)
49
+
50
+ ## Pro Tips
51
+
52
+ ```bash
53
+ g sg --multiple # Get 3 AI suggestions
54
+ g p # Preview before committing
55
+ g a # Smart amend with new AI message
56
+ g sync --rebase # Smart sync with rebase
57
+ g stash # Stash with AI description
58
+ ```
59
+
60
+ ## Configuration
61
+
62
+ ```bash
63
+ g config --list # View all settings
64
+ g config --set conventional=true # Enable conventional commits
65
+ g config --set autoStage=true # Auto-stage changes
66
+ g config --set provider=gemini # Set AI provider
67
+ ```
68
+
69
+ ## Help
70
+
71
+ ```bash
72
+ g --help # All commands
73
+ g <command> --help # Command-specific help
74
+ ```