# kopipasta
[![Version](https://img.shields.io/pypi/v/kopipasta.svg)](https://pypi.python.org/pypi/kopipasta)
[![Downloads](http://pepy.tech/badge/kopipasta)](http://pepy.tech/project/kopipasta)
A CLI tool for generating AI-assisted code prompts with project structure and file contents, using an interactive editor-based workflow.
<img src="kopipasta.jpg" alt="kopipasta" width="300">
- An LLM told me that kopi means Coffee in some languages.. and a Diffusion model then made this delicious soup.
## Installation
You can install kopipasta using pipx (or pip):
```bash
pipx install kopipasta
```
## Usage
To use kopipasta, run the following command in your terminal:
```bash
kopipasta [files_or_directories_or_urls]
```
Replace `[files_or_directories_or_urls]` with the paths to the files or directories you want to include in the prompt, as well as any web URLs you want to fetch content from.
Example:
```bash
kopipasta src/ config.json https://example.com/api-docs
```
This will guide you through an interactive process to:
1. Select files and directories to include in the prompt
2. Choose between full content, snippets, or patches for large files
3. Fetch and include content from provided URLs
4. Open an editor for you to input the specific task or code generation instructions
5. Generate a comprehensive prompt that includes project structure, selected file contents, and your task instructions
The generated prompt will be displayed in the console and automatically copied to your clipboard, ready to be used with an AI code generation tool.
## Features
- Generates structured prompts with project overview, file contents, web content, and task instructions
- Interactive file selection process with options for full content, snippets, or specific patches
- Fetches and includes content from web URLs
- Opens your preferred editor (configurable via EDITOR environment variable) for task input
- Detects and securely handles environment variables from a `.env` file
- Ignores files and directories based on common .gitignore patterns
- Allows interactive selection of files to include
- Supports various file types with syntax highlighting in the selection process
- Automatically copies the generated prompt to the clipboard
Raw data
{
"_id": null,
"home_page": "https://github.com/mkorpela/kopipasta",
"name": "kopipasta",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Mikko Korpela",
"author_email": "mikko.korpela@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/6d/b6/c9f36ceb6d176852da8b24f2dc6fc051dfe2d10e10733293b0b72f8f70f5/kopipasta-0.20.0.tar.gz",
"platform": null,
"description": "# kopipasta\n\n[![Version](https://img.shields.io/pypi/v/kopipasta.svg)](https://pypi.python.org/pypi/kopipasta)\n[![Downloads](http://pepy.tech/badge/kopipasta)](http://pepy.tech/project/kopipasta)\n\nA CLI tool for generating AI-assisted code prompts with project structure and file contents, using an interactive editor-based workflow.\n\n<img src=\"kopipasta.jpg\" alt=\"kopipasta\" width=\"300\">\n\n- An LLM told me that kopi means Coffee in some languages.. and a Diffusion model then made this delicious soup.\n\n## Installation\n\nYou can install kopipasta using pipx (or pip):\n\n```bash\npipx install kopipasta\n```\n\n## Usage\n\nTo use kopipasta, run the following command in your terminal:\n\n```bash\nkopipasta [files_or_directories_or_urls]\n```\n\nReplace `[files_or_directories_or_urls]` with the paths to the files or directories you want to include in the prompt, as well as any web URLs you want to fetch content from.\n\nExample:\n```bash\nkopipasta src/ config.json https://example.com/api-docs\n```\n\nThis will guide you through an interactive process to:\n1. Select files and directories to include in the prompt\n2. Choose between full content, snippets, or patches for large files\n3. Fetch and include content from provided URLs\n4. Open an editor for you to input the specific task or code generation instructions\n5. Generate a comprehensive prompt that includes project structure, selected file contents, and your task instructions\n\nThe generated prompt will be displayed in the console and automatically copied to your clipboard, ready to be used with an AI code generation tool.\n\n## Features\n\n- Generates structured prompts with project overview, file contents, web content, and task instructions\n- Interactive file selection process with options for full content, snippets, or specific patches\n- Fetches and includes content from web URLs\n- Opens your preferred editor (configurable via EDITOR environment variable) for task input\n- Detects and securely handles environment variables from a `.env` file\n- Ignores files and directories based on common .gitignore patterns\n- Allows interactive selection of files to include\n- Supports various file types with syntax highlighting in the selection process\n- Automatically copies the generated prompt to the clipboard\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A CLI tool to generate prompts with project structure and file contents",
"version": "0.20.0",
"project_urls": {
"Homepage": "https://github.com/mkorpela/kopipasta"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "89d4d549caf4fbb5d6127925c05a3ca2be7cc360c90f3f3e753a898f766d6024",
"md5": "31553d9764c1bcdcedc0239648817ec8",
"sha256": "ca5635926723f7258ca87cf859212efb2de26d5e3302c913a9a21f1b40c71029"
},
"downloads": -1,
"filename": "kopipasta-0.20.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "31553d9764c1bcdcedc0239648817ec8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 12039,
"upload_time": "2024-10-08T18:43:45",
"upload_time_iso_8601": "2024-10-08T18:43:45.480458Z",
"url": "https://files.pythonhosted.org/packages/89/d4/d549caf4fbb5d6127925c05a3ca2be7cc360c90f3f3e753a898f766d6024/kopipasta-0.20.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6db6c9f36ceb6d176852da8b24f2dc6fc051dfe2d10e10733293b0b72f8f70f5",
"md5": "36705de2c0099a91fb896e0c2aa09be7",
"sha256": "d8b7bb97284c8c11a390f38e6ecda80fad278159b471b09fb8f4d9a87ee77a6e"
},
"downloads": -1,
"filename": "kopipasta-0.20.0.tar.gz",
"has_sig": false,
"md5_digest": "36705de2c0099a91fb896e0c2aa09be7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 13164,
"upload_time": "2024-10-08T18:43:47",
"upload_time_iso_8601": "2024-10-08T18:43:47.546975Z",
"url": "https://files.pythonhosted.org/packages/6d/b6/c9f36ceb6d176852da8b24f2dc6fc051dfe2d10e10733293b0b72f8f70f5/kopipasta-0.20.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-08 18:43:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mkorpela",
"github_project": "kopipasta",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "pyperclip",
"specs": [
[
"==",
"1.9.0"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "Pygments",
"specs": [
[
"==",
"2.18.0"
]
]
}
],
"lcname": "kopipasta"
}