TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: No more copy-pasting – a ChatGPT plugin to read code from your computer

46 pointsby kesoralmost 2 years ago
Introducing the Code ChatGPT Plugin - a new era of seamless interaction between ChatGPT and your codebase. This TypeScript Code Analyzer furnishes a suite of utilities to analyze TypeScript code, enabling ChatGPT to &quot;talk&quot; with YOUR code.<p>Fetch a list of all the files in your project, list of every function in a TypeScript or JavaScript file, or even get the content of a specific function, all while staying in your conversation with ChatGPT. With accessible API endpoints, you can effortlessly navigate your codebase and ask ChatGPT anything you can think of about it.<p>Say goodbye to the days of incessant copy-pasting and welcome a more streamlined code discussion experience .<p>I&#x27;d love to hear your thoughts, experiences, and suggestions for improvement. Let&#x27;s discuss and evolve this tool together!

8 comments

raincolealmost 2 years ago
I&#x27;d like to know how these kinds of tools (Copilot included) avoid reading users&#x27; secret tokens and passwords.<p>But knowing how we programmers work and how we treat security collectively, I guess I&#x27;ve already had the answer.
评论 #36116335 未加载
评论 #36100980 未加载
评论 #36102495 未加载
tikkunalmost 2 years ago
Smart approach to have a locally running application as a way of letting chatgpt plug-ins access local files, nice!<p>And nice ChatGPT written post ;) it seems to love saying things like “let’s [] and [] together!”<p>This seems really useful, thanks for making it.
评论 #36102501 未加载
kesoralmost 2 years ago
IMPORTANT: A fascinating approach to better improve on a project-wide basis instead of a small-scope basis.<p>1. Prompt: &quot;Read project code files. Describe the flow of &lt;whatever it is doing&gt;? Just a step by step description of each operation taking place that this software is doing. Be as detailed as you possibly can.&quot;<p>2. Prompt: &quot;Suggest improvements to this process described above, how &lt;new feature&gt;, how &lt;new feature&gt; taken into account, and add any additional edge cases that you can think of to make the process more robust and to cause it &lt;do whatever&gt; in a more complete way.<p>3. *WRITE THE TWO ABOVE ANSWERS INTO A FILE CALLED GAME_PLAN.md*<p>4. Prompt: &quot;Read the file called GAME_PLAN.md and write code that implements the first improvement.&quot;<p>5. Profit!
canadiantimalmost 2 years ago
I’d love to be able to use something like this for my Python codebase, think you’ll ever expand to other languages?
评论 #36102638 未加载
searchableguyalmost 2 years ago
I use Github Copilot Chat for the same which works with vscode directly. Any advantage over that?
评论 #36100512 未加载
评论 #36102520 未加载
评论 #36100853 未加载
idmontiealmost 2 years ago
Reminds me of a little vscode extension I wrote for myself to integrate ChatGPT into my projects. I didn&#x27;t do a great job with documentation, but you can reference other files within comments to send them as context. So something like<p>&#x2F;* Write tests for [xyz&#x2F;(.&#x2F;xyz.ts) using [abc tests](.&#x2F;abc.spec.ts) as an example to reference<p>@ChatGPT *&#x2F;<p>Reference: <a href="https:&#x2F;&#x2F;github.com&#x2F;CapsuleCat&#x2F;sora-by-capsule-cat">https:&#x2F;&#x2F;github.com&#x2F;CapsuleCat&#x2F;sora-by-capsule-cat</a><p>I&#x27;ll have to check out how your version pulls in the project as context.
评论 #36102506 未加载
irthomasthomasalmost 2 years ago
&quot;a new era&quot;, really?<p>ChatGPT can be quite corny in default mode. I recommend experimenting with prompts to make it sound more natural, and not using its responses verbatim in your communications.<p>Cool project though.
评论 #36108034 未加载
anotherpaulgalmost 2 years ago
Super interesting project! I like that you&#x27;re exposing the structure of the git repo to GPT, and helping it understand and access the code in a semantically meaningful way via the function definition APIs.<p>I&#x27;ve been working on similar things with GPT, but in a language agnostic way. That makes things a bit trickier, having to parse arbitrary source code languages.<p>I was curious how you were parsing&#x2F;lexing the files to pull out functions. I asked GPT about your repo, to see if I might find some useful tools for my project. It provided the helpful summary below.<p>Looks like you&#x27;re using typescript-estree to parse the code?<p><pre><code> $ git clone https:&#x2F;&#x2F;github.com&#x2F;kesor&#x2F;chatgpt-code-plugin.git $ cd chatgpt-code-plugin $ aider Using git repo: .git Use &#x2F;help to see in-chat commands. &gt;&gt;&gt; how does this package find and index all the functions? This package finds and indexes all the functions using the following process: 1 It starts by getting a list of all the files in the project using the getFileList function in src&#x2F;function-utils.ts. This function recursively traverses the directories and returns an array of file paths. 2 For each file in the list, the getFunctionList function in src&#x2F;function-utils.ts is called. This function reads the file content and parses it into an Abstract Syntax Tree (AST) using a TypeScript parser. 3 The findFunctionsInFile function in src&#x2F;function-utils.ts is then called with the AST as an argument. This function traverses the AST and identifies function declarations, function expressions, and class methods. It collects information about each function, such as its name, start and end positions, and stores it in an array. 4 Finally, the package returns an array of objects containing information about all the functions found in the project. This array can be used to index the functions and perform further operations, such as retrieving the function&#x27;s code or analyzing its structure. &gt;&gt;&gt; does it use any pre-built packages for this? or is it all homebrew? Yes, this package uses some pre-built packages to achieve its functionality. Here are the main ones: 1 @typescript-eslint&#x2F;typescript-estree: This package is used to parse TypeScript code into an Abstract Syntax Tree (AST). It is used in the getFunctionList function to parse the file content and generate an AST. 2 fs: This is a built-in Node.js module for working with the file system. It is used to read directories, read file content, and check file stats. 3 ignore: This package is used to filter out files and directories based on the rules specified in the .gitignore file. It is used in the getFileList function to exclude files and directories that should not be processed. 4 path: This is a built-in Node.js module for working with file and directory paths. It is used to join and resolve paths, and to get relative paths. These pre-built packages are combined with custom code to find and index all the functions in the project.</code></pre>
评论 #36102544 未加载
评论 #36102874 未加载
评论 #36102533 未加载