Skip to main content

scommit: ChatGPT-generated commit messages

Project description

Semantic Commit (scommit)

Semantic Commit (scommit) is a Python script that uses the ChatGPT API to auto-generate commit messages for your git commits. You can use it exactly like git commit:

scommit

is equivalent to:

git commit -m "auto-generated commit message"

You can also use all of the args you normally would with git commit, for example:

scommit -a

is equivalent to:

git commit -a -m "auto-generated commit message"

Think of scommit as an alias for git commit that appends -m "message" with an auto-generated message. That's it! I recommend using this when you don't actually care about commit messages, but want them to be slightly more informative than "sdflskdjafks". Plus, it uses more GPU's than regular commits, and we all know GPU usage is a proxy for agency.

In addition, you can use the -mi option with scommit to run it locally using Ollama. For example:

scommit -mi

This will run scommit locally using Ollama instead of making a request to the ChatGPT API.

Using the gasp command

The gasp command is a convenient way to perform git add ., scommit, and git push in one go. To use it, simply run:

scommit gasp

or

scommit --gasp

This will add all changes, generate a commit message, and push the changes to the remote repository.

Installation

pip install semantic-commit

You should get command-line tool called scommit that you can use just like git commmit.

You also need to set your OpenAI API key as an environment variable named OPENAI_API_KEY for scommit to work. Add this line in your .bashrc or .zshrc:

export OPENAI_API_KEY=your-api-key

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.


Made by Ivan Yevenko, Brian Machado and Parth Sareen

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

semantic_commit-1.3.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

semantic_commit-1.3.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file semantic_commit-1.3.0.tar.gz.

File metadata

  • Download URL: semantic_commit-1.3.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for semantic_commit-1.3.0.tar.gz
Algorithm Hash digest
SHA256 bceb89197354f47ca1906e8e8308d58ddb0ce00a238eb61590a45786840f0cee
MD5 1bf4a4e1d9f2e79beb8664b11966a883
BLAKE2b-256 e1140738921986111cf169434655a5a55164fa8e64c863ed23b7b07b681a8cba

See more details on using hashes here.

File details

Details for the file semantic_commit-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for semantic_commit-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3344788737ee1c841321ba642e24c9e6251d96151192bf2545a8d60d7916fe34
MD5 7328a8d91e45f505f88565172e98bc95
BLAKE2b-256 20d9d37146d68d8cca142ae136b932d07d4c26bef88cfcd9d6fa2b4d34121311

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page