개발 로그: gimme_readme 릴리스
오늘 자정에 저는 한 번도 해본 적이 없는 일을 해냈습니다. 즉, 내 프로그램 gimme_readme를 전 세계가 사용할 수 있도록 npm 레지스트리에 게시하는 것입니다!
gimme_readme 명령줄 도구는 사용자의 로컬 소스 코드 파일을 가져와 이를 사용하여 코드를 설명하는 README.md 파일을 만듭니다. gimme_readme를 사용하면 다양한 AI API(예: Gemini의 gemini-1.5-flash 모델 및 Groq의 llama3-8b-8192 모델)를 선택하여 제공된 코드를 분석하고 코드를 설명하는 문서를 생성할 수 있습니다.
gimme_readme에 대해 자세히 알아보려면 아래 저장소를 확인하거나 저장소에도 링크되어 있는 0.1 릴리스 데모를 시청하시기 바랍니다.
피터단완
/
gimme_readme
gimme_readme
gimme_readme는 프로젝트에 대한 포괄적인 README.md 파일을 생성하는 AI 기반 명령줄 도구입니다. 여러 소스 코드 파일을 한 번에 분석하여 각 파일의 목적, 기능 및 주요 구성 요소에 대한 간결한 설명을 읽기 쉬운 단일 문서로 제공합니다. 이렇게 하면 다른 사람들이 귀하의 프로젝트에 더 쉽게 접근하고 이해할 수 있습니다.
0.1 릴리스 데모를 확인하세요!
목차
- 시작하기
- 사용방법
- 사용예
- 공급자 지원 모델
- 기여
- 작가
1. 시작하기
gimme_readme를 시작하려면 다음 단계를 따르세요.
-
운영 체제에 맞는 최신 버전의 Node.js를 설치하세요.
-
gimme_readme를 전역적으로 설치하려면 다음 명령을 실행하세요.
npm i -g gimme_readme
로그인 후 복사참고: MAC/LINUX 사용자는 sudo npm i -g gimme_readme를 실행해야 할 수도 있습니다
-
원하는 모든 폴더에서 실행하여 구성 파일을 생성하세요.
gr-ai -c
로그인 후 복사이 명령은 홈 디렉터리에 .gimme_readme_config 파일을 생성합니다. 이 파일을 이 위치에서 이동하지 마세요.
…
Table of Contents
- Developing gimme_readme
- Getting started with gimme_readme
- Features of gimme_readme
- Example usage
- Conclusion
- Links
Developing gimme_readme
"Stand on the shoulders of giants"
This quote echoed in my head as I was creating my command-line tool since I know very well that without the work of many other companies and distinct individuals, I would not be able to release my own project.
To that end, let me delve into some of the technologies I used to create gimme_readme.
To start, I knew I wanted to work with JavaScript because of its simple syntax, and its ability to run on Linux, Mac, and Windows. Since cross-platform availability is something I value, I knew I wanted to work with JavaScript from the start.
After choosing JavaScript as the programming language I'd write in, I thought about how I would publish my code. The first thought that came to mind was npm. npm or the node package manager is the largest open source registry in the world. People from around the world use code from npm and share their code to npm and the process of using npm is very straightforward.
When I started my computer science journey in 2022, I was fascinated with how easy it was to just write:
npm i NPM_PACKAGE
and my code would magically work. I was even more impressed when I found out that the packages that were installed (if they were maintained correctly), were able to be installed on different operating systems.
To show you how easy node / npm's ecosystem is, let me show you how easy it is to make your JavaScript code into an executable that runs on every operating system.
You can make your script executable by adding a line similar to this to your package.json file:
{ "bin": { // Makes an executable called "gr-ai" which simply calls my JS script "gr-ai": "./src/_gr.js" } }
How neat is that? With just a few lines of code (minus my comment), you are halfway done with making an executable called gr-ai which calls ./src/_gr.js that can run on all operating systems.
The final piece of the puzzle for making an executable is simulating how you would publish your code OR publishing your code for real.
To simulate publishing your code, run the following command in the root of your JavaScript project (i.e., where your package.json is):
npm link
This command simulates you having installed your program globally and will give you access to your own gr-ai command!
In the event that you no longer want to have the code for this command installed globally (whether it be your simulated code / code that you installed globally via npm), you can run:
npm uninstall -g gimme_readme
Please note, that you need to specify the name of your package when uninstalling and not the name of your executable.
I had to simulate publishing my code several times before actually publishing it to npm. For a really good guide on publishing your code to the npm registry, I suggest watching Web Dev Simplified's video on creating and publishing your first npm package.
With direction on how I'd publish my code, I was able to start thinking about all the different dependencies I would need to get my program to work.
The dependencies and packages I'm currently using for gimme_readme are:
- @google/generative-ai & groq/sdk, which give me access to different LLMs that will help explain the user's source code
- commander, which made it easy to configure the different options of my command-line tool
- chalk, which allows me to colourize my command-line text
- dotenv, which helps me work with secret files that store sensitive information
- ora, which gives code that produces a loading spinner
It was with these great APIs and libraries that I was able to produce a tool of my own. With that said, let me show you how you can get started with gimme_readme so you can make heads or tails of your local source code files.
Getting started with gimme_readme
To get started with gimme_readme, follow these steps:
1. Install the latest version of Node.js for your operating system
The download for Node.js can be found here: https://nodejs.org/en/download/package-manager.
Node.js will come with npm and allow you to install gimme_readme.
2. Run the following command to install gimme_readme globally
npm i -g gimme_readme
NOTE: MAC/LINUX users may need to run sudo npm i -g gimme_readme
3. Generate a configuration file by running in any folder you'd like
gr-ai -c
This command creates a .gimme_readme_config file in your home directory. Do not move this file from this location.
Follow the instructions in the file to create your own API keys and set your own default values.
Congratulations! You just installed gimme_readme to your system and if you created your own API keys, you should be able to use gimme_readme on the command-line!
With installation out of the way, let's delve into how you can use gimme_readme.
Features of gimme_readme
At a top level, gimme_readme supports the following features:
- The ability to display a help page.
- The ability to get gimme_readme's version number.
- The ability to create a .gimme_readme_config file or locate it
- The ability to send it source files, and have an AI model provide an explanation for your source code files.
- The ability to choose where the AI model's explanation is outputted (i.e., to a file or to your terminal).
- The ability to specify the AI model that provides explanations for you.
- The ability to send your own custom AI prompt.
- The ability to set the temperature of your model (i.e., how deterministic you want your model's response to be).
Let's show you demonstrations of each feature.
Example usage
Display the help page
The most basic gimme_readme command is:
gr-ai
This shows us how use gr-ai and its different options.
Display the version number
Providing the -v option to the gr-ai command returns the version number
gr-ai -v
Create a .gimme_readme_config file or find the path to your existing one
gr-ai -c
Takes several input files, choose your LLM of choice, and outputs the selected LLM's response to a file
# file file model output file gr-ai -f .prettierignore .gitignore -m gemini-1.5-flash -o explain.md
Conclusion
If you made it this far, I'd like to thank you for giving this blog a read. Creating the 0.1 release of gimme_readme has been a great experience, and I’m excited to continue developing new features and improving the tool. If you're interested in trying it out or contributing, feel free to check out the GitHub repository.
Stay tuned for more updates in the coming weeks!
Links
- GitHub Repository: gimme_readme
- Demo Video: Watch the 0.1 Release Demo
위 내용은 개발 로그: gimme_readme 릴리스의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

Python은 부드러운 학습 곡선과 간결한 구문으로 초보자에게 더 적합합니다. JavaScript는 가파른 학습 곡선과 유연한 구문으로 프론트 엔드 개발에 적합합니다. 1. Python Syntax는 직관적이며 데이터 과학 및 백엔드 개발에 적합합니다. 2. JavaScript는 유연하며 프론트 엔드 및 서버 측 프로그래밍에서 널리 사용됩니다.

C/C에서 JavaScript로 전환하려면 동적 타이핑, 쓰레기 수집 및 비동기 프로그래밍으로 적응해야합니다. 1) C/C는 수동 메모리 관리가 필요한 정적으로 입력 한 언어이며 JavaScript는 동적으로 입력하고 쓰레기 수집이 자동으로 처리됩니다. 2) C/C를 기계 코드로 컴파일 해야하는 반면 JavaScript는 해석 된 언어입니다. 3) JavaScript는 폐쇄, 프로토 타입 체인 및 약속과 같은 개념을 소개하여 유연성과 비동기 프로그래밍 기능을 향상시킵니다.

