top | item 43048831

(no title)

crisbal_ | 1 year ago

I use the following for feeding into AI

   find . -print -exec cat {} \; -exec echo \;
Which will return for each file (and subfolders) the filename and then the content of the file.

Then `| pbcopy` to copy to clipboard and paste it into ChatGPT or similar.

discuss

order

singpolyma3|1 year ago

I guess this only works for very small codebase?

OsrsNeedsf2P|1 year ago

Correct, but it's the same as what OP shared.

You should use Aider/Cursor for proper indexing/intelligent codebase referencing

usagisushi|1 year ago

Or, for a lazier approach:

    $ head -10000 *
    ==> package.json <==
    {
      "name": ...
      ...
    ==> tsconfig.json <==
    {
       "extends": ...
      ...

    $ head -10000 * | llm -s "generate a patch to switch this project to esm"

DrPhish|1 year ago

That's very nice and compact. I do the same with a short bash script, but wrap each file in triple-backticks and attempt to put the correct language label on each eg:

Filename: demo.py

```python

   ...python code here...
```

genewitch|1 year ago

Seconded because just having something autowrapped like that and putting the clipboard would save me time: release the snyder cut, er, bash script!

mbonnet|1 year ago

Mind sharing the script?