検索

今日、真夜中に、私はこれまでしたことのないことをしました。つまり、私のプログラム gimme_readme を npm レジストリに公開して、全世界が使用できるようにします!

gimme_readme コマンドライン ツールは、ユーザーのローカル ソース コード ファイルを取得し、それらを使用してコードを説明する README.md ファイルを作成します。 gimme_readme を使用すると、さまざまな AI API (Gemini の gemini-1.5-flash モデルや Groq の llama3-8b-8192 モデルなど) を選択して、提供されたコードを分析し、コードを説明するドキュメントを作成できます。

Dev log: gimme_readme  release

gimme_readme についてさらに詳しく知りたい場合は、以下の私のリポジトリをチェックするか、私のリポジトリにリンクされている 0.1 のリリース デモをご覧ください。

Dev log: gimme_readme  release ピーターダンワン / gimme_readme

gimme_readme

gimme_readme は、AI を活用したコマンドライン ツールで、プロジェクトの包括的な README.md ファイルを生成します。複数のソース コード ファイルを一度に分析し、各ファイルの目的、機能、主要コンポーネントの簡潔な説明をすべて 1 つの読みやすいドキュメントで提供します。これにより、あなたのプロジェクトが他の人にとってより親しみやすく、理解しやすくなります。

Dev log: gimme_readme  release

0.1 リリースのデモをご覧ください!

目次

  1. はじめに
  2. 使用法
  3. 使用例
  4. プロバイダーがサポートするモデル
  5. 貢献
  6. 著者

1.はじめに

gimme_readme の使用を開始するには、次の手順に従ってください:

  1. お使いのオペレーティング システムに最新バージョンの Node.js をインストールします。

  2. 次のコマンドを実行して、gimme_readme をグローバルにインストールします:

    npm i -g gimme_readme
    全画面モードに入る 全画面モードを終了します

    注: MAC/LINUX ユーザーは、sudo npm i -g gimme_readme

    を実行する必要がある場合があります。
  3. 任意のフォルダで実行して構成ファイルを生成します:

    gr-ai -c
    全画面モードに入る 全画面モードを終了します

    このコマンドは、ホーム ディレクトリに .gimme_readme_config ファイルを作成します。 このファイルをこの場所から移動しないでください。

GitHub で表示

Table of Contents

  1. Developing gimme_readme
  2. Getting started with gimme_readme
  3. Features of gimme_readme
  4. Example usage
  5. Conclusion
  6. 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.

Dev log: gimme_readme  release

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:

  1. The ability to display a help page.
  2. The ability to get gimme_readme's version number.
  3. The ability to create a .gimme_readme_config file or locate it
  4. The ability to send it source files, and have an AI model provide an explanation for your source code files.
  5. The ability to choose where the AI model's explanation is outputted (i.e., to a file or to your terminal).
  6. The ability to specify the AI model that provides explanations for you.
  7. The ability to send your own custom AI prompt.
  8. 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

Dev log: gimme_readme  release

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

Dev log: gimme_readme  release

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

Dev log: gimme_readme  release

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 中国語 Web サイトの他の関連記事を参照してください。

声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
JavaScriptエンジンの理解:実装の詳細JavaScriptエンジンの理解:実装の詳細Apr 17, 2025 am 12:05 AM

JavaScriptエンジンが内部的にどのように機能するかを理解することは、開発者にとってより効率的なコードの作成とパフォーマンスのボトルネックと最適化戦略の理解に役立つためです。 1)エンジンのワークフローには、3つの段階が含まれます。解析、コンパイル、実行。 2)実行プロセス中、エンジンはインラインキャッシュや非表示クラスなどの動的最適化を実行します。 3)ベストプラクティスには、グローバル変数の避け、ループの最適化、constとletsの使用、閉鎖の過度の使用の回避が含まれます。

Python vs. JavaScript:学習曲線と使いやすさPython vs. JavaScript:学習曲線と使いやすさApr 16, 2025 am 12:12 AM

Pythonは、スムーズな学習曲線と簡潔な構文を備えた初心者により適しています。 JavaScriptは、急な学習曲線と柔軟な構文を備えたフロントエンド開発に適しています。 1。Python構文は直感的で、データサイエンスやバックエンド開発に適しています。 2。JavaScriptは柔軟で、フロントエンドおよびサーバー側のプログラミングで広く使用されています。

Python vs. JavaScript:コミュニティ、ライブラリ、リソースPython vs. JavaScript:コミュニティ、ライブラリ、リソースApr 15, 2025 am 12:16 AM