웹 개발에서 JavaScript의 주요 용도에는 클라이언트 상호 작용, 양식 검증 및 비동기 통신이 포함됩니다. 1) DOM 운영을 통한 동적 컨텐츠 업데이트 및 사용자 상호 작용; 2) 사용자가 사용자 경험을 향상시키기 위해 데이터를 제출하기 전에 클라이언트 확인이 수행됩니다. 3) 서버와의 진실한 통신은 Ajax 기술을 통해 달성됩니다.

실제 세계에서 JavaScript의 응용 프로그램에는 프론트 엔드 및 백엔드 개발이 포함됩니다. 1) DOM 운영 및 이벤트 처리와 관련된 TODO 목록 응용 프로그램을 구축하여 프론트 엔드 애플리케이션을 표시합니다. 2) Node.js를 통해 RESTFULAPI를 구축하고 Express를 통해 백엔드 응용 프로그램을 시연하십시오.

보다 효율적인 코드를 작성하고 성능 병목 현상 및 최적화 전략을 이해하는 데 도움이되기 때문에 JavaScript 엔진이 내부적으로 작동하는 방식을 이해하는 것은 개발자에게 중요합니다. 1) 엔진의 워크 플로에는 구문 분석, 컴파일 및 실행; 2) 실행 프로세스 중에 엔진은 인라인 캐시 및 숨겨진 클래스와 같은 동적 최적화를 수행합니다. 3) 모범 사례에는 글로벌 변수를 피하고 루프 최적화, Const 및 Lets 사용 및 과도한 폐쇄 사용을 피하는 것이 포함됩니다.

