@narduk/cursor-zipit
v1.0.1
Published
Create zip archives and text dumps of project code with smart exclusions for Cursor AI
Downloads
125
Maintainers
Readme
ZipIt
Create zip archives and text dumps of project code with smart exclusions. Perfect for sharing code with AI assistants like ChatGPT or Cursor.
Features
- 🗜️ Zip Creation: Create compressed archives of your project code
- 📄 Text Export: Generate a single text file with directory structure and all code
- 🎯 Smart Exclusions: Automatically excludes
node_modules, build artifacts, and more - 📋 Gitignore Support: Respects
.gitignorepatterns - 🎨 Cursor Integration: Automatically creates
/zipitand/txtitcommands in Cursor
Installation
npm install @narduk/cursor-zipitOr globally:
npm install -g @narduk/cursor-zipitUsage
CLI Commands
Create Zip Archive
npx @narduk/cursor-zipit zipCreates project-code.zip in the current directory.
Create Text File
npx @narduk/cursor-zipit txtCreates project-code.txt in the current directory with directory structure and all code files.
Command Options
Both commands support the following options:
-o, --output <path>: Specify output file path-r, --root <dir>: Specify root directory (default: current directory)-e, --exclude <pattern>: Additional exclusion patterns (can be used multiple times)-i, --include <pattern>: Additional inclusion patterns (can be used multiple times)
Examples
# Create zip with custom output
npx @narduk/cursor-zipit zip -o my-project.zip
# Create text file with custom output
npx @narduk/cursor-zipit txt -o my-project.txt
# Exclude additional patterns
npx @narduk/cursor-zipit zip -e "*.log" -e "*.tmp"
# Include specific files
npx @narduk/cursor-zipit zip -i "*.config.js" -i "*.config.ts"Cursor Integration
When you install zipit, it automatically creates Cursor command files in .cursor/commands/:
/zipit- Creates a zip archive/txtit- Creates a text file
Simply type /zipit or /txtit in Cursor's command palette to use them!
What Gets Excluded
By default, ZipIt excludes:
- Dependencies:
node_modules,venv,.venv - Build Artifacts:
dist,build,.next,.nuxt,out,target - Cache:
__pycache__,.cache,.parcel-cache,.turbo - Environment:
.env,.env.local - IDE:
.idea,.vscode,.cursor - Version Control:
.git - Compiled Files:
*.pyc,*.class,*.o - Logs:
*.log - And more: Plus anything in your
.gitignorefiles
Text File Format
The text file output includes:
- Header: Generation timestamp and root directory
- Directory Tree: Visual tree structure of the project
- File Contents: Each code file with:
- File path
- Language/type
- File size
- Line count
- Full file contents
- Summary: Total files and size statistics
Example:
PROJECT CODE EXPORT
================================================================================
Generated: 2024-01-15T10:30:00.000Z
Root Directory: /path/to/project
================================================================================
DIRECTORY STRUCTURE
================================================================================
├── src
│ ├── index.ts
│ └── utils.ts
└── package.json
================================================================================
================================================================================
FILE 1 of 3
================================================================================
Path: src/index.ts
Language: TypeScript
Size: 1.2 KB (1234 bytes)
Lines: 45
================================================================================
[file contents here...]API Usage
You can also use ZipIt programmatically:
import { createZip, createTxt } from '@narduk/cursor-zipit';
// Create zip
await createZip({
outputPath: './output.zip',
rootDir: './src',
customExcludes: ['*.test.ts'],
customIncludes: ['*.config.*'],
});
// Create text file
await createTxt({
outputPath: './output.txt',
rootDir: './src',
customExcludes: ['*.test.ts'],
});Development
# Install dependencies
npm install
# Build
npm run build
# Test
npm testLicense
MIT
Contributing
Contributions welcome! Please feel free to submit a Pull Request.
