code2prompt icon indicating copy to clipboard operation
code2prompt copied to clipboard

--exclude in new v2.x does not work as instructed

Open elvismdev opened this issue 1 year ago • 1 comments

Upgraded from v1.x to v2.x and tried this command:

code2prompt ./ --exclude="vendor,node_modules,build,composer.lock,package-lock.json,code2prompt.md" --exclude-from-tree --output=code2prompt.md

But all the excluded files are included in the output.

elvismdev avatar Sep 21 '24 07:09 elvismdev

Hi! It looks like you're using the glob patterns wrong, I made the same mistake. Here is the explanation: https://github.com/mufeedvh/code2prompt/issues/31#issuecomment-2216852875

Should be like: code2prompt <pathtoyourcodebase> --exclude "**/package.json"

Gaket avatar Sep 24 '24 01:09 Gaket

How to exclude node_modules/ directory?

LinuxIsCool avatar Feb 05 '25 20:02 LinuxIsCool