cli-scry 0.1.1__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.
cli_scry-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alon Douek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,271 @@
1
+ Metadata-Version: 2.4
2
+ Name: cli-scry
3
+ Version: 0.1.1
4
+ Summary: Peer into any Python codebase. Discover structure, extract files, export for LLMs.
5
+ Project-URL: Homepage, https://github.com/amdouek/scry
6
+ Project-URL: Repository, https://github.com/amdouek/scry
7
+ Project-URL: Issues, https://github.com/amdouek/scry/issues
8
+ Author-email: Alon Douek <Alon.Douek@monash.edu>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: cli,code-sharing,codebase,developer-tools,export,llm,project-structure,scry
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Topic :: Utilities
24
+ Requires-Python: >=3.10
25
+ Provides-Extra: legacy
26
+ Requires-Dist: tomli>=2.0; (python_version < '3.11') and extra == 'legacy'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # scry
30
+
31
+ > *Peer into any Python codebase. Discover structure, extract files, export for LLM parsing.*
32
+
33
+ **scry** is a zero-dependency, single-file CLI tool that auto-discovers
34
+ your Python project structure and lets you selectively export files for
35
+ sharing -- in LLM chat sessions, code reviews, documentation, or
36
+ anywhere else you need a clean, readable snapshot of your codebase.
37
+
38
+ ### Via pip
39
+ ```bash
40
+ pip install cli-scry
41
+ ```
42
+
43
+ ### Via pipx
44
+ ```bash
45
+ pipx install cli-scry
46
+ ```
47
+
48
+ ### Direct download
49
+ ```bash
50
+ curl -O https://raw.githubusercontent.com/amdouek/scry/main/scry/cli.py
51
+ python cli.py --help
52
+ ```
53
+
54
+ > Note: The PyPI package is `cli-scry` (the name `scry` was
55
+ > already taken by an unrelated package). The CLI command is simply
56
+ > `scry`.
57
+
58
+ ## Why?
59
+ Modern coding increasingly involves pasting code into LLM
60
+ conversations, sharing project subsets with collaborators, or
61
+ extracting specific modules for targeted code review.
62
+ The typical workflow (manually copying files, remembering paths,
63
+ stitching things together) is tedious and error-prone.
64
+
65
+ `scry` simplifies this! Point to any Python project and it
66
+ will automatically discover packages, modules, config files, and project
67
+ structure. Then export exactly the slice you need, in a format optimised for
68
+ the recipient (be it human or machine).
69
+
70
+ > **Due credit** -- this tool was heavily inspired by the excellent [repomix](https://github.com/yamadashy/repomix) tool. Where `repomix` is a feature-rich,
71
+ > comprehensive solution, `scry` is deliberately minimal: No dependencies,
72
+ > single-file, Python-native and designed for quick, selective
73
+ > exports as well as full-repo dumps.
74
+
75
+ ## Quick Start
76
+ ```bash
77
+ # See what scry discovers in your project
78
+ scry --list-modules
79
+
80
+ # List every file (not just Python)
81
+ scry --list-files
82
+
83
+ # View core files + project overview in terminal
84
+ scry
85
+
86
+ # Export core files + project overview
87
+ scry -o core.txt
88
+
89
+ # Export a specific module
90
+ scry --module models
91
+
92
+ # Export only files you've changed since last commit
93
+ scry --changed
94
+
95
+ # Export everything as LLM-optimised XML
96
+ scry --all --format xml -o codebase.xml
97
+ # or
98
+ scry --all -o codebase.xml # Auto-detects extension
99
+
100
+ # Export specific files
101
+ scry --files src/core.py config/defaults.yaml tests/test_core.py
102
+ ```
103
+
104
+ ## Features
105
+
106
+ ### Auto-Discovery
107
+ `scry` understands Python project conventions out of the box:
108
+
109
+ - Flat layout (`mypackage/` in project root)
110
+ - Src layout (`src/mypackage/`)
111
+ - Subpackages (automatically grouped as modules)
112
+ - Special directories (`tests/`, `scripts/`, `examples/`, etc.)
113
+ - Core project files (`pyproject.toml`, `README.md`, `requirements.txt`, etc.)
114
+
115
+ You don't have to configure anything - just run it for your project!
116
+
117
+ ### Selective Export
118
+ ```bash
119
+ scry --module models # One module
120
+ scry --module models training # Multiple modules
121
+ scry --files src/config.yaml # Specific files
122
+ scry --changed # Git-changed files only
123
+ scry --all # Everything
124
+ ```
125
+
126
+ ### Secret Detection
127
+ Before every export, scry scans for potential secrets (API keys,
128
+ tokens, private keys, database credentials, and other sensitive
129
+ patterns). Warnings are displayed before any output is written.
130
+
131
+ **IMPORTANTLY**, `scry` does NOT automatically prevent secrets
132
+ from appearing in the output. The output warnings require acknowledgement,
133
+ but users MUST take care to ensure that sensitive info is not shared.
134
+
135
+ An example warning:
136
+
137
+ ```
138
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
139
+ POTENTIAL SECRETS DETECTED
140
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
141
+
142
+ config/settings.py:
143
+ Line 42: Generic API Key — Generic API key assignment detected
144
+ Line 67: Database URL — Database connection string with credentials
145
+
146
+ Found 2 potential secret(s) across 1 file(s).
147
+ Review the above before sharing this export.
148
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
149
+ ```
150
+
151
+ Detected patterns include:
152
+ - AWS access keys and secret keys
153
+ - GitHub, GitLab, and Slack tokens
154
+ - Stripe, SendGrid, and Heroku API keys
155
+ - Private key blocks (RSA, EC, DSA, etc.)
156
+ - Database connection strings with embedded credentials
157
+ - Generic `password=`, `secret=`, `api_key=` assignments
158
+ - JWT tokens
159
+ - Sensitive filenames (`.env`, `.pem`, `.key`, `credentials.*`)
160
+
161
+ Use --no-scan to skip if needed (but **use with caution!**).
162
+
163
+ ## Output Formats
164
+ **Text** (default) - Markdown-style with fenced code blocks:
165
+ ```bash
166
+ scry --module models -o export.txt
167
+ ```
168
+
169
+ **XML** - Structured, `CDATA`-wrapped, and optimised for LLM parsing:
170
+ ```bash
171
+ scry --all --format xml -o codebase.xml
172
+ # or
173
+ scry --all -o codebase.xml
174
+ ```
175
+
176
+ The XML format uses `<file path="..." language="..." size="...">`
177
+ elements with CDATA sections, which avoids the nested-backtick
178
+ problems that can occur when LLMs parse markdown.
179
+
180
+ ## Full Project Listing
181
+ Discover every file in your project, not just Python modules:
182
+ ```bash
183
+ # List all files with sizes, grouped by directory
184
+ scry --list-files
185
+
186
+ # Filter to specific extensions
187
+ scry --list-files --ext .yaml .yml .toml .json
188
+ ```
189
+
190
+ The output includes a per-extension summary table, which is
191
+ particularly helpful to spot any parts of your repo that are too chunky!
192
+
193
+ ```
194
+ Extension Count Total Size
195
+ ─────────────── ────── ────────────
196
+ .py 31 42.3 KB
197
+ .yaml 3 2.8 KB
198
+ .toml 1 1.3 KB
199
+ ─────────────── ────── ────────────
200
+ TOTAL 35 46.2 KB
201
+ ```
202
+
203
+ ## Optional Configuration
204
+ `scry` is designed to work without any configuration. However,
205
+ if you want fine-grained control, you can generate a config file:
206
+ ```bash
207
+ scry --init-config
208
+ ```
209
+
210
+ This creates `.scry.toml` in your project root, which is pre-populated
211
+ with your project structure (as discovered by `scry`). You can use this
212
+ to customise core files, ignore patterns, default modules, etc.
213
+
214
+ ```toml
215
+ [scry]
216
+ project_name = "myproject"
217
+ core_files = ["pyproject.toml", "README.md"]
218
+ default_module = "utils"
219
+ tree_depth = 4
220
+
221
+ ignore_dirs = [".git", "__pycache__", "venv", "node_modules"]
222
+ ignore_patterns = ["*.egg-info", "*.pyc"]
223
+ extensions = [".py"]
224
+ ```
225
+
226
+ ## Common workflows
227
+
228
+ ### Starting an LLM chat session
229
+ ```bash
230
+ # Give the LLM your project overview and the module you're working on
231
+ scry --module embeddings -o context.txt
232
+ # Then paste or upload context.txt into your chat
233
+ ```
234
+
235
+ ### Debugging with an LLM
236
+ ```bash
237
+ # Export only what you've changed (minimal, focused context)
238
+ scry --changed
239
+ ```
240
+
241
+ ### Full codebase export for deep refactoring
242
+ ```bash
243
+ # XML format for best LLM parsing
244
+ scry --all --format xml -o codebase.xml
245
+ ```
246
+
247
+ ### Exploring an unfamiliar project
248
+ ```bash
249
+ # What modules exist?
250
+ scry --list-modules
251
+
252
+ # What non-Python files are there?
253
+ scry --list-files --ext .yaml .json .toml .cfg
254
+
255
+ # Export the module you want to understand
256
+ scry --module data_processing
257
+ ```
258
+
259
+ ## How does `scry` work?
260
+ `scry` performs the following steps:
261
+ 1. **Detect project root** and load `.scry.toml` if present;
262
+ 2. **Discover source packages** by checking `src/` layout, then flat layout;
263
+ 3. **Map subpackages to module names** (each subdirectory with .py files becomes a selectable module);
264
+ 4. **Detect core files** (`pyproject.toml`, `README.md`, etc.);
265
+ 5. **Scan for secrets** before any export;
266
+ 6. **Format and output** in the requested format (currently supports txt and xml).
267
+
268
+ ## Requirements
269
+ - Python 3.10+
270
+ - **Zero dependencies** - `scry` is deliberately lightweight; we use only the standard Python library
271
+ - Optional: `tomli` for `.scry.toml` support on Python <3.11
@@ -0,0 +1,243 @@
1
+ # scry
2
+
3
+ > *Peer into any Python codebase. Discover structure, extract files, export for LLM parsing.*
4
+
5
+ **scry** is a zero-dependency, single-file CLI tool that auto-discovers
6
+ your Python project structure and lets you selectively export files for
7
+ sharing -- in LLM chat sessions, code reviews, documentation, or
8
+ anywhere else you need a clean, readable snapshot of your codebase.
9
+
10
+ ### Via pip
11
+ ```bash
12
+ pip install cli-scry
13
+ ```
14
+
15
+ ### Via pipx
16
+ ```bash
17
+ pipx install cli-scry
18
+ ```
19
+
20
+ ### Direct download
21
+ ```bash
22
+ curl -O https://raw.githubusercontent.com/amdouek/scry/main/scry/cli.py
23
+ python cli.py --help
24
+ ```
25
+
26
+ > Note: The PyPI package is `cli-scry` (the name `scry` was
27
+ > already taken by an unrelated package). The CLI command is simply
28
+ > `scry`.
29
+
30
+ ## Why?
31
+ Modern coding increasingly involves pasting code into LLM
32
+ conversations, sharing project subsets with collaborators, or
33
+ extracting specific modules for targeted code review.
34
+ The typical workflow (manually copying files, remembering paths,
35
+ stitching things together) is tedious and error-prone.
36
+
37
+ `scry` simplifies this! Point to any Python project and it
38
+ will automatically discover packages, modules, config files, and project
39
+ structure. Then export exactly the slice you need, in a format optimised for
40
+ the recipient (be it human or machine).
41
+
42
+ > **Due credit** -- this tool was heavily inspired by the excellent [repomix](https://github.com/yamadashy/repomix) tool. Where `repomix` is a feature-rich,
43
+ > comprehensive solution, `scry` is deliberately minimal: No dependencies,
44
+ > single-file, Python-native and designed for quick, selective
45
+ > exports as well as full-repo dumps.
46
+
47
+ ## Quick Start
48
+ ```bash
49
+ # See what scry discovers in your project
50
+ scry --list-modules
51
+
52
+ # List every file (not just Python)
53
+ scry --list-files
54
+
55
+ # View core files + project overview in terminal
56
+ scry
57
+
58
+ # Export core files + project overview
59
+ scry -o core.txt
60
+
61
+ # Export a specific module
62
+ scry --module models
63
+
64
+ # Export only files you've changed since last commit
65
+ scry --changed
66
+
67
+ # Export everything as LLM-optimised XML
68
+ scry --all --format xml -o codebase.xml
69
+ # or
70
+ scry --all -o codebase.xml # Auto-detects extension
71
+
72
+ # Export specific files
73
+ scry --files src/core.py config/defaults.yaml tests/test_core.py
74
+ ```
75
+
76
+ ## Features
77
+
78
+ ### Auto-Discovery
79
+ `scry` understands Python project conventions out of the box:
80
+
81
+ - Flat layout (`mypackage/` in project root)
82
+ - Src layout (`src/mypackage/`)
83
+ - Subpackages (automatically grouped as modules)
84
+ - Special directories (`tests/`, `scripts/`, `examples/`, etc.)
85
+ - Core project files (`pyproject.toml`, `README.md`, `requirements.txt`, etc.)
86
+
87
+ You don't have to configure anything - just run it for your project!
88
+
89
+ ### Selective Export
90
+ ```bash
91
+ scry --module models # One module
92
+ scry --module models training # Multiple modules
93
+ scry --files src/config.yaml # Specific files
94
+ scry --changed # Git-changed files only
95
+ scry --all # Everything
96
+ ```
97
+
98
+ ### Secret Detection
99
+ Before every export, scry scans for potential secrets (API keys,
100
+ tokens, private keys, database credentials, and other sensitive
101
+ patterns). Warnings are displayed before any output is written.
102
+
103
+ **IMPORTANTLY**, `scry` does NOT automatically prevent secrets
104
+ from appearing in the output. The output warnings require acknowledgement,
105
+ but users MUST take care to ensure that sensitive info is not shared.
106
+
107
+ An example warning:
108
+
109
+ ```
110
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
111
+ POTENTIAL SECRETS DETECTED
112
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
113
+
114
+ config/settings.py:
115
+ Line 42: Generic API Key — Generic API key assignment detected
116
+ Line 67: Database URL — Database connection string with credentials
117
+
118
+ Found 2 potential secret(s) across 1 file(s).
119
+ Review the above before sharing this export.
120
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
121
+ ```
122
+
123
+ Detected patterns include:
124
+ - AWS access keys and secret keys
125
+ - GitHub, GitLab, and Slack tokens
126
+ - Stripe, SendGrid, and Heroku API keys
127
+ - Private key blocks (RSA, EC, DSA, etc.)
128
+ - Database connection strings with embedded credentials
129
+ - Generic `password=`, `secret=`, `api_key=` assignments
130
+ - JWT tokens
131
+ - Sensitive filenames (`.env`, `.pem`, `.key`, `credentials.*`)
132
+
133
+ Use --no-scan to skip if needed (but **use with caution!**).
134
+
135
+ ## Output Formats
136
+ **Text** (default) - Markdown-style with fenced code blocks:
137
+ ```bash
138
+ scry --module models -o export.txt
139
+ ```
140
+
141
+ **XML** - Structured, `CDATA`-wrapped, and optimised for LLM parsing:
142
+ ```bash
143
+ scry --all --format xml -o codebase.xml
144
+ # or
145
+ scry --all -o codebase.xml
146
+ ```
147
+
148
+ The XML format uses `<file path="..." language="..." size="...">`
149
+ elements with CDATA sections, which avoids the nested-backtick
150
+ problems that can occur when LLMs parse markdown.
151
+
152
+ ## Full Project Listing
153
+ Discover every file in your project, not just Python modules:
154
+ ```bash
155
+ # List all files with sizes, grouped by directory
156
+ scry --list-files
157
+
158
+ # Filter to specific extensions
159
+ scry --list-files --ext .yaml .yml .toml .json
160
+ ```
161
+
162
+ The output includes a per-extension summary table, which is
163
+ particularly helpful to spot any parts of your repo that are too chunky!
164
+
165
+ ```
166
+ Extension Count Total Size
167
+ ─────────────── ────── ────────────
168
+ .py 31 42.3 KB
169
+ .yaml 3 2.8 KB
170
+ .toml 1 1.3 KB
171
+ ─────────────── ────── ────────────
172
+ TOTAL 35 46.2 KB
173
+ ```
174
+
175
+ ## Optional Configuration
176
+ `scry` is designed to work without any configuration. However,
177
+ if you want fine-grained control, you can generate a config file:
178
+ ```bash
179
+ scry --init-config
180
+ ```
181
+
182
+ This creates `.scry.toml` in your project root, which is pre-populated
183
+ with your project structure (as discovered by `scry`). You can use this
184
+ to customise core files, ignore patterns, default modules, etc.
185
+
186
+ ```toml
187
+ [scry]
188
+ project_name = "myproject"
189
+ core_files = ["pyproject.toml", "README.md"]
190
+ default_module = "utils"
191
+ tree_depth = 4
192
+
193
+ ignore_dirs = [".git", "__pycache__", "venv", "node_modules"]
194
+ ignore_patterns = ["*.egg-info", "*.pyc"]
195
+ extensions = [".py"]
196
+ ```
197
+
198
+ ## Common workflows
199
+
200
+ ### Starting an LLM chat session
201
+ ```bash
202
+ # Give the LLM your project overview and the module you're working on
203
+ scry --module embeddings -o context.txt
204
+ # Then paste or upload context.txt into your chat
205
+ ```
206
+
207
+ ### Debugging with an LLM
208
+ ```bash
209
+ # Export only what you've changed (minimal, focused context)
210
+ scry --changed
211
+ ```
212
+
213
+ ### Full codebase export for deep refactoring
214
+ ```bash
215
+ # XML format for best LLM parsing
216
+ scry --all --format xml -o codebase.xml
217
+ ```
218
+
219
+ ### Exploring an unfamiliar project
220
+ ```bash
221
+ # What modules exist?
222
+ scry --list-modules
223
+
224
+ # What non-Python files are there?
225
+ scry --list-files --ext .yaml .json .toml .cfg
226
+
227
+ # Export the module you want to understand
228
+ scry --module data_processing
229
+ ```
230
+
231
+ ## How does `scry` work?
232
+ `scry` performs the following steps:
233
+ 1. **Detect project root** and load `.scry.toml` if present;
234
+ 2. **Discover source packages** by checking `src/` layout, then flat layout;
235
+ 3. **Map subpackages to module names** (each subdirectory with .py files becomes a selectable module);
236
+ 4. **Detect core files** (`pyproject.toml`, `README.md`, etc.);
237
+ 5. **Scan for secrets** before any export;
238
+ 6. **Format and output** in the requested format (currently supports txt and xml).
239
+
240
+ ## Requirements
241
+ - Python 3.10+
242
+ - **Zero dependencies** - `scry` is deliberately lightweight; we use only the standard Python library
243
+ - Optional: `tomli` for `.scry.toml` support on Python <3.11
@@ -0,0 +1,48 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "cli-scry"
7
+ version = "0.1.1"
8
+ description = "Peer into any Python codebase. Discover structure, extract files, export for LLMs."
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ requires-python = ">=3.10"
12
+ authors = [
13
+ { name = "Alon Douek", email = "Alon.Douek@monash.edu" },
14
+ ]
15
+ keywords = [
16
+ "codebase", "export", "llm", "developer-tools", "cli",
17
+ "project-structure", "code-sharing", "scry",
18
+ ]
19
+ classifiers = [
20
+ "Development Status :: 4 - Beta",
21
+ "Environment :: Console",
22
+ "Intended Audience :: Developers",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Operating System :: OS Independent",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.10",
27
+ "Programming Language :: Python :: 3.11",
28
+ "Programming Language :: Python :: 3.12",
29
+ "Programming Language :: Python :: 3.13",
30
+ "Topic :: Software Development :: Libraries :: Python Modules",
31
+ "Topic :: Utilities",
32
+ ]
33
+
34
+ dependencies = []
35
+
36
+ [project.optional-dependencies]
37
+ legacy = ["tomli>=2.0; python_version < '3.11'"]
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/amdouek/scry"
41
+ Repository = "https://github.com/amdouek/scry"
42
+ Issues = "https://github.com/amdouek/scry/issues"
43
+
44
+ [project.scripts]
45
+ scry = "scry.cli:main"
46
+
47
+ [tool.hatch.build.targets.wheel]
48
+ packages = ["scry"]
@@ -0,0 +1,7 @@
1
+ """scry: Peer into any Python codebase."""
2
+
3
+ __version__ = "0.1.0"
4
+
5
+ from scry.cli import main
6
+
7
+ __all__ = ["main"]