llmscribe 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- llmscribe-1.0.0/LICENSE +201 -0
- llmscribe-1.0.0/PKG-INFO +446 -0
- llmscribe-1.0.0/README.md +420 -0
- llmscribe-1.0.0/pyproject.toml +54 -0
- llmscribe-1.0.0/setup.cfg +4 -0
- llmscribe-1.0.0/src/llmscribe/__init__.py +7 -0
- llmscribe-1.0.0/src/llmscribe/cli/__init__.py +1 -0
- llmscribe-1.0.0/src/llmscribe/cli/main.py +121 -0
- llmscribe-1.0.0/src/llmscribe/core/__init__.py +17 -0
- llmscribe-1.0.0/src/llmscribe/core/file_reader.py +64 -0
- llmscribe-1.0.0/src/llmscribe/core/tree_builder.py +91 -0
- llmscribe-1.0.0/src/llmscribe/core/writer.py +50 -0
- llmscribe-1.0.0/src/llmscribe/cui/__init__.py +1 -0
- llmscribe-1.0.0/src/llmscribe/cui/main.py +98 -0
- llmscribe-1.0.0/src/llmscribe/gui/__init__.py +1 -0
- llmscribe-1.0.0/src/llmscribe/gui/__main__.py +9 -0
- llmscribe-1.0.0/src/llmscribe/gui/app.py +613 -0
- llmscribe-1.0.0/src/llmscribe/py.typed +0 -0
- llmscribe-1.0.0/src/llmscribe.egg-info/PKG-INFO +446 -0
- llmscribe-1.0.0/src/llmscribe.egg-info/SOURCES.txt +23 -0
- llmscribe-1.0.0/src/llmscribe.egg-info/dependency_links.txt +1 -0
- llmscribe-1.0.0/src/llmscribe.egg-info/entry_points.txt +4 -0
- llmscribe-1.0.0/src/llmscribe.egg-info/top_level.txt +1 -0
- llmscribe-1.0.0/tests/test_cli.py +23 -0
- llmscribe-1.0.0/tests/test_core.py +66 -0
llmscribe-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
llmscribe-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: llmscribe
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Export a project folder into a single, LLM-ready text file — directory tree plus full file contents.
|
|
5
|
+
Author: Amrito Kundu
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/AMRITO-KUNDU/LLMScribe
|
|
8
|
+
Project-URL: Repository, https://github.com/AMRITO-KUNDU/LLMScribe
|
|
9
|
+
Project-URL: Issues, https://github.com/AMRITO-KUNDU/LLMScribe/issues
|
|
10
|
+
Keywords: cli,llm,codebase,developer-tools,context,prompt-engineering,code-export
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Environment :: X11 Applications
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
21
|
+
Classifier: Topic :: Utilities
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# LLMScribe
|
|
28
|
+
|
|
29
|
+
LLMScribe is an open-source Python tool that exports an entire software project into a single readable text file. It generates a directory tree followed by the full contents of every supported source file, making it ideal for AI coding assistants, code reviews, documentation, debugging, and sharing codebases.
|
|
30
|
+
|
|
31
|
+
It ships with three interfaces so you can use whichever fits your workflow: a graphical desktop app, an interactive terminal menu, and a scriptable CLI.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Table of Contents
|
|
36
|
+
|
|
37
|
+
- [Features](#features)
|
|
38
|
+
- [Project Structure](#project-structure)
|
|
39
|
+
- [Requirements](#requirements)
|
|
40
|
+
- [Installation](#installation)
|
|
41
|
+
- [Usage](#usage)
|
|
42
|
+
- [CLI](#cli)
|
|
43
|
+
- [GUI App](#gui-app)
|
|
44
|
+
- [Terminal Menu (CUI)](#terminal-menu-cui)
|
|
45
|
+
- [Python API](#python-api)
|
|
46
|
+
- [Output Format](#output-format)
|
|
47
|
+
- [What Gets Included](#what-gets-included)
|
|
48
|
+
- [What Gets Ignored](#what-gets-ignored)
|
|
49
|
+
- [Core API Reference](#core-api-reference)
|
|
50
|
+
- [License](#license)
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Features
|
|
55
|
+
|
|
56
|
+
- **Directory tree** — generates a visual `├──` tree of your project structure.
|
|
57
|
+
- **Tree-only mode** — export only the project directory tree without reading or including file contents, via the `--tree-only` CLI flag or the "Tree only" checkbox in the GUI.
|
|
58
|
+
- **Full file content extraction** — reads every supported text file and appends its complete, untruncated contents below the tree.
|
|
59
|
+
- **Smart filtering** — skips build outputs, dependency folders, IDE files, and OS noise out of the box.
|
|
60
|
+
- **`.gitignore` aware** — loads and respects the project's own `.gitignore` automatically.
|
|
61
|
+
- **Three interfaces** — GUI desktop app, interactive terminal menu, and a fully scriptable CLI.
|
|
62
|
+
- **Embeddable core** — the `llmscribe.core` package can be imported directly into other Python projects.
|
|
63
|
+
- **Cross-platform** — runs on Windows, macOS, and Linux anywhere Python 3.10+ is available.
|
|
64
|
+
- **Installable like any real CLI** — `pip install llmscribe` gives you the `llmscribe`, `llmscribe-gui`, and `llmscribe-cui` commands, usable from any terminal.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Project Structure
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
LLMScribe/
|
|
72
|
+
├── src/
|
|
73
|
+
│ └── llmscribe/ # Installable package (import as `llmscribe.*`)
|
|
74
|
+
│ ├── __init__.py # Package version
|
|
75
|
+
│ ├── core/ # All scanning and writing logic
|
|
76
|
+
│ │ ├── __init__.py # Public API surface
|
|
77
|
+
│ │ ├── file_reader.py # Extension allowlist + full file reading
|
|
78
|
+
│ │ ├── tree_builder.py # Directory tree + ignore rule engine
|
|
79
|
+
│ │ └── writer.py # Orchestrates tree + contents into output
|
|
80
|
+
│ ├── cli/ # Scriptable command-line interface
|
|
81
|
+
│ │ ├── __init__.py
|
|
82
|
+
│ │ └── main.py
|
|
83
|
+
│ ├── cui/ # Interactive terminal menu
|
|
84
|
+
│ │ ├── __init__.py
|
|
85
|
+
│ │ └── main.py
|
|
86
|
+
│ └── gui/ # Tkinter desktop application
|
|
87
|
+
│ ├── __init__.py
|
|
88
|
+
│ ├── __main__.py # `python -m llmscribe.gui` entrypoint
|
|
89
|
+
│ └── app.py
|
|
90
|
+
├── pyproject.toml
|
|
91
|
+
├── LICENSE
|
|
92
|
+
├── README.md
|
|
93
|
+
└── CONTRIBUTING.md
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Requirements
|
|
99
|
+
|
|
100
|
+
- **Python 3.10** or higher
|
|
101
|
+
- **Tkinter (GUI only)** — required only for `llmscribe-gui`, `llmscribe --gui`, and the GUI picker in the CUI. The core library and non-GUI CLI work without Tkinter. It ships with most Python installers; on Linux it may need to be installed separately:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Debian / Ubuntu
|
|
105
|
+
sudo apt install python3-tk
|
|
106
|
+
|
|
107
|
+
# Fedora
|
|
108
|
+
sudo dnf install python3-tkinter
|
|
109
|
+
|
|
110
|
+
# Arch
|
|
111
|
+
sudo pacman -S tk
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
No third-party Python packages are required — the standard library is sufficient.
|
|
115
|
+
|
|
116
|
+
Headless Linux servers can use the CLI and library integration without Tkinter. If GUI mode is requested without it, LLMScribe prints an installation hint.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Installation
|
|
121
|
+
|
|
122
|
+
**From PyPI (once published):**
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
pip install llmscribe
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
This installs three console commands anywhere on your system: `llmscribe`, `llmscribe-gui`, and `llmscribe-cui`.
|
|
129
|
+
|
|
130
|
+
**From source (development):**
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
git clone https://github.com/AMRITO-KUNDU/LLMScribe.git
|
|
134
|
+
cd LLMScribe
|
|
135
|
+
pip install -e .
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
`pip install -e .` (editable install) picks up local code changes immediately without reinstalling — use this while developing.
|
|
139
|
+
|
|
140
|
+
**Publishing to PyPI yourself:**
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
pip install build twine
|
|
144
|
+
python -m build
|
|
145
|
+
twine upload dist/*
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
For automated releases, configure PyPI Trusted Publishing for the GitHub
|
|
149
|
+
repository and create a tag such as `v1.0.0`. The workflow in
|
|
150
|
+
`.github/workflows/publish.yml` then builds and publishes the wheel and source
|
|
151
|
+
distribution without storing a PyPI token in GitHub secrets.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Usage
|
|
156
|
+
|
|
157
|
+
### CLI
|
|
158
|
+
|
|
159
|
+
The CLI is designed for scripting, automation, and CI pipelines. All options are passed as flags.
|
|
160
|
+
|
|
161
|
+
**Basic usage:**
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Scan a project and write to the default output file
|
|
165
|
+
llmscribe --path /path/to/project
|
|
166
|
+
|
|
167
|
+
# Specify a custom output file
|
|
168
|
+
llmscribe --path /path/to/project --output ~/exports/my_project.txt
|
|
169
|
+
|
|
170
|
+
# Export only the directory tree
|
|
171
|
+
llmscribe --path /path/to/project --tree-only
|
|
172
|
+
|
|
173
|
+
# Open a GUI folder picker instead of typing a path
|
|
174
|
+
llmscribe --gui
|
|
175
|
+
|
|
176
|
+
# Run interactively (prompts for a path, then falls back to the GUI picker)
|
|
177
|
+
llmscribe
|
|
178
|
+
|
|
179
|
+
# Check the installed version
|
|
180
|
+
llmscribe --version
|
|
181
|
+
llmscribe-cui --version
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**All flags:**
|
|
185
|
+
|
|
186
|
+
| Flag | Default | Description |
|
|
187
|
+
|---|---|---|
|
|
188
|
+
| `--path PATH` | _(none)_ | Path to the project folder to scan. |
|
|
189
|
+
| `--output FILE` | `project_overview.txt` | Where to write the output. Parent directories are created automatically. |
|
|
190
|
+
| `--tree-only` | `false` | Export only the directory tree and skip file contents. |
|
|
191
|
+
| `--gui` | `false` | Open a GUI folder picker dialog instead of reading `--path`. |
|
|
192
|
+
| `--version` | — | Print the installed LLMScribe version and exit. |
|
|
193
|
+
|
|
194
|
+
**Getting help:**
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
llmscribe --help
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### GUI App
|
|
203
|
+
|
|
204
|
+
The desktop app is the easiest way to use LLMScribe. It provides a two-panel layout: controls on the left, a live preview of the generated output on the right.
|
|
205
|
+
|
|
206
|
+
**Launch:**
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
llmscribe-gui
|
|
210
|
+
# or
|
|
211
|
+
llmscribe --gui
|
|
212
|
+
# or, without installing console scripts
|
|
213
|
+
python -m llmscribe.gui
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Workflow:**
|
|
217
|
+
|
|
218
|
+
1. Click the folder icon next to **Project Folder** and select your project root, or type the path directly.
|
|
219
|
+
2. The **Output File** field auto-populates to `<project>/project_overview.txt`. Change it if needed.
|
|
220
|
+
3. Tick **Tree only (skip file contents)** if you just want the directory structure without reading any file contents.
|
|
221
|
+
4. Click **Generate**. The preview pane fills with the output and the line count appears in the header.
|
|
222
|
+
5. Use **Copy output** to copy the full text to the clipboard, or **Open file** to open the saved file in your system's default text editor.
|
|
223
|
+
|
|
224
|
+
The GUI runs the scan in a background thread so the window stays responsive on large projects.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
### Terminal Menu (CUI)
|
|
229
|
+
|
|
230
|
+
The CUI is an interactive numbered menu intended for terminal users and for embedding LLMScribe into other projects or scripts that call it as a subprocess.
|
|
231
|
+
|
|
232
|
+
**Launch:**
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
llmscribe-cui
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**Menu:**
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
LLMScribe CUI
|
|
242
|
+
1) Enter project folder path
|
|
243
|
+
2) Open GUI folder picker
|
|
244
|
+
3) Quit
|
|
245
|
+
Choose an option [1-3]:
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
You can also pass flags to skip the menu entirely:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
llmscribe-cui --path /path/to/project --output summary.txt
|
|
252
|
+
llmscribe-cui --gui --output summary.txt --tree-only
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
### Python API
|
|
258
|
+
|
|
259
|
+
Import LLMScribe's core directly into your own Python scripts or tools.
|
|
260
|
+
|
|
261
|
+
**Generate a summary string:**
|
|
262
|
+
|
|
263
|
+
```python
|
|
264
|
+
from pathlib import Path
|
|
265
|
+
from llmscribe.core.writer import build_project_summary
|
|
266
|
+
|
|
267
|
+
summary = build_project_summary(
|
|
268
|
+
Path("/path/to/project"),
|
|
269
|
+
tree_only=True,
|
|
270
|
+
)
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
**Generate and save to a file:**
|
|
274
|
+
|
|
275
|
+
```python
|
|
276
|
+
from pathlib import Path
|
|
277
|
+
from llmscribe.core.writer import run
|
|
278
|
+
|
|
279
|
+
run(
|
|
280
|
+
project_path=Path("/path/to/project"),
|
|
281
|
+
output_file=Path("summary.txt"),
|
|
282
|
+
tree_only=True,
|
|
283
|
+
)
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**Use individual components:**
|
|
287
|
+
|
|
288
|
+
```python
|
|
289
|
+
from pathlib import Path
|
|
290
|
+
from llmscribe.core.tree_builder import DEFAULT_IGNORE, generate_tree, load_gitignore
|
|
291
|
+
from llmscribe.core.file_reader import extract_contents
|
|
292
|
+
from llmscribe import __version__
|
|
293
|
+
|
|
294
|
+
project = Path("/path/to/project")
|
|
295
|
+
ignore = [*DEFAULT_IGNORE, *load_gitignore(project)]
|
|
296
|
+
|
|
297
|
+
tree = generate_tree(project, ignore)
|
|
298
|
+
contents = extract_contents(project, ignore)
|
|
299
|
+
|
|
300
|
+
print(tree)
|
|
301
|
+
print(contents)
|
|
302
|
+
print(f"Using LLMScribe {__version__}")
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
### Tree-only Output
|
|
308
|
+
|
|
309
|
+
When tree-only mode is used (`--tree-only` on the CLI/CUI, or the checkbox in the GUI), only the project directory structure is exported — no files are opened or read.
|
|
310
|
+
|
|
311
|
+
```text
|
|
312
|
+
my-project/
|
|
313
|
+
├── src/
|
|
314
|
+
│ ├── main.py
|
|
315
|
+
│ └── utils.py
|
|
316
|
+
├── tests/
|
|
317
|
+
└── README.md
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## Output Format
|
|
323
|
+
|
|
324
|
+
The output is a plain UTF-8 text file with two sections:
|
|
325
|
+
|
|
326
|
+
```
|
|
327
|
+
Selected Files Directory Structure:
|
|
328
|
+
|
|
329
|
+
my-project/
|
|
330
|
+
├── src/
|
|
331
|
+
│ ├── main.py
|
|
332
|
+
│ └── utils.py
|
|
333
|
+
├── tests/
|
|
334
|
+
│ └── test_main.py
|
|
335
|
+
├── pyproject.toml
|
|
336
|
+
└── README.md
|
|
337
|
+
|
|
338
|
+
File Contents:
|
|
339
|
+
|
|
340
|
+
--- src/main.py ---
|
|
341
|
+
<full contents of main.py>
|
|
342
|
+
|
|
343
|
+
--- src/utils.py ---
|
|
344
|
+
<full contents of utils.py>
|
|
345
|
+
|
|
346
|
+
... (and so on for every included file)
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Files are listed in sorted order, and each file's contents are included in full — nothing is cut off or truncated.
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## What Gets Included
|
|
354
|
+
|
|
355
|
+
LLMScribe reads files with the following extensions:
|
|
356
|
+
|
|
357
|
+
| Category | Extensions |
|
|
358
|
+
|---|---|
|
|
359
|
+
| Python | `.py` |
|
|
360
|
+
| JavaScript / TypeScript | `.js` `.ts` `.jsx` `.tsx` |
|
|
361
|
+
| Systems languages | `.c` `.cpp` `.cc` `.cxx` `.h` `.hpp` `.rs` `.go` `.zig` |
|
|
362
|
+
| JVM languages | `.java` `.scala` `.kt` `.clj` `.cljs` |
|
|
363
|
+
| Other languages | `.rb` `.php` `.swift` `.dart` `.lua` `.pl` `.r` `.hs` `.ml` `.fs` `.vb` `.cs` `.ex` `.exs` `.nim` `.cr` `.d` `.elm` `.v` |
|
|
364
|
+
| Web | `.html` `.htm` `.css` `.scss` `.sass` `.less` `.vue` `.svelte` `.pug` `.ejs` `.hbs` `.mustache` `.twig` `.jsp` `.asp` `.aspx` `.erb` `.haml` |
|
|
365
|
+
| Config & manifests | `.json` `.xml` `.yaml` `.yml` `.toml` `.ini` `.cfg` `.conf` `.properties` `.env` `.dotenv` `.lock` `.sum` `.mod` `.gradle` `.pom` `.gitignore` `.gitattributes` `.editorconfig` `.prettierrc` `.eslintrc` `.babelrc` |
|
|
366
|
+
| Shell & scripts | `.sh` `.bash` `.zsh` `.fish` `.ps1` `.bat` `.cmd` `.awk` `.sed` |
|
|
367
|
+
| Documentation | `.md` `.rst` `.adoc` `.tex` `.bib` `.txt` |
|
|
368
|
+
| Data (text-based) | `.csv` `.tsv` `.sql` |
|
|
369
|
+
| Logs | `.log` |
|
|
370
|
+
|
|
371
|
+
Binary formats (`.pdf`, `.docx`, `.epub`, `.db`, `.sqlite`, `.parquet`, images, etc.) are intentionally excluded — they cannot be read as text.
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## What Gets Ignored
|
|
376
|
+
|
|
377
|
+
The following are skipped automatically regardless of the project being scanned:
|
|
378
|
+
|
|
379
|
+
**Directories:**
|
|
380
|
+
|
|
381
|
+
| Category | Names |
|
|
382
|
+
|---|---|
|
|
383
|
+
| Version control | `.git` `.svn` `.hg` |
|
|
384
|
+
| Dependencies | `node_modules` `vendor` `packages` |
|
|
385
|
+
| Python envs | `venv` `__pycache__` `.eggs` `*.egg-info` |
|
|
386
|
+
| Build outputs | `dist` `build` `target` `out` `bin` `obj` |
|
|
387
|
+
| IDEs | `.idea` `.vscode` `.vs` |
|
|
388
|
+
| OS artifacts | `.DS_Store` `Thumbs.db` `desktop.ini` |
|
|
389
|
+
| Logs & temp | `logs` `tmp` `temp` `.tmp` `.cache` |
|
|
390
|
+
| Test coverage | `.coverage` `coverage` `.nyc_output` |
|
|
391
|
+
| Secrets | `.env` `.env.*` `secrets` |
|
|
392
|
+
|
|
393
|
+
**Additionally:** any pattern present in the project's `.gitignore` file is loaded and applied on top of the defaults above.
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
## Core API Reference
|
|
398
|
+
|
|
399
|
+
### `llmscribe.core.writer`
|
|
400
|
+
|
|
401
|
+
#### build_project_summary(project_path, tree_only=False) → str
|
|
402
|
+
|
|
403
|
+
Builds and returns the complete summary string for a project.
|
|
404
|
+
|
|
405
|
+
| Parameter | Type | Description |
|
|
406
|
+
|---|---|---|
|
|
407
|
+
| `project_path` | `Path` | Resolved path to the project root. |
|
|
408
|
+
| `tree_only` | `bool` | Export only the directory tree, skipping file contents. |
|
|
409
|
+
|
|
410
|
+
#### run(project_path, output_file, tree_only=False) → None
|
|
411
|
+
|
|
412
|
+
Generates the summary and writes it to `output_file`. Prints progress and the final line count to stdout. Creates parent directories of `output_file` if they do not exist.
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
### `llmscribe.core.file_reader`
|
|
417
|
+
|
|
418
|
+
#### `extract_contents(root, ignore_patterns) → str`
|
|
419
|
+
|
|
420
|
+
Walks `root` recursively, reads every file whose extension is in `TEXT_FILE_EXTENSIONS` and which does not match `ignore_patterns`, and returns all contents concatenated with `--- relative/path ---` headers. Files are read in full.
|
|
421
|
+
|
|
422
|
+
#### `is_text_file(path) → bool`
|
|
423
|
+
|
|
424
|
+
Returns `True` if `path.suffix.lower()` is in `TEXT_FILE_EXTENSIONS`.
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
### `llmscribe.core.tree_builder`
|
|
429
|
+
|
|
430
|
+
#### `generate_tree(root, ignore_patterns) → str`
|
|
431
|
+
|
|
432
|
+
Returns a multi-line string representing the directory tree rooted at `root`, skipping anything that matches `ignore_patterns`.
|
|
433
|
+
|
|
434
|
+
#### `load_gitignore(root) → list[str]`
|
|
435
|
+
|
|
436
|
+
Parses `root/.gitignore` and returns ordered non-comment, non-empty pattern strings. Common Git-style globs, anchored rules, and negation rules are supported. Returns an empty list if no `.gitignore` exists.
|
|
437
|
+
|
|
438
|
+
#### `should_ignore(path, ignore_patterns) → bool`
|
|
439
|
+
|
|
440
|
+
Returns `True` if `path` matches the supplied ignore rules.
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## License
|
|
445
|
+
|
|
446
|
+
LLMScribe is licensed under the [Apache License 2.0](LICENSE).
|