mufeedvh / code2prompt

A CLI tool to convert your codebase into a single LLM prompt with source tree, prompt templating, and token counting.
MIT License
1.45k stars 77 forks source link

Does not copy to clipboard #10

Closed ahonnecke closed 3 months ago

ahonnecke commented 4 months ago
▹▹▹▹▸ Done!                                                                                                                                                               [✓] Prompt copied to clipboard!

However, nothing had been copied to the clipboard. Has this been tested on a linux machine?

ahonnecke commented 4 months ago

I can reproduce this when I build it locally as well.

mufeedvh commented 4 months ago

Hey @ahonnecke, thank you for opening an issue on this. Can you please send the complete output from code2prompt with --tokens flag used?

ngirard commented 4 months ago

Hey @mufeedvh , my colleague and I are experiencing the same problem, with both the precompiled and a manually compiled version.

Here's the output from within my local copy of code2prompt.git:

code2prompt --tokens .
▹▹▹▹▸ Done!                                                                                                                                                                                           [i] Token count: 10499, Model info: ChatGPT models, text-embedding-ada-002
[✓] Prompt copied to clipboard!

I'm running Xorg in Ubuntu 23.10.

rohan-paul commented 4 months ago

Yes having same issue in Ubuntu 20.04 as well.

However absolutely great tool, and Thank You @mufeedvh for open-sourcing it.

RastislavKish commented 4 months ago

Hello,

@mufeedvh the problem with Linux clipboard is that the running process is always responsible for providing the copied data, when the process exits, the information is efficiently lost (it's the same as if the clipboard was cleared out). There are workarounds for this problem, see for example the arboard examples, but it is sort of a drag to implement.

ODAncona commented 3 months ago

@RastislavKish Hello, it's fixed in #20 using the use arboard::Clipboard;

mufeedvh commented 3 months ago

Fixed in #20 by @ODAncona! 🙌 🎉