kopipasta 0.38.0__py3-none-any.whl

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.

Potentially problematic release.


This version of kopipasta might be problematic. Click here for more details.

@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Mikko Korpela
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,111 @@
1
+ Metadata-Version: 2.1
2
+ Name: kopipasta
3
+ Version: 0.38.0
4
+ Summary: A CLI tool to generate prompts with project structure and file contents
5
+ Home-page: https://github.com/mkorpela/kopipasta
6
+ Author: Mikko Korpela
7
+ Author-email: mikko.korpela@gmail.com
8
+ License: MIT
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: >=3.8
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: pyperclip==1.9.0
23
+ Requires-Dist: requests==2.32.3
24
+ Requires-Dist: Pygments==2.18.0
25
+ Requires-Dist: rich==13.8.1
26
+ Requires-Dist: click==8.2.1
27
+
28
+ # kopipasta
29
+
30
+ [![Version](https://img.shields.io/pypi/v/kopipasta.svg)](https://pypi.python.org/pypi/kopipasta)
31
+ [![Downloads](http://pepy.tech/badge/kopipasta)](http://pepy.tech/project/kopipasta)
32
+
33
+ A CLI tool for taking **full, transparent control** of your LLM context. No black boxes.
34
+
35
+ <img src="kopipasta.jpg" alt="kopipasta" width="300">
36
+
37
+ - An LLM told me that "kopi" means Coffee in some languages... and a Diffusion model then made this delicious soup.
38
+
39
+ ## The Philosophy: You Control the Context
40
+
41
+ Many AI coding assistants use Retrieval-Augmented Generation (RAG) to automatically find what *they think* is relevant context. This is a black box. When the LLM gives a bad answer, you can't debug it because you don't know what context it was actually given.
42
+
43
+ **`kopipasta` is the opposite.** I built it for myself on the principle of **explicit context control**. You are in the driver's seat. You decide *exactly* what files, functions, and snippets go into the prompt. This transparency is the key to getting reliable, debuggable results from an LLM.
44
+
45
+ It's a "smart copy" command for your project, not a magic wand.
46
+
47
+ ## How It Works
48
+
49
+ The workflow is dead simple:
50
+
51
+ 1. **Gather:** Run `kopipasta` and point it at the files, directories, and URLs that matter for your task.
52
+ 2. **Select:** The tool interactively helps you choose what to include. For large files, you can send just a snippet or even hand-pick individual functions.
53
+ 3. **Define:** Your default editor (`$EDITOR`) opens for you to write your instructions to the LLM.
54
+ 4. **Paste:** The final, comprehensive prompt is now on your clipboard, ready to be pasted into ChatGPT, Gemini, Claude, or your LLM of choice.
55
+
56
+ ## Installation
57
+
58
+ ```bash
59
+ # Using pipx (recommended for CLI tools)
60
+ pipx install kopipasta
61
+
62
+ # Or using standard pip
63
+ pip install kopipasta
64
+ ```
65
+
66
+ ## Usage
67
+
68
+ ```bash
69
+ kopipasta [options] [files_or_directories_or_urls...]
70
+ ```
71
+
72
+ **Arguments:**
73
+
74
+ * `[files_or_directories_or_urls...]`: One or more paths to files, directories, or web URLs to use as the starting point for your context.
75
+
76
+ **Options:**
77
+
78
+ * `-t TASK`, `--task TASK`: Provide the task description directly on the command line, skipping the editor.
79
+
80
+ ## Key Features
81
+
82
+ * **Total Context Control:** Interactively select files, directories, snippets, or even individual functions. You see everything that goes into the prompt.
83
+ * **Transparent & Explicit:** No hidden RAG. You know exactly what's in the prompt because you built it. This makes debugging LLM failures possible.
84
+ * **Web-Aware:** Pulls in content directly from URLs—perfect for API documentation.
85
+ * **Safety First:**
86
+ * Automatically respects your `.gitignore` rules.
87
+ * Detects if you're about to include secrets from a `.env` file and asks what to do.
88
+ * **Context-Aware:** Keeps a running total of the prompt size (in characters and estimated tokens) so you don't overload the LLM's context window.
89
+ * **Developer-Friendly:**
90
+ * Uses your familiar `$EDITOR` for writing task descriptions.
91
+ * Copies the final prompt directly to your clipboard.
92
+ * Provides syntax highlighting during chunk selection.
93
+
94
+ ## A Real-World Example
95
+
96
+ I had a bug where my `setup.py` didn't include all the dependencies from `requirements.txt`.
97
+
98
+ 1. I ran `kopipasta -t "Update setup.py to read dependencies dynamically from requirements.txt" setup.py requirements.txt`.
99
+ 2. The tool confirmed the inclusion of both files and copied the complete prompt to my clipboard.
100
+ 3. I pasted the prompt into my LLM chat window.
101
+ 4. I copied the LLM's suggested code back into my local `setup.py`.
102
+ 5. I tested the changes and committed.
103
+
104
+ No manual file reading, no clumsy copy-pasting, just a clean, context-rich prompt that I had full control over.
105
+
106
+ ## Configuration
107
+
108
+ Set your preferred command-line editor via the `EDITOR` environment variable.
109
+ ```bash
110
+ export EDITOR=nvim # or vim, nano, code --wait, etc.
111
+ ```
@@ -0,0 +1,13 @@
1
+ kopipasta/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ kopipasta/cache.py,sha256=wncA_wfkP8zJk3L4nm753GQ0t_Sr9-tuUWHyk3rVytg,1458
3
+ kopipasta/file.py,sha256=L9UX9DXFolqrEbRe6zM9cbYR-35XQFySDK5fa4YBb-M,7910
4
+ kopipasta/import_parser.py,sha256=5bOZLY90cYhp5uKtIFv4Q31g_ighk8ShYE-EE44stoE,13643
5
+ kopipasta/main.py,sha256=_c9Wid8X7qNZjMPfZrOnWmPk_3UEZXP74RycIzxlqfA,54720
6
+ kopipasta/prompt.py,sha256=XktjLJINUTjpP_PWLH2HQfbjncb1x_wvOUd0_RyIMcU,6983
7
+ kopipasta/tree_selector.py,sha256=15vPyiT102i0uys76N8gI4_OE3jwBdmPPUmqft5bXQY,31277
8
+ kopipasta-0.38.0.dist-info/LICENSE,sha256=xw4C9TAU7LFu4r_MwSbky90uzkzNtRwAo3c51IWR8lk,1091
9
+ kopipasta-0.38.0.dist-info/METADATA,sha256=w502QARnG0sqPck9JTpPUPu1SKKZs3XjFnCE6tUp5nc,4894
10
+ kopipasta-0.38.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
11
+ kopipasta-0.38.0.dist-info/entry_points.txt,sha256=but54qDNz1-F8fVvGstq_QID5tHjczP7bO7rWLFkc6Y,50
12
+ kopipasta-0.38.0.dist-info/top_level.txt,sha256=iXohixMuCdw8UjGDUp0ouICLYBDrx207sgZIJ9lxn0o,10
13
+ kopipasta-0.38.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.1.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ kopipasta = kopipasta.main:main
@@ -0,0 +1 @@
1
+ kopipasta