Skip to content

Глобальный инструмент для генерации осмысленных сообщений коммитов с использованием ИИ.

License

Notifications You must be signed in to change notification settings

prod-broke-again/smart-commit

Repository files navigation

Smart Commit Tool

npm version License: MIT GitHub

🇷🇺 Ищете русскую версию? Откройте README.ru.md на GitHub

Global AI-powered tool for generating meaningful commit messages and running smart deployment workflows.

⚠️ Important Configuration Update

Use apiKeys.<provider> for API keys. Each provider has its own key; model loading and API calls use the key for the current defaultProvider.

  • Recommended: apiKeys.gptunnel, apiKeys.timeweb, apiKeys.openai, etc.
  • ⚠️ Legacy: apiKey (gptunnel only) is still supported but deprecated.
  • Project settings: Each project can have its own apiKey, defaultProvider, and defaultModel.
# Recommended (per-provider keys)
smart-commit config --global --set apiKeys.gptunnel=YOUR_GPTUNNEL_KEY
smart-commit config --global --set apiKeys.timeweb=YOUR_TIMEWEB_KEY
smart-commit config --global --set apiKeys.openai=sk-...

# Set default provider and model
smart-commit config --global --set defaultProvider=timeweb
smart-commit config --global --set defaultModel=gemini-2.0-flash

🔗 Links

✨ Features

  • 🤖 AI-powered commits: Generate high-quality commit messages with GPT models
  • 📋 Conventional Commits: Fully supports the conventional commits format
  • 🔗 Git Hooks: Automatic validation and improvement of commit messages
  • 🌍 Multi-language: Works in English and Russian out of the box
  • 🔧 Smart deploy: Detects necessary commands based on changed files
  • Fast deploy: Run the full set of deployment commands when needed
  • 🎯 Project analysis: Automatically understands your project structure
  • 🧱 Clean architecture: SOLID-first, testable, and extensible codebase

🚀 Quick Start

# Install globally
npm install -g smart-commit-ai

# Initial setup (configure API key, prompts, etc.)
smart-commit setup

# Generate and create a commit
smart-commit

# Run smart deploy
smart-commit deploy-smart

🧠 Smart Deploy Example

🔍 Analyzing changes for smart deployment...

📊 Analysis Results:
  • Detected changes in 2 files
  • Frontend files changed (resources/js/components/Button.vue)
  • NPM dependencies changed (package.json)

⚠️  Smart deployment will execute 3 commands:
  1. git pull origin main
  2. npm install
  3. npm run build

Continue? [y/N]

🛠 Supported Projects

  • PHP/Laravel — reads composer.json, artisan commands, etc.
  • Node.js — npm/yarn projects with package scripts
  • Vue.js / React — front-end frameworks detection
  • TypeScript — full TS support
  • Docker — basic Docker workflows

🎯 CLI Commands

Command Description
smart-commit Generate and create a commit
smart-commit --generate-only Generate a message without committing
smart-commit --dry-run Preview what would be committed
smart-commit deploy-smart Run smart deploy (only required commands)
smart-commit deploy Run full deploy pipeline
smart-commit setup Initial configuration wizard
smart-commit config Manage config (global or project)
smart-commit models Manage AI models cache
smart-commit install-hooks Install Git hooks for automatic validation
smart-commit uninstall-hooks Uninstall Git hooks

⚙️ Configuration

All settings can be stored globally (~/.smart-commit/config.json) or per-project (.smart-commit.json).

# Set API keys per provider (recommended)
smart-commit config --global --set apiKeys.gptunnel=shds-...
smart-commit config --global --set apiKeys.timeweb=tw-...
smart-commit config --global --set apiKeys.openai=sk-...

# Timeweb: also set base URL for your agent (required to avoid 404)
smart-commit config --global --set baseUrls.timeweb=https://agent.timeweb.cloud/api/v1/cloud-ai/agents/YOUR_AGENT_ID/v1

# Set default provider and model
smart-commit config --global --set defaultProvider=timeweb
smart-commit config --global --set defaultModel=gemini-2.0-flash

# Project-specific overrides
smart-commit config --set defaultProvider=timeweb
smart-commit config --set defaultModel=gpt-4o-mini

# Switch analysis mode
smart-commit config --global --set analysisMode=full

# Change default language
smart-commit config --set language=ru

# Inspect current configuration
smart-commit config --global --list

🔧 Models & Providers

Smart Commit supports multiple AI providers (GPTunnel, OpenAI, Anthropic Claude, Google Gemini, Timeweb AI). Manage models via CLI:

# List models from current provider
smart-commit models list

# Show all available models
smart-commit models list --all

# Refresh models from API
smart-commit models refresh

# Clear local cache
smart-commit models clear-cache

🧪 Example Workflow

$ smart-commit --generate-only
✓ Analyzing repository...
✓ Generating commit message...

Generated commit message:
feat: add user authentication module
- 🔐 Implemented JWT-based authentication system
- 👤 Added User model with validation
- 🗄️ Created repository layer for persistence
- 🛡️ Secured routes via auth middleware

🤝 Contributing

Whether you want to fix a bug, propose a feature, or add a new language — contributions are welcome!

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

Smart Commit is released under the MIT License.


Made with ❤️ by Eugene (prod-broke-again)

About

Глобальный инструмент для генерации осмысленных сообщений коммитов с использованием ИИ.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •