AI 대서사 시대가 도래했습니다
Chap GPT로 단 몇일만에 성공을 해버린 기업이 있죠. Open AI 입니다
Open AI에서 이젠 개발자를 위한 특별한 라이브러리를 배포 했습니다 바로 aicommit 이죠 이 녀석은 현재 npm install 수 1500 회 가량으로 적지만 갓 배포된 따끈따끈한 녀석이예요. 저도 재미삼에 사용해봤는데 이젠 벋어날 수 없는 경지까지 이루어져버렸죠
간단하게 소개해 드리겠습니다.
aicommit
https://www.npmjs.com/package/aicommits
aicommits
Writes your git commit messages for you with AI. Latest version: 1.5.1, last published: 13 hours ago. Start using aicommits in your project by running `npm i aicommits`. There are no other projects in the npm registry using aicommits.
www.npmjs.com
aicommit 을 사용하기 위해선 우선 npm 이 기본적으로 설치되어 있어야 합니다
그리고 간단하게 install 하면 되죠
npm install -g aicommits
참고로 이 aicommit 은 무료가 아닙니다..;;
그렇지만 기본 크래딧을 주고 아주 소량의 크래딧 지불을 하기 때문에 매우 많이 해당 기능을 사용 할 수 있습니다
그러기 위해선 Open AI에 가입 후 API KEY를 얻어야 합니다
https://platform.openai.com/account/api-keys
OpenAI API
An API for accessing new AI models developed by OpenAI
platform.openai.com
해당 URL로 접속 하시고 Sign up / Sign in 을 마친 후 밑 사진 처럼 Create new secret key 를 해줍니다
API Key를 한번 발급 받으면 다시 찾을 수 없기 때문에 다른 어딘가에 꼭 저장해야 합니다
이렇게 API Key를 발급 받았다면 적용을 해줍니다
aicommits config set OPENAI_KEY=<your token>
your token 란에 이전에 발급 받은 API Key를 작성 해줍니다.
그럼 이제 aicommit을 사용할 준비가 되었습니다.
한번 테스트 해볼까요
간단하게 Banner update query 을 변경하는 코드 입니다
let query =
`
UPDATE banner
SET image = '${banner.image}',
thumbnail_image = '${banner.thumbnail_image}',
image_link = '${banner.image_link}',
title = '${banner.title}',
description = '${banner.description}',
type = '${banner.type}',
content_type = '${banner.content_type}',
network = '${banner.network}',
sort = ${banner.sort},
status = '${banner.status}',
start_date = '${banner.start_date}',
end_date = '${banner.end_date}',
date_update = GETDATE(),
background_color = '${background_color}'
WHERE banner_id = ${banner.banner_id}
`
에 background_color 키를 지우고 commit을 해볼 것입니다 이때 명령어는 간단하게 git add . 와 aicommits 를 사용하면 끝
> git add .
> aicommits
┌ aicommits
│
◇ Detected 1 staged file:
server/app/models/market/banner.model.js
│
◇ Changes analyzed
│
◇ Use this commit message?
Update banner model to remove background color field from the update query in order to prevent data inconsistencies
메세지가 Update banner model to remove background color field from the update query in order to prevent data inconsistencies 로 나왔네요 무슨뜻일까요
배너 모델을 업데이트하여 데이터 불일치를 방지하기 위해 업데이트 쿼리에서 배경색 필드를 제거합니다.
제거한 이유까지 AI로 적어주네요 정말 신기합니다.
이제 코드 한줄 바꾸고 commit -m "블라블라..." 를 쳐야되는 삶에서 aicommits 하나만으로 커밋 메세지를 만들어보는 삶으로 바꿔 나가는 건 어떨까요?!
물론 해당 기능은 많은 코드 변경점에 대한 메세지는 작성해주지 않습니다. 간단한 코드만 지원 하는것 같아요!
그래도 많이 재밌고 유용하게 쓰고 있습니다~ 다들 사용해 보세요!
'나만의 꿀팁' 카테고리의 다른 글
[MAC Python] 맥북 파이썬 설치 (0) | 2023.08.08 |
---|---|
[Postgresql] JSON, JSONb, simple-json 차이점 (0) | 2023.05.18 |
[이더리움]이더리운 이더(ether) (0) | 2022.01.20 |
[이더리움] 이더리움 토큰 생성, ICO 개념 (0) | 2022.01.20 |
[블록체인]블록체인 ECDSA (0) | 2022.01.19 |
댓글