ThuOneCopy: desktop code consolidator for LLM prompts
ThuOneCopy turns a project folder into one prompt-ready block. Version 2 restructured a single-file prototype into a layered, Clean-Architecture-style desktop app with auto-update.
- Period
- Dec 2024
- Technologies
- 3
- Diagrams
- 1
- Reading time
- 1 min
Summary
v2 restructured the single-file prototype into a layered “clean” layout: app (entry), core (config + example config), data (datasources, file / settings repositories), domain (models), services (file, settings), ui (main window, header, widgets: about popup, buy-coffee popup, checkbox delegate, consolidate tab, update popup), utils (description formatting with bold / break / link markup, helpers, update checker). That layout was generated by the owner’s scaffolder (S03).
Remote configuration / updates: Firebase Remote Config has no Python SDK, so the app reads a Firestore document (REST via requests, .env config) for the latest version, release notes and download URL. packaging.version compares versions and an update popup links to the release.
Packaged with PyInstaller (--onefile --windowed --add-data ".env;.", icon, rename to ThuOneCopy / TuOneCopy).
Stack
PyQt5 5.15.11 (QTreeView / model with check states, QTabWidget, delegates, dialogs), python-dotenv, requests, packaging; PyInstaller (ThuOneCopy.spec, TuOneCopy.spec, main.spec, build.py); tests (test_file_service.py).
Architecture
Diagram as text
flowchart LR UI[MainWindow: tree + tabs + selected list + filters] --> FS[FileService] FS --> REPO[FileRepository / SettingsRepository] REPO --> DISK[(Filesystem)] UI --> CT[ConsolidateCodeTab: build combined text → clipboard] UI --> UPD[UpdateChecker] -->|REST| FIRE[(Firestore config doc)] UPD --> POP[UpdatePopup → download release]
Features
Folder tree with checkboxes (recursive select / toggle per folder), click-to-open tabs, close tabs, selected-files list (sync both ways), extension / name filters, consolidated copy with file headers, comment / import stripping and numbering (from S01 v2), class-name extraction, edit consolidated text with undo / redo, whitespace cleanup, about popup with rich text, buy-coffee popup, update check and popup, contact mail.
Resume Bullet
Built and shipped a PyQt5 desktop tool (VS Code-style tree and tabs) that consolidates multi-file codebases into LLM-ready prompts, with Firestore-driven auto-update checks and PyInstaller releases; evolved from 15 iterative prototypes.
Related projects
AI and LLM experiments
Experiments with LLM APIs: a Flask chat over several providers, speech-to-text and model tests, and a React and shadcn debugging sandbox.
PythonFastAPI / FlaskLLM integrationReact+1copyCode prototypes: 15 versions towards ThuOneCopy
Fifteen PyQt5 prototype versions of a tool that copies selected project files as one block for ChatGPT, evolving into ThuOneCopy.
PythonDesktop GUI (Tk / Qt)HAR and Copy-as-fetch to API documentation formatter
A Tkinter and browser tool that turns HAR files and Copy-as-fetch strings into clean API documentation, with key masking for safe sharing.
PythonDesktop GUI (Tk / Qt)JavaScriptWant to discuss this project?
Happy to walk through the architecture, trade-offs or the code.