
Research
Security News
Malicious npm Packages Use Telegram to Exfiltrate BullX Credentials
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
A utility that scans any codebase and generates prompts directly to your clipboard, ready to be pasted into your preferred AI assistant.
Effortlessly transform your codebase into AI-ready prompts and insights.
Code2Clipboard is a developer utility that scans your codebase, tokenizes content, and generates LLM-ready prompts directly to your clipboard. With features like directory tree visualization, token count preview, and whole project prompt generation, itβs designed to save time and supercharge your workflow.
It will will to add to your prompt a full context of your project, so that your prefered AI Assistant can produce the best possible answer.
pip install code2clipboard
Clone the repository and install locally:
git clone https://github.com/domguia/code2clipboard.git
cd code2clipboard
pip install .
Or install directly from GitHub:
pip install git+https://github.com/domguia/code2clipboard.git
After installation, the code2clipboard
CLI is ready to use. By default, it merges files and displays a directory tree:
code2clipboard
--tree
: Display the directory tree with token counts and file sizes (no merge).--tokens
: Only display the total token count (no tree or merge).--include
: Include specific file patterns (e.g., *.py
, *.md
).--exclude
: Exclude specific file patterns (e.g., *.log
, node_modules/
).--add-hidden
: Include hidden files and directories.--max-file-size
: Set a maximum file size (default: 20KB).Generate a directory tree:
code2clipboard --tree
Analyze tokens in Python files only:
code2clipboard --tokens --include '*.py'
Merge files into a clipboard-ready prompt:
code2clipboard --include '*.py' '*.md'
Include hidden files and exclude logs:
code2clipboard --add-hidden --exclude '*.log'
code2clipboard
Output:
project/ - 32kb ~6.2k tokens
βββ main.py - 12kb ~3k tokens
βββ utils.py - 8kb ~2k tokens
βββ README.md - 2kb ~512 tokens
(Tree copied to clipboard.)
(All file contents merged and copied to clipboard.)
code2clipboard --tree
Output:
project/ - 32kb ~6.2k tokens
βββ main.py - 12kb ~3k tokens
βββ utils.py - 8kb ~2k tokens
(Tree copied to clipboard.)
code2clipboard --tokens
Output:
Estimated total tokens: 6.2k
We welcome contributions from the community! Hereβs how you can get started:
git checkout -b feature-name
.git commit -m "Add some feature"
.git push origin feature-name
.This project is licensed under the MIT License.
Found an issue or have a feature request? Open an issue on GitHub Issues. Weβd love to hear your feedback!
Happy coding! π
Let me know if you need help with any specific section!
FAQs
A utility that scans any codebase and generates prompts directly to your clipboard, ready to be pasted into your preferred AI assistant.
We found that code2clipboard demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.
Security News
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.