PHPackages                             eusouomichel/php-commit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. eusouomichel/php-commit

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

eusouomichel/php-commit
=======================

Uma biblioteca para criar mensagens de commit personalizadas

v1.1.0(7mo ago)3280MITPHP

Since Nov 20Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/eusouomichel/php-commit)[ Packagist](https://packagist.org/packages/eusouomichel/php-commit)[ RSS](/packages/eusouomichel-php-commit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (9)Used By (0)

🚀 **PHP Commit**
================

[](#-php-commit)

[![PHP Version](https://camo.githubusercontent.com/291fb48c27888cb58d3daa496237532ea2d0bdd51a933f0a7a4262e9d87b7304/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e342d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![Packagist](https://camo.githubusercontent.com/cc90eaf5c2a36522380a224f7a38303d8a67cdca2e80cbcb8fbaa77c378e9157/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6575736f756f6d696368656c2f7068702d636f6d6d69742e737667)](https://packagist.org/packages/eusouomichel/php-commit)

**PHP Commit** is a powerful, user-friendly Open Source library that revolutionizes how you create Git commit messages. With intuitive interactive prompts and intelligent automation, it ensures your commit history is always clean, consistent, and professional.

✨ **Key Features:**

- 🎯 **Interactive commit creation** with guided prompts
- 🌍 **Multi-language support** (English, Portuguese, and more)
- 🔄 **Smart automation** (auto-add files, auto-push)
- 🛡️ **Pre-commit validation** with custom rules
- 📋 **Conventional Commits compliant**
- ⚡ **Fast and lightweight**

Built following [Conventional Commits](https://www.conventionalcommits.org) specifications, PHP Commit transforms your development workflow by making commit messages meaningful, searchable, and automatically processable by tools.

Installation
------------

[](#installation)

To use this library, ensure **Composer** is installed on your system. If not, you can install it by following the official instructions at .

Once Composer is installed, you can add the library to your project by running:

```
composer require --dev eusouomichel/php-commit
```

Initial Setup
-------------

[](#initial-setup)

After installation, run the following command to generate the `php-commit.json` configuration file:

```
php vendor/bin/commit init
```

During initialization, you will be prompted to configure:

- The language for interactive prompts;
- Automatic addition of files (`auto_add_files`);
- Automatic push after committing (`auto_push`);
- Pre-commit commands;
- Strings that are prohibited in files being committed.

The `php-commit.json` file will be created in the current directory. You can edit this file later to adjust the configuration as needed.

Here is an example of a generated `php-commit.json` file:

```
{
	"language": "en",
	"auto_add_files": true,
	"auto_push": true,
	"pre_commit_commands": [],
	"no_commit_strings": []
}
```

🎯 Usage
-------

[](#-usage)

### ⚡ Quick Commands (Recommended)

[](#-quick-commands-recommended)

For easier usage, add these scripts to your `composer.json`:

```
{
  "scripts": {
    "commit": "@php vendor/bin/commit message",
    "wip": "@php vendor/bin/commit message --wip",
    "init-commit": "@php vendor/bin/commit init"
  }
}
```

Then use these simple commands:

```
# Interactive commit creation
composer commit

# Quick WIP commit
composer wip

# Initialize configuration (first time)
composer init-commit
```

### 🚀 Traditional Usage

[](#-traditional-usage)

1. **Initialize the configuration:**

    ```
    php vendor/bin/commit init
    ```
2. **Create your first commit:**

    ```
    php vendor/bin/commit message
    ```
3. **Quick WIP commit:**

    ```
    php vendor/bin/commit message --wip
    ```

### 📝 Creating Custom Commit Messages

[](#-creating-custom-commit-messages)

To create a custom commit message, use:

```
php vendor/bin/commit message
```

This launches an **interactive session** with beautiful prompts:

```
🔥 Choose the commit type:
  [1] feat: A new feature
  [2] fix: Bug fix
  [3] docs: Documentation changes
  [4] style: Style changes (formatting, spacing, etc.)
  [5] refactor: Code refactoring without behavior changes
  ...

📝 Enter commit context (optional, max. 20 characters):
> auth

✨ Enter commit summary (max. 50 characters):
> add user authentication system

📖 Describe the changes (optional, max. 500 characters):
> Implemented JWT-based authentication with login and logout endpoints

⚠️  Provide breaking change (optional):
>

🔗 Reference (optional):
> #123

```

**Generated commit message:**

```
feat(auth): add user authentication system

Implemented JWT-based authentication with login and logout endpoints

Refs: #123

```

### 🅰️ Alternative Command Methods

[](#🅰️-alternative-command-methods)

#### Shell Aliases

[](#shell-aliases)

Add to your shell config (`~/.zshrc`, `~/.bashrc`, etc.):

```
alias commit-msg="php vendor/bin/commit message"
alias commit-wip="php vendor/bin/commit message --wip"
```

#### Global Installation

[](#global-installation)

```
# Install globally
composer global require eusouomichel/php-commit

# Use anywhere
commit message
commit message --wip
commit init
```

### 👍 Creating Automatic WIP Commits

[](#-creating-automatic-wip-commits)

For quick "Work In Progress" (WIP) commits, use the command:

```
php vendor/bin/commit message --wip
```

This will automatically add files (if configured) and create a WIP commit with a predefined message.

### Pre-Commit Commands and Prohibited Strings

[](#pre-commit-commands-and-prohibited-strings)

You can configure pre-commit commands in the `php-commit.json` file. These commands will run before the commit is created. You can also specify prohibited strings that should not appear in files being committed.

If prohibited strings are detected, the commit will be blocked, and detailed error messages will be displayed.

### 🌍 Multi-Language Support

[](#-multi-language-support)

The library supports multiple languages for interactive prompts. You can set the desired language by updating the `language` field in the `php-commit.json` file.

**Available languages:**

- 🇺🇸 `en` (English)
- 🇧🇷 `pt_BR` (Portuguese)
- 🚀 More languages coming soon!

⚙️ Advanced Configuration
-------------------------

[](#️-advanced-configuration)

### Pre-commit Commands

[](#pre-commit-commands)

Automate your workflow by adding pre-commit commands:

```
{
  "pre_commit_commands": [
    "npm run lint",
    "composer phpcs",
    "php artisan test"
  ]
}
```

### Prohibited Strings

[](#prohibited-strings)

Prevent sensitive data from being committed:

```
{
  "no_commit_strings": [
    "TODO",
    "FIXME",
    "console.log",
    "var_dump",
    "dd("
  ]
}
```

❓ FAQ
-----

[](#-faq)

**Q: Can I use this with existing projects?**A: Yes! Just run `php vendor/bin/commit init` in your project root.

**Q: What if I want to skip the interactive prompts?**A: Use `--wip` flag for quick commits: `php vendor/bin/commit message --wip`

**Q: How do I add a new language?**A: Create a new JSON file in `src/lang/` following the existing structure.

**Q: Can I customize commit types?**A: Currently, we use standard Conventional Commits types. Custom types are planned for future releases.

**Q: Does this work with Git hooks?**A: Yes! You can integrate PHP Commit with your existing Git hooks workflow.

🔧 Troubleshooting
-----------------

[](#-troubleshooting)

**Configuration file not found?**

- Make sure you've run `php vendor/bin/commit init` first
- Check that `php-commit.json` exists in your project root

**Command not found?**

- Ensure Composer's vendor/bin directory is in your PATH
- Try using the full path: `./vendor/bin/commit`

**Permission denied?**

- Make sure the `commit` file is executable: `chmod +x vendor/bin/commit`

Project Structure
-----------------

[](#project-structure)

- `composer.json`: Composer configuration file.
- `php-commit.json`: Configuration file generated during initialization.
- `CommitMessageCommand.php`: The main command for creating commit messages.
- `InitCommand.php`: The command to initialize the `php-commit.json` configuration file.

Contributing
------------

[](#contributing)

We welcome contributions! To contribute:

1. Fork the repository.
2. Create a new branch for your feature: `git checkout -b my-feature`.
3. Commit your changes: `git commit -m 'feat: My new feature'`.
4. Push the branch: `git push origin my-feature`.
5. Open a Pull Request.

License
-------

[](#license)

This project is licensed under the [MIT License](LICENSE).

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance62

Regular maintenance activity

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~51 days

Recently: every ~0 days

Total

7

Last Release

238d ago

Major Versions

0.1.0 → v1.0.02025-09-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/59e14ad592e1a20cf17cc63cff60997148abf21da4a9caee02fb2a959b334836?d=identicon)[eusouomichel](/maintainers/eusouomichel)

---

Top Contributors

[![eusouomichel](https://avatars.githubusercontent.com/u/6305293?v=4)](https://github.com/eusouomichel "eusouomichel (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eusouomichel-php-commit/health.svg)

```
[![Health](https://phpackages.com/badges/eusouomichel-php-commit/health.svg)](https://phpackages.com/packages/eusouomichel-php-commit)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[shivas/versioning-bundle

Symfony application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations

1121.2M1](/packages/shivas-versioning-bundle)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[overtrue/php-opencc

中文简繁转换，支持词汇级别的转换、异体字转换和地区习惯用词转换（中国大陆、台湾、香港、日本新字体）。基于 \[BYVoid/OpenCC\](https://github.com/BYVoid/OpenCC) 数据实现。

12130.7k](/packages/overtrue-php-opencc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