Python과 JavaScript는 커뮤니티, 라이브러리 및 리소스 측면에서 고유 한 장점과 단점이 있습니다. 1) Python 커뮤니티는 친절하고 초보자에게 적합하지만 프론트 엔드 개발 리소스는 JavaScript만큼 풍부하지 않습니다. 2) Python은 데이터 과학 및 기계 학습 라이브러리에서 강력하며 JavaScript는 프론트 엔드 개발 라이브러리 및 프레임 워크에서 더 좋습니다. 3) 둘 다 풍부한 학습 리소스를 가지고 있지만 Python은 공식 문서로 시작하는 데 적합하지만 JavaScript는 MDNWebDocs에서 더 좋습니다. 선택은 프로젝트 요구와 개인적인 이익을 기반으로해야합니다.

개발 환경에서 Python과 JavaScript의 선택이 모두 중요합니다. 1) Python의 개발 환경에는 Pycharm, Jupyternotebook 및 Anaconda가 포함되어 있으며 데이터 과학 및 빠른 프로토 타이핑에 적합합니다. 2) JavaScript의 개발 환경에는 Node.js, VScode 및 Webpack이 포함되어 있으며 프론트 엔드 및 백엔드 개발에 적합합니다. 프로젝트 요구에 따라 올바른 도구를 선택하면 개발 효율성과 프로젝트 성공률이 향상 될 수 있습니다.

C와 C는 주로 통역사와 JIT 컴파일러를 구현하는 데 사용되는 JavaScript 엔진에서 중요한 역할을합니다. 1) C는 JavaScript 소스 코드를 구문 분석하고 추상 구문 트리를 생성하는 데 사용됩니다. 2) C는 바이트 코드 생성 및 실행을 담당합니다. 3) C는 JIT 컴파일러를 구현하고 런타임에 핫스팟 코드를 최적화하고 컴파일하며 JavaScript의 실행 효율을 크게 향상시킵니다.
