feat(cli): auto-stage when nothing staged for g m/g l/g o; docs: update README

This commit is contained in:
s41r4j
2025-10-02 12:48:16 +05:30
parent c0f4cd97eb
commit f7c07e1af1
21 changed files with 2200 additions and 447 deletions
+68
View File
@@ -0,0 +1,68 @@
# Technology Stack
## Runtime & Language
- **Node.js**: >= 18.18.0 (Node 20+ recommended)
- **JavaScript**: CommonJS modules (`"type": "commonjs"`)
- **Package Manager**: npm (with package-lock.json)
## Core Dependencies
- **commander**: CLI framework for command parsing and structure
- **simple-git**: Git operations and repository management
- **clipboardy**: Cross-platform clipboard operations
- **@google/genai**: Google Gemini AI integration
- **openai**: OpenAI API client
## Architecture Patterns
- Single-file CLI application (`bin/gims.js`)
- Functional programming approach with utility functions
- Configuration via environment variables and `.gimsrc` JSON files
- Graceful fallbacks and error handling throughout
- ANSI color utilities without external dependencies
## Code Style Conventions
- Use `const` for immutable values, avoid `var`
- Prefer template literals for string interpolation
- Use async/await for asynchronous operations
- Implement comprehensive error handling with try/catch
- Keep functions focused and modular
- Use descriptive variable names (e.g., `rawDiff`, `prefProvider`)
- Comment complex logic and AI prompt engineering sections
## Common Commands
### Development
```bash
# Install dependencies
npm install
# Test installation
npm test # Currently returns "No tests yet"
# Global installation for testing
npm install -g .
```
### Publishing
```bash
# Update version
npm version patch|minor|major
# Publish to npm
npm publish
```
### Local Development Testing
```bash
# Link for local testing
npm link
# Test CLI commands
gims --help
g --help
```
## Configuration Management
- Environment variables for API keys (`OPENAI_API_KEY`, `GEMINI_API_KEY`, `GROQ_API_KEY`)
- Optional `.gimsrc` JSON config in project root or home directory
- Runtime provider detection and fallback logic
- Support for custom models and base URLs