codetoprompt 0.2.3__tar.gz → 0.2.4__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.
- {codetoprompt-0.2.3/codetoprompt.egg-info → codetoprompt-0.2.4}/PKG-INFO +1 -1
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/codetoprompt/utils.py +13 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/codetoprompt/version.py +1 -1
- {codetoprompt-0.2.3 → codetoprompt-0.2.4/codetoprompt.egg-info}/PKG-INFO +1 -1
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/pyproject.toml +1 -1
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/LICENSE +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/MANIFEST.in +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/README.md +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/codetoprompt/__init__.py +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/codetoprompt/cli.py +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/codetoprompt/core.py +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/codetoprompt.egg-info/SOURCES.txt +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/codetoprompt.egg-info/dependency_links.txt +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/codetoprompt.egg-info/entry_points.txt +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/codetoprompt.egg-info/requires.txt +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/codetoprompt.egg-info/top_level.txt +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/setup.cfg +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/tests/test_cli.py +0 -0
- {codetoprompt-0.2.3 → codetoprompt-0.2.4}/tests/test_core.py +0 -0
|
@@ -113,6 +113,7 @@ def process_files(
|
|
|
113
113
|
respect_gitignore: bool = True,
|
|
114
114
|
output_file: Optional[str] = None,
|
|
115
115
|
count_tokens: bool = False,
|
|
116
|
+
copy_to_clipboard: bool = True,
|
|
116
117
|
) -> None:
|
|
117
118
|
"""Process all files in a directory and generate a prompt.
|
|
118
119
|
|
|
@@ -122,6 +123,7 @@ def process_files(
|
|
|
122
123
|
respect_gitignore: Whether to respect .gitignore rules
|
|
123
124
|
output_file: Optional output file path
|
|
124
125
|
count_tokens: Whether to count tokens in the output
|
|
126
|
+
copy_to_clipboard: Whether to copy the prompt to clipboard
|
|
125
127
|
"""
|
|
126
128
|
# Get git info if needed
|
|
127
129
|
git_info = get_git_info(directory) if respect_gitignore else None
|
|
@@ -145,8 +147,19 @@ def process_files(
|
|
|
145
147
|
token_count = len(prompt.split())
|
|
146
148
|
print(f"\nToken count: {token_count}")
|
|
147
149
|
|
|
150
|
+
# Copy to clipboard if requested
|
|
151
|
+
if copy_to_clipboard:
|
|
152
|
+
try:
|
|
153
|
+
import pyperclip
|
|
154
|
+
pyperclip.copy(prompt)
|
|
155
|
+
print("\n✓ Prompt copied to clipboard")
|
|
156
|
+
except Exception as e:
|
|
157
|
+
print(f"\nWarning: Could not copy to clipboard: {e}")
|
|
158
|
+
|
|
148
159
|
# Save to file or print to stdout
|
|
149
160
|
if output_file:
|
|
150
161
|
with open(output_file, "w", encoding="utf-8") as f:
|
|
151
162
|
f.write(prompt)
|
|
152
163
|
print(f"\nPrompt saved to: {output_file}")
|
|
164
|
+
else:
|
|
165
|
+
print(prompt)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|