Convert folder contents to text and copy to clipboard for LLMs
A fast CLI tool that converts any folder's contents into a single text format, perfect for sharing codebases with AI assistants like Claude, ChatGPT, or other LLMs.
- 📁 Recursive scanning - Processes entire folder structures
- 🎯 Interactive mode - Select specific files, exclude directories and extensions
- 📋 Auto clipboard - Automatically copies output to clipboard
- 🚫 Smart filtering - Respects .gitignore and ignores common directories
- 📝 Binary detection - Handles text files, marks binary files
- ⚡ Token efficient - Compact headers to minimize token usage
- 🎨 Modern UI - Clean interface with clack prompts
npm install -g txtliConvert current directory (non-interactive):
txtliConvert specific folder:
txtli /path/to/folderUse -i flag for full control:
txtli -iInteractive mode lets you:
- Exclude specific directories
- Filter by file extensions
- Select/deselect individual files
- All files selected by default
# Convert current directory
txtli
# Convert specific project
txtli ~/projects/my-app
# Interactive mode with file selection
txtli ~/projects/my-app -i
# Convert and share with LLM
txtli . -i
# Output is automatically in your clipboard!Automatically ignored directories:
node_modules.gitdist,build.nextcoverage.cache.vscode,.idea
Plus:
- All patterns in your
.gitignorefile - Hidden files (starting with
.) - Binary files (images, videos, archives, etc.)
Files are formatted with compact headers to minimize tokens:
--- src/index.ts ---
[file content here]
--- src/utils/helper.ts ---
[file content here]
-i, --interactive- Interactive mode for file selection-v, --version- Output version number-h, --help- Display help
# Clone the repo
git clone https://github.com/ahmadawais/txtli.git
cd txtli
# Install dependencies
pnpm install
# Build
pnpm build
# Link locally
npm link
# Test
txtli -i- TypeScript
- Commander.js for CLI
- Clack for interactive prompts
- Clipboardy for clipboard operations
- tsup for building
When working with AI assistants, you often need to share your codebase context. txtli makes this instant:
- Run
txtli -iin your project - Select what to include
- Paste into your AI chat
- Get contextual help!
Perfect for:
- Getting code reviews from AI
- Debugging with AI assistance
- Explaining codebases to AI
- Quick project analysis
MIT © Ahmad Awais
Ahmad Awais (@MrAhmadAwais)
txtli - Text for LLMs, Instantly