raphaelmansuy / code2prompt

Code2Prompt is a powerful command-line tool that simplifies the process of providing context to Large Language Models (LLMs) by generating a comprehensive Markdown file containing the content of your codebase. ⭐ If you find Code2Prompt useful, consider giving us a star on GitHub! It helps us reach more developers and improve the tool. ⭐
MIT License
576 stars 32 forks source link

--tokens not printing token count at the end #14

Closed slhck closed 2 months ago

slhck commented 3 months ago

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

raphaelmansuy commented 2 months ago

Fix in version 0.8.1