Package: magiccommits
MagicCommitsMagiccommits: Effortless Git Commits with AIInstallationBefore you start using MagicCommits, make sure you have Python and pip installed. Then, you can install MagicCommits using pip:pipinstallmagiccommitsIf you are using python3 thenpip3installmagiccommitsBefore you can use MagicCommits, you'll need to configure it with your OpenAI API key. If you haven't already, you can retrieve your API key fromOpenAI(Note: You may need to create an account and set up billing).Set the OPENAI_KEYmcconfigsetOPENAI_KEY=<your-token>This will create a .mc file in your home directory(~/.mc).UsageExecutemagiccommits or mcto generate the commit messagesAdditional OptionsCommandExampleFunctionality1-tor--ticketmc -t PROJ-123Set the ticket number for your commit message2-aor--addmc -aPerform agit add .operation before commit3-uor--updatemc commit -uPerform agit add --updateoperationYou can use these additional options to customize your commit messages and perform relevant Git operations as needed in your project workflow.Demo: mc -aDemo: copy message to clipboardConfigurationYou can use these keys to configure various aspects of the project. To set the value for a key, you must use the formatkey=valuewhen using themc config setcommand. To retrieve the values for these keys, you can use themc config getcommand, either for all values or a specific key.Configuration KeysOPENAI_KEY [Required]Description:This key is used to specify the OpenAI API key.Example Setting:To set the value:mcconfigsetOPENAI_KEY=sk-testTo retrieve the value:mcconfiggetOPENAI_KEYlocale [OPT]Description:This key defines the locale or language for text generation.Example Setting:To set the value:mcconfigsetlocale=enTo retrieve the value:mcconfiggetlocalegenerate [OPT]Description:This key determines the number of commit message to generate.Example Setting:To set the value:mcconfigsetgenerate=4To retrieve the value:mcconfiggetgeneratetype [OPT]Description:This key specifies the type of commit generation.Example Setting:To set the value:mcconfigsettype=conventionalTo retrieve the value:mcconfiggettypeconventionalExplanation:Generates commit messages following the conventional commit format.Example:Commit Message:feat: add new featureDescription: A conventional commit format with a type ("feat" for feature) and a brief description.conventional-emojiExplanation:Generates commit messages following the conventional commit format with added emojis.Example:Commit Message:feat: add new feature :sparkles:Description: A conventional commit format with an emoji (:sparkles:) for visual appeal and a type ("feat") with a brief description.messageExplanation:Generates simple and concise commit messages.Example:Commit Message:Update README.mdDescription: A straightforward commit message with a focus on the action ("Update README.md").message-emojiExplanation:Generates simple commit messages with added emojis.Example:Commit Message:Fix a critical bug :bug:Description: A simple commit message with an emoji (:bug:) for visual context, describing the action ("Fix a critical bug").proxy [OPT]Description:This key allows you to set a proxy server for network requests.Example Setting:To set the value:mcconfigsetproxy=httpTo retrieve the value:mcconfiggetproxymodel [OPT]Description:This key defines the model to be used for commit generation.Example Setting:To set the value:mcconfigsetmodel=gpt-3.5-turboTo retrieve the value:mcconfiggetmodeltimeout [OPT]Description:This key sets the maximum timeout (in milliseconds) for API requests.Example Setting:To set the value:mcconfigsettimeout=10000To retrieve the value:mcconfiggettimeoutmax_length [OPT]Description:This key specifies the maximum length of generated text.Example Setting:To set the value:mcconfigsetmax_length=50To retrieve the value:mcconfiggetmax_lengthmax_token [OPT]Description:This key determines the maximum number of tokens in the generated text.Example Setting:To set the value:mcconfigsetmax_token=200To retrieve the value:mcconfiggetmax_tokencopy_commit [OPT]Description:This key is a boolean flag that determines whether to copy the generated text to the clipboard.Example Setting (True):To set the value:mcconfigsetcopy_commit=TrueTo retrieve the value:mcconfiggetcopy_commitGetting Configuration ValuesTo retrieve the values for these configuration keys, you can use the following commands:To get all configuration values:mcconfiggetUsageGenerate Commit MessagesYou can use MagicCommits to effortlessly generate commit messages for your staged changes:MagicCommits will analyze your Git diff and employ AI to suggest a commit message. You can then choose to commit, commit and push, or copy the message to your clipboard.VersionTo check the current version of MagicCommits, you can use the following command:mc--versionCreditsMagicCommits is inspired byAI Commits, created byHassan El Mghari.ContributingIf you want to help fix a bug or implement a feature inIssues, checkout theContribution Guideto learn how to setup project.LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.Made in Nepal