Skip to content

[Feature request]: make code_helper use its standard input #1869

@gautaz

Description

@gautaz

What do you need?

FWIU, code_helper is good at preparing a JSON input containing a code base to send to an AI.

Currently, it takes everything it finds in a given directory but some files depending on the ignore option (or the lack of it, its default being ".git,node_modules,vendor").
In order for this tool to be closer to the UNIX philosophy, I would have asked it to take the list of files to consider from its standard input.

Doing this would make scenarii like these ones possible:

git ls-files | code_helper | fabric ...
find . -name '*.py' | code_helper | fabric ...
find . | grep -E '.*.pth' | code_helper | fabric ...

It would also avoid the burden of supporting other options like --depth and all other features that users might need in the future.
All these needs would then just be a matter of providing the good input to code_helper by delegating it to other CLI commands.

Aside from this, I would perhaps rename code_helper to somewhat closer to its purpose, perplexity proposed these names:

  • fs2json
  • file2json
  • file-json

I am pretty sure there are even better names reflecting the purpose of code_helper but I must admit I am not good at finding sound names.

NOTE: While reading the description of code_helper, I found myself comparing it to tar but instead of producing a binary archive, it delivers a "JSON archive".

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions