Skip to content

Commit 4edb9bd

Browse files
committedMar 6, 2023
first
0 parents  commit 4edb9bd

14 files changed

+3146
-0
lines changed
 

‎.eslintrc.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:@typescript-eslint/recommended",
5+
"plugin:prettier/recommended"
6+
],
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"ecmaVersion": 12,
10+
"sourceType": "module"
11+
},
12+
"plugins": ["simple-import-sort", "import", "@typescript-eslint", "prettier"],
13+
"settings": {
14+
"import/resolver": {
15+
"node": {
16+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
17+
}
18+
}
19+
},
20+
"packageManager": "npm",
21+
"rules": {
22+
"prettier/prettier": "error",
23+
"no-console": "error",
24+
"sort-imports": "off",
25+
"import/order": "off",
26+
"simple-import-sort/imports": "error",
27+
"simple-import-sort/exports": "error",
28+
"import/first": "error",
29+
"import/newline-after-import": "error",
30+
"import/no-duplicates": "error",
31+
"@typescript-eslint/no-non-null-assertion": "off"
32+
}
33+
}

‎.github/CONTRIBUTING.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Contribution Guidelines
2+
3+
Thank you for considering contributing to the project. Let's shake it baby.
4+
5+
## How to contribute
6+
7+
1. Fork the project repository on GitHub.
8+
2. Clone your forked repository locally.
9+
3. Create a new branch for your changes.
10+
4. Make your changes and commit them with descriptive commit messages.
11+
5. Push your changes to your forked repository.
12+
6. Create a pull request from your branch to the `master` branch.
13+
14+
## Getting started
15+
16+
To get started, follow these steps:
17+
18+
1. Clone the project repository locally.
19+
2. Install dependencies with `npm install`.
20+
3. Run the project with `npm run dev`.
21+
4. See [issues](https://github.com/di-sukharev/open-commit/issues) or [TODO.md](../TODO.md) to help the project.
22+
23+
## Commit message guidelines
24+
25+
Use the library to generate commits, stage the files and run `npm run dev` :)
26+
27+
## Reporting issues
28+
29+
If you encounter any issues while using the project, please report them on the GitHub issue tracker. When reporting issues, please include as much information as possible, such as steps to reproduce the issue, expected behavior, and actual behavior.
30+
31+
## Contact us
32+
33+
If you have any questions about contributing to the project, please contact us by [creating an issue](https://github.com/di-sukharev/open-commit/issues) on the GitHub issue tracker.
34+
35+
## License
36+
37+
By contributing to this project, you agree that your contributions will be licensed under the MIT license, as specified in the `LICENSE` file in the root of the project.

‎.github/logo-black.png

2.11 KB
Loading

‎.github/logo-grad.svg

+13
Loading

‎.github/logo.svg

+4
Loading

‎.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
node_modules/
2+
coverage/
3+
out/
4+
temp/
5+
build/
6+
dist/
7+
application.log
8+
.DS_Store
9+
/*.env
10+
logfile.log
11+
uncaughtExceptions.log
12+
.vscode
13+
src/*.json

‎.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build
2+
/dist

‎.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"trailingComma": "none",
3+
"singleQuote": true
4+
}

‎LICENSE

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
MIT License
2+
3+
Copyright (c) Dima Sukharev
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a
6+
copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included
9+
in all copies or substantial portions of the Software.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
12+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
14+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

‎README.md

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<div align="center">
2+
<div>
3+
<img src=".github/logo-grad.svg" alt="OpenCommit logo"/>
4+
<h1 align="center">OpenCommit</h1>
5+
<h4 align="center">Author <a href="https://github.com/di-sukharev">@di-sukharev</a> <a href="https://twitter.com/io_Y_oi"><img src="https://img.shields.io/twitter/follow/io_Y_oi?style=flat&label=io_Y_oi&logo=twitter&color=0bf&logoColor=fff" align="center"></a>
6+
</h4>
7+
</div>
8+
<p>AI generates conventional commits with mind-blowing accuracy</p>
9+
<a href="https://www.npmjs.com/package/opencommit"><img src="https://img.shields.io/npm/v/opencommit" alt="Current version"></a>
10+
</div>
11+
12+
---
13+
14+
## Examples
15+
16+
Look into [the commits](https://github.com/di-sukharev/opencommit/commit) to see how OpenCommit works. Emoji and long commit description text is configurable.
17+
18+
## Setup
19+
20+
> The minimum supported version of Node.js is the latest v14. Check your Node.js version with `node --version`.
21+
22+
1. Install opencommit globally to use in any repository:
23+
24+
```sh
25+
npm install -g opencommit
26+
```
27+
28+
2. Get your API key from [OpenAI](https://platform.openai.com/account/api-keys)
29+
30+
3. Set the key to opencommit config:
31+
32+
```sh
33+
opencommit config set OPENAI_API_KEY=<your token>
34+
```
35+
36+
Your token isn't sent to anyone, it's saved in `~/.opencommit` config file.
37+
38+
## Usage
39+
40+
You can call `opencommit` directly to generate a commit message for your staged changes:
41+
42+
```sh
43+
git add <files...>
44+
opencommit
45+
```
46+
47+
You can also use the `oc` shortcut:
48+
49+
```sh
50+
git add <files...>
51+
oc
52+
```
53+
54+
## Features
55+
56+
### Preface commits with emoji 🤠
57+
58+
[GitMoji](https://gitmoji.dev/) convention is used.
59+
60+
To add emoji:
61+
62+
```sh
63+
opencommit config set emoji=true
64+
```
65+
66+
To remove emoji:
67+
68+
```sh
69+
opencommit config set emoji=false
70+
```
71+
72+
### Postface commits with descriptions of changes 🤠
73+
74+
To add descriptions:
75+
76+
```sh
77+
opencommit config set description=true
78+
```
79+
80+
To remove description:
81+
82+
```sh
83+
opencommit config set description=false
84+
```
85+
86+
## Git hook
87+
88+
You can set opencommit as Git [`prepare-commit-msg`](https://git-scm.com/docs/githooks#_prepare_commit_msg) hook. Hook integrates with you IDE Source Control and allows you edit the message before commit.
89+
90+
To set the hook:
91+
92+
```sh
93+
opencommit hook set
94+
```
95+
96+
To unset the hook:
97+
98+
```sh
99+
opencommit hook unset
100+
```
101+
102+
To use the hook:
103+
104+
```sh
105+
git add <files...>
106+
git commit
107+
```
108+
109+
Or follow the process of your IDE Source Control feature, when it calls `git commit` command — OpenCommit will integrate into the flow.
110+
111+
## Payments
112+
113+
You pay for your own requests to OpenAI API. OpenCommit uses ChatGPT official model, that is ~10x times cheaper than GPT-3.

0 commit comments

Comments
 (0)
Failed to load comments.