code2prompt icon indicating copy to clipboard operation
code2prompt copied to clipboard

--tokens not printing token count at the end

Open slhck opened this issue 1 year ago • 0 comments

Describe the bug

Using the --tokens option does not provide tokens in the output at the end but in the beginning.

To Reproduce Steps to reproduce the behavior:

$ code2prompt --path . --filter '*.py' --tokens
✨ INFO: 🔢 Token count: 28383
# Table of Contents
- code2prompt/__init__.py
- code2prompt/main.py
- code2prompt/core/template_processor.py
- code2prompt/core/generate_content.py
- code2prompt/core/process_files.py
- code2prompt/core/__init__.py
- code2prompt/core/process_file.py
- code2prompt/core/write_output.py
- ...

Expected behavior

I think the token count was once printed at the end where it's more useful. If it's in the beginning of the output, it cannot ever be seen with a large code base, because the usual use case is to copy a large set of data, and only get the token count at the end.

As a user, I want to see the token count immediately and not have to scroll back to the top.

Version

0.6.13

slhck avatar Aug 06 '24 07:08 slhck