Git Product home page Git Product logo

autocommit's Introduction

autocommit

npm version Version License

icon

description

This is the ultimate command for lazy developers who can't be bothered writing a description of their commits.

This will commit your files, with a commented generated by OpenAI, trying to best understand what you did based on your diff.

At the end, the AI adds a lame joke to your commit, because hey... why not?

usage

First, set an environment variable for your OpenAI key in your ~/.bash_profile or ~/.zprofile:

export OPENAI_API_KEY=sk-?????????
export OPENAI_ORGANIZATION=org-??? # Your organization (optional)
export OPENAI_PROJECT_AI_COMMIT=proj_??? # Your project (optional)

Then execute the NPX command:

# execute:
$ npx @dobuki/autocommit

Your files will be commmitted, with a comment generated by OpenAI:

Example:

Refactored the OpenAI integration to handle cases where the API key is not provided.

- Replaced the condition of `process.env.OPENAI_API_KEY` with `process.env.OPENAI_API_KEY?.length` to check if the API key has a length before creating a new OpenAI instance.

Files:
M README.md
M src/open-ai.js

Committed using auto-commit: Sun Jun 09 2024 23:41:27 GMT-0700 (Pacific Daylight Time)
Autocommit project: https://www.npmjs.com/package/@dobuki/autocommit
All the lame jokes were generated by AI.

Note: If you don't have an OpenAI key, it will just skip the descriptive comment and write something simple like:

Files:
M src/auto-commit.js

Committed using auto-commit: Sun Jun 09 2024 01:00:35 GMT-0700 (Pacific Daylight Time)
Autocommit project: https://www.npmjs.com/package/@dobuki/autocommit
All the lame jokes were generated by AI.

autocommit's People

Contributors

jacklehamster avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.