PythonとJavaScriptには、コミュニティ、ライブラリ、リソースの観点から、独自の利点と短所があります。 1)Pythonコミュニティはフレンドリーで初心者に適していますが、フロントエンドの開発リソースはJavaScriptほど豊富ではありません。 2)Pythonはデータサイエンスおよび機械学習ライブラリで強力ですが、JavaScriptはフロントエンド開発ライブラリとフレームワークで優れています。 3)どちらも豊富な学習リソースを持っていますが、Pythonは公式文書から始めるのに適していますが、JavaScriptはMDNWebDocsにより優れています。選択は、プロジェクトのニーズと個人的な関心に基づいている必要があります。

C/CからJavaScriptへ:すべてがどのように機能するかC/CからJavaScriptへ:すべてがどのように機能するかApr 14, 2025 am 12:05 AM

C/CからJavaScriptへのシフトには、動的なタイピング、ゴミ収集、非同期プログラミングへの適応が必要です。 1)C/Cは、手動メモリ管理を必要とする静的に型付けられた言語であり、JavaScriptは動的に型付けされ、ごみ収集が自動的に処理されます。 2)C/Cはマシンコードにコンパイルする必要がありますが、JavaScriptは解釈言語です。 3)JavaScriptは、閉鎖、プロトタイプチェーン、約束などの概念を導入します。これにより、柔軟性と非同期プログラミング機能が向上します。

JavaScriptエンジン:実装の比較JavaScriptエンジン:実装の比較Apr 13, 2025 am 12:05 AM

さまざまなJavaScriptエンジンは、各エンジンの実装原則と最適化戦略が異なるため、JavaScriptコードを解析および実行するときに異なる効果をもたらします。 1。語彙分析:ソースコードを語彙ユニットに変換します。 2。文法分析:抽象的な構文ツリーを生成します。 3。最適化とコンパイル:JITコンパイラを介してマシンコードを生成します。 4。実行:マシンコードを実行します。 V8エンジンはインスタントコンピレーションと非表示クラスを通じて最適化され、Spidermonkeyはタイプ推論システムを使用して、同じコードで異なるパフォーマンスパフォーマンスをもたらします。

ブラウザを超えて:現実世界のJavaScriptブラウザを超えて:現実世界のJavaScriptApr 12, 2025 am 12:06 AM

現実世界におけるJavaScriptのアプリケーションには、サーバー側のプログラミング、モバイルアプリケーション開発、モノのインターネット制御が含まれます。 2。モバイルアプリケーションの開発は、ReactNativeを通じて実行され、クロスプラットフォームの展開をサポートします。 3.ハードウェアの相互作用に適したJohnny-Fiveライブラリを介したIoTデバイス制御に使用されます。

next.jsを使用してマルチテナントSaaSアプリケーションを構築する(バックエンド統合)next.jsを使用してマルチテナントSaaSアプリケーションを構築する(バックエンド統合)Apr 11, 2025 am 08:23 AM

私はあなたの日常的な技術ツールを使用して機能的なマルチテナントSaaSアプリケーション(EDTECHアプリ)を作成しましたが、あなたは同じことをすることができます。 まず、マルチテナントSaaSアプリケーションとは何ですか? マルチテナントSaaSアプリケーションを使用すると、Singの複数の顧客にサービスを提供できます

next.jsを使用してマルチテナントSaaSアプリケーションを構築する方法(フロントエンド統合)next.jsを使用してマルチテナントSaaSアプリケーションを構築する方法(フロントエンド統合)Apr 11, 2025 am 08:22 AM

この記事では、許可によって保護されたバックエンドとのフロントエンド統合を示し、next.jsを使用して機能的なedtech SaaSアプリケーションを構築します。 FrontEndはユーザーのアクセス許可を取得してUIの可視性を制御し、APIリクエストがロールベースに付着することを保証します

See all articles

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

AI Hentai Generator

AI Hentai Generator

AIヘンタイを無料で生成します。

ホットツール

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser は、オンライン試験を安全に受験するための安全なブラウザ環境です。このソフトウェアは、あらゆるコンピュータを安全なワークステーションに変えます。あらゆるユーティリティへのアクセスを制御し、学生が無許可のリソースを使用するのを防ぎます。

AtomエディタMac版ダウンロード

AtomエディタMac版ダウンロード

最も人気のあるオープンソースエディター

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

Dreamweaver Mac版

Dreamweaver Mac版

ビジュアル Web 開発ツール