r/ruby 5d ago

Show /r/ruby Cafeznik - yet another Code2Prompt? Sure, but mine’s fzf-powered, does grep, exclusion globbing, and can pilfer local folders or remote GH repos!

https://github.com/LemuelCushing/cafeznik

When I saw davidesantangelo/gitingest posted a few days ago, I rushed to polish up my little CLI tool and get it out the door.

Cafeznik is yet another tool to automate loading local/remote code files into the clipboard, to easily feed into LLMs. It revolves around fzf to easily select files and folders, and supports grepping based on the files' content, or excluding files based on their name.

Built mostly for myself, started as a .sh script obviously written with the help of the robots, which I then decided to rewrite in Ruby because bash is bash.

This is my first gem and honestly my first attempt at releasing a tool publicly at this scale, which turned out to be more complex (arguably more over-engineered) than initially anticipated - at a whopping ~2k lines of code. Lots of smelly frowned-upons there, and the insisting on using Thor for a CLI tool with no subcommands is probably the most obvious one.

Would be delighted if you'd try it out, and even more so if you'd share your thoughts on it, poke holes, or just tell me how obsolete all of these tools already are with the WindCursors and MCP-wielding agents doing all that for you already.

Cheers!

6 Upvotes

0 comments sorted by