Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@hirotomoyamada/ai-commit
Advanced tools
English | 日本語
Install
pnpm add -g @hirotomoyamada/ai-commit
Obtain your API key from OpenAI.
Set your API key in ai-commit
.
ai-commit config set apiKey=<your token>
To check the installed version, run the following:
ai-commit --version
To install the latest version, run the following:
pnpm up -g @hirotomoyamada/ai-commit --latest
To generate a commit message, run the following:
ai-commit
[!TIP]
ai-commit
provides a shortened aliasaic
.
When you run ai-commit
, two scenarios may occur:
If there are files staged:
If there are changed files not yet staged:
[!TIP]
To add all changed files not currently staged to the stage (with
git add .
), set the--all
or-a
option.
To change the commit message suggestions, set the --generate <i>
or -g <i>
option. The default is set to 1
.
ai-commit --generate 5
[!NOTE]
You can set up to a maximum of
5
suggestions.
Many projects have rules for commit messages based on Conventional Commits. If you want to apply these rules, set conventional
with the --type
or -t
option.
ai-commit --type conventional
[!NOTE]
By setting it in the configuration, you can always apply the Conventional Commits commit message rules.
To get the configuration, run the following:
ai-commit config get
To get specific items only, run the following:
ai-commit config get generate locale
To set values in the configuration, run the following:
ai-commit config set generate=5 type=conventional
To reset the configuration values, run the following:
ai-commit config reset
Item | Default | Description |
---|---|---|
apiKey | undefined | API key generated from OpenAI |
generate | 1 | Number of commit messages to generate |
locale | en | Locale used for generating commit messages |
timeout | 10000 | Timeout for network requests to OpenAI (milliseconds) |
type | undefined | Type of commit message to generate |
model | gpt-4 | OpenAI model used for generating commit messages |
maxLength | 50 | Maximum character length of the generated commit message |
To get the prompt, run the following:
ai-commit prompt get
The default prompt is as follows:
Generate a concise git commit message written in present tense for the following code diff with the given specifications below:
Message language: {{ locale }}
Commit message must be a maximum of {{ maxLength }} characters.
Exclude anything unnecessary such as translation. Your entire response will be passed directly into git commit.
{{ commitType }}
The output response must be in format:
{{ commitRule }}
[!NOTE]
{{ locale }}
and{{ maxLength }}
will be replaced with the values set in the configuration.
To update the prompt, run the following:
ai-commit prompt set
To reset the prompt, run the following:
ai-commit prompt reset
MIT © Hirotomo Yamada
FAQs
AI generates git commit messages on your behalf.
We found that @hirotomoyamada/ai-commit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.