PHPackages                             valantic-cec/aicommits - 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. [CLI &amp; Console](/categories/cli)
4. /
5. valantic-cec/aicommits

ActiveLibrary[CLI &amp; Console](/categories/cli)

valantic-cec/aicommits
======================

Uses `git diff --staged` to generate better commit messages.

1.0.0(2y ago)171MITPHPPHP &gt;=8.0

Since Jul 19Pushed 2y ago3 watchersCompare

[ Source](https://github.com/valantic-CEC-Deutschland-GmbH/aicommits)[ Packagist](https://packagist.org/packages/valantic-cec/aicommits)[ RSS](/packages/valantic-cec-aicommits/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

aicommit
========

[](#aicommit)

Uses `git diff --staged` to generate better commit messages.

demo (changes in two different repositories)
============================================

[](#demo-changes-in-two-different-repositories)

[![Peek 2023-06-15 19-29.gif](Peek%202023-06-15%2019-29.gif)](Peek%202023-06-15%2019-29.gif)

Setup
=====

[](#setup)

- `composer global require valantic-cec/aicommits`
- Add `OPENAI_KEY` to your environment and create your own AI Git Commit command ([OpenAI API Key](https://platform.openai.com/account/api-keys))
    - Example for `bash`: adjust or create your `.bashrc/.zshrc/.bashrc-personal`

```
# Basic example (~/.bashrc or ~/.bash-personal)

# set global composer directory into path
if [ -d "$HOME/.config/composer/vendor/bin" ] ;
  then PATH="$HOME/.config/composer/vendor/bin:$PATH"
fi

# set OPENAI_KEY environment variable
export OPENAI_KEY=sk-...

# Commit everything helper function
function commit() {
  commitMessage="$*"

  git add .

  if [ "$commitMessage" = "" ]; then
    commitMessage=$(aicommits)
  fi

  # combine branchname and aicommits
  eval "git commit -a -m '${commitMessage}'"
}
```

```
# Extended example following naming conventions  (~/.bashrc or ~/.bash-personal)

# set global composer directory into path
if [ -d "$HOME/.config/composer/vendor/bin" ] ;
  then PATH="$HOME/.config/composer/vendor/bin:$PATH"
fi

# set OPENAI_KEY environment variable
export OPENAI_KEY=sk-...

# Commit everything helper function
function commit() {
  commitMessage="$*"

  git add .

  # Get the current branch name
  branch=$(git rev-parse --abbrev-ref HEAD)

  # Define the regular expression pattern for your branch naming convension
  # Example Branchname: feature/spry-1234_add_fancy_feature
  pattern="^(feature|bugfix|task|hotfix|improvement|release)/([[:alnum:]-]+)"

  # Extract the specific part using regex
  if [[ $branch =~ $pattern ]]; then
    extracted_part="${BASH_REMATCH[2]}"
  else
    extracted_part="no-task"
  fi

  if [ "$commitMessage" = "" ]; then
    commitMessage=$(aicommits)
  fi

  # combine branchname and aicommits
  eval "git commit -a -m '${extracted_part} ${commitMessage}'"
}
```

.zshrc example:

assumtions for gitlab repo configuration
========================================

[](#assumtions-for-gitlab-repo-configuration)

- JIRA connected
- configured git hook following a naming convention i.e. `task/jiraticket-xxxx_branch_description` (`#((feature|bugfix|task|hotfix|improvement|release)/jiraticket-[0-9]{1,})|master|staging|no-task/(.+)?$#i`)

development usage
=================

[](#development-usage)

- php aicommits

ToDo
====

[](#todo)

perfect code, no todos, no bugs ;-)
-----------------------------------

[](#perfect-code-no-todos-no-bugs--)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.2% 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

Unknown

Total

1

Last Release

1027d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38a6621b395917bb33ea0dd7970ae8a6295c972e40c26b04d923a3c625abd043?d=identicon)[nxs\_schoenfeld](/maintainers/nxs_schoenfeld)

---

Top Contributors

[![nxsschoenfeld](https://avatars.githubusercontent.com/u/62562240?v=4)](https://github.com/nxsschoenfeld "nxsschoenfeld (35 commits)")[![DominikBaehr](https://avatars.githubusercontent.com/u/27277124?v=4)](https://github.com/DominikBaehr "DominikBaehr (1 commits)")

---

Tags

clitooling

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/valantic-cec-aicommits/health.svg)

```
[![Health](https://phpackages.com/badges/valantic-cec-aicommits/health.svg)](https://phpackages.com/packages/valantic-cec-aicommits)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M319](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M18](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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