CLOCTUI is a terminal user interface (TUI) for the CLOC code analysis tool, built using the Textual framework.
CLOCTUI runs CLOC under the hood and then displays the results in an interactive table. It makes the results of CLOC much more pleasant to view, especially for large code bases.
- Group by language, directory, or show all individual files. This works the same as CLOC's different modes, but interactive.
- Sort any column in the table by clicking the header or using keyboard shortcuts.
- You can run in Inline mode (default), or run in fullscreen mode with the
-f
flag.
CLOCTUI requires Python 3.10 or later and the CLOC command line tool to be installed on your system.
It's also recommended to have a python tool manager such as UV or PipX installed to manage the installation of CLOCTUI.
You can test CLOCTUI without installing it by using UV or PipX.
Using the uvx
or pipx run
commands:
Enter uvx cloctui
(or pipx run
) followed by the path you want to scan as the only argument:
uvx cloctui src
pipx run cloctui src
Both the above commands will run CLOC on the src
directory and display the results.
A dot would likewise scan the current directory:
uvx cloctui .
The recommended way to use CLOCTUI is as a global tool managed with UV or PipX.
uv tool install cloctui
pipx install cloctui
Once installed, you can use the cloctui
command anywhere. To scan the src
folder in your current directory:
cloctui src
You can use the -f
flag to run in Fullscreen mode
cloctui src -f
CLOC is an awesome program, and there's numerous features it has which are not integrated into CLOCTUI. In the future if this tool gets any serious usage, I'd be more than happy to consider adding more cool CLOC feature integrations.
Feel free to raise issues and bugs in the issues section, and post any ideas / feature requests on the Ideas discussion board.
CLOCTUI is developed by Edward Jazzhands
A core class for this project was copied from Stefano Stone: https://github.com/USIREVEAL/pycloc
It was modified by Edward Jazzhands (added all type hints and improved docstrings).
Both CLOCTUI and pycloc are licensed under the MIT License.