Skip to main content

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

Metadata

Release files for semantic-commit 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for semantic-commit 1.3.0
File Size Uploaded
semantic_commit-1.3.0.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for semantic-commit 1.3.0
File Interpreter ABI Platform
semantic_commit-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.8 kB

Release files / semantic_commit-1.3.0.tar.gz

Download URL semantic_commit-1.3.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bceb89197354f47ca1906e8e8308d58ddb0ce00a238eb61590a45786840f0cee
BLAKE2b-256 checksum
How to use checksums
e1140738921986111cf169434655a5a55164fa8e64c863ed23b7b07b681a8cba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / semantic_commit-1.3.0-py3-none-any.whl

Download URL semantic_commit-1.3.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3344788737ee1c841321ba642e24c9e6251d96151192bf2545a8d60d7916fe34
BLAKE2b-256 checksum
How to use checksums
20d9d37146d68d8cca142ae136b932d07d4c26bef88cfcd9d6fa2b4d34121311
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.0.0

1 release file

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page