neozip-cli 0.70.0-alpha

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/DOCUMENTATION.md +194 -0
  3. package/LICENSE +22 -0
  4. package/README.md +504 -0
  5. package/WHY_NEOZIP.md +212 -0
  6. package/bin/neolist +16 -0
  7. package/bin/neounzip +16 -0
  8. package/bin/neozip +15 -0
  9. package/dist/neozipkit-bundles/blockchain.js +13091 -0
  10. package/dist/neozipkit-bundles/browser.js +5733 -0
  11. package/dist/neozipkit-bundles/core.js +3766 -0
  12. package/dist/neozipkit-bundles/server.js +14996 -0
  13. package/dist/neozipkit-wrappers/blockchain/core/contracts.js +16 -0
  14. package/dist/neozipkit-wrappers/blockchain/index.js +2 -0
  15. package/dist/neozipkit-wrappers/core/ZipDecompress.js +2 -0
  16. package/dist/neozipkit-wrappers/core/components/HashCalculator.js +2 -0
  17. package/dist/neozipkit-wrappers/core/components/Logger.js +2 -0
  18. package/dist/neozipkit-wrappers/core/constants/Errors.js +2 -0
  19. package/dist/neozipkit-wrappers/core/constants/Headers.js +2 -0
  20. package/dist/neozipkit-wrappers/core/encryption/ZipCrypto.js +7 -0
  21. package/dist/neozipkit-wrappers/core/index.js +3 -0
  22. package/dist/neozipkit-wrappers/index.js +13 -0
  23. package/dist/neozipkit-wrappers/server/index.js +2 -0
  24. package/dist/src/config/ConfigSetup.js +455 -0
  25. package/dist/src/config/ConfigStore.js +373 -0
  26. package/dist/src/config/ConfigWizard.js +453 -0
  27. package/dist/src/config/WalletConfig.js +372 -0
  28. package/dist/src/exit-codes.js +210 -0
  29. package/dist/src/index.js +141 -0
  30. package/dist/src/neolist.js +1194 -0
  31. package/dist/src/neounzip.js +2177 -0
  32. package/dist/src/neozip/CommentManager.js +240 -0
  33. package/dist/src/neozip/blockchain.js +383 -0
  34. package/dist/src/neozip/createZip.js +2273 -0
  35. package/dist/src/neozip/file-operations.js +920 -0
  36. package/dist/src/neozip/types.js +6 -0
  37. package/dist/src/neozip/user-interaction.js +256 -0
  38. package/dist/src/neozip/utils.js +96 -0
  39. package/dist/src/neozip.js +785 -0
  40. package/dist/src/server/CommentManager.js +240 -0
  41. package/dist/src/version.js +59 -0
  42. package/env.example +101 -0
  43. package/package.json +175 -0
package/README.md ADDED
@@ -0,0 +1,504 @@
1
+ # NeoZip CLI
2
+
3
+ > Full-featured command-line ZIP application with blockchain integration and advanced compression
4
+
5
+ [![npm version](https://img.shields.io/npm/v/neozip-cli?label=alpha&color=orange)](https://www.npmjs.com/package/neozip-cli)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen)](https://nodejs.org/)
8
+
9
+ ## ⚠️ Alpha Release Notice
10
+
11
+ **This is an alpha release (v0.70.0-alpha).** This software is in early development and may contain bugs, incomplete features, or breaking changes. Use at your own risk.
12
+
13
+ - **API Stability**: Command-line interface may change in future releases
14
+ - **Testing**: Please test thoroughly and report any issues
15
+ - **Feedback**: We welcome feedback and bug reports via [GitHub Issues](https://github.com/NeoWareInc/neozip-support/issues) or email [support@neozip.io](mailto:support@neozip.io)
16
+
17
+ ## Overview
18
+
19
+ NeoZip CLI is a modern, full-featured ZIP utility that provides:
20
+
21
+ - **Standard ZIP Compatibility**: ~99% compatible with InfoZip utilities
22
+ - **Blockchain Integration**: Tokenize archives and verify integrity on-chain
23
+ - **Advanced Compression**: Zstd, Deflate, and Store compression methods
24
+ - **Encryption Support**: PKZIP encryption
25
+ - **Cross-Platform**: Works on macOS, Linux, and Windows
26
+
27
+ ## Features
28
+
29
+ ### Core Functionality
30
+ - ✅ Create, extract, and list ZIP archives
31
+ - ✅ Standard ZIP format compatibility
32
+ - ✅ ZIP64 support for large files (>4GB)
33
+ - ✅ Archive comments and file comments
34
+ - ✅ Recursive directory processing
35
+ - ✅ Pattern-based file inclusion/exclusion
36
+ - ✅ Stdin filename input
37
+
38
+ ### Compression
39
+ - **Zstd**: Modern, fast compression (default)
40
+ - **Deflate**: Standard ZIP compression (maximum compatibility)
41
+ - **Store**: No compression (fastest, for already-compressed files)
42
+ - Compression levels: 0-9 (0=store, 9=best compression)
43
+
44
+ ### Encryption
45
+ - **PKZIP**: Legacy encryption (maximum compatibility)
46
+ - Password-protected archives
47
+ - InfoZip-compatible encrypted archives
48
+
49
+ ### Blockchain Features
50
+ - **Tokenization**: Create on-chain tokens for archives
51
+ - **OpenTimestamp**: Bitcoin blockchain timestamping
52
+ - **Integrity Verification**: Verify archive integrity on-chain
53
+ - **Network Support**: Base Sepolia, Base Mainnet, Arbitrum, and more
54
+
55
+ ### Advanced Features
56
+ - Symbolic link handling
57
+ - Hard link detection and deduplication
58
+ - File permission preservation
59
+ - Progress reporting
60
+ - Archive integrity testing
61
+ - Update and freshen modes
62
+ - Move files into archive
63
+ - Delete files from archive
64
+
65
+ ## Installation
66
+
67
+ ### Prerequisites
68
+
69
+ - Node.js 16.0.0 or higher
70
+ - npm or yarn package manager
71
+
72
+ ### Install from npm (Alpha Release)
73
+
74
+ ```bash
75
+ npm install -g neozip-cli@alpha
76
+ ```
77
+
78
+ After installation, the following commands will be available:
79
+ - `neozip` - Create and manage ZIP archives
80
+ - `neounzip` - Extract files from ZIP archives
81
+ - `neolist` - List contents of ZIP archives
82
+
83
+ ### Verify Installation
84
+
85
+ ```bash
86
+ neozip --version
87
+ neounzip --version
88
+ neolist --version
89
+ ```
90
+
91
+ ## Quick Start
92
+
93
+ ### Basic Usage
94
+
95
+ ```bash
96
+ # Create a ZIP archive
97
+ neozip archive.nzip file1.txt file2.txt folder/
98
+
99
+ # Create archive with recursive directory inclusion
100
+ neozip -r archive.nzip ./project/
101
+
102
+ # Create tokenized archive (blockchain integration)
103
+ neozip -b tokenized.nzip file1.txt file2.txt
104
+
105
+ # Extract files from archive
106
+ neounzip archive.nzip extracted/
107
+
108
+ # Extract and verify tokenized archive
109
+ neounzip -t tokenized.nzip
110
+
111
+ # Test the archive file
112
+ neounzip -t archive.nzip
113
+
114
+ # List archive contents
115
+ neolist archive.nzip
116
+
117
+ # List with detailed information
118
+ neolist -v archive.nzip
119
+ ```
120
+
121
+ ### Compression Examples
122
+
123
+ ```bash
124
+ # Compress with default settings (Zstd)
125
+ neozip output.nzip ./src/
126
+
127
+ # Compress with maximum compression
128
+ neozip -9 output.nzip ./src/
129
+
130
+ # Compress with deflate (maximum compatibility)
131
+ neozip --compression deflate output.nzip ./src/
132
+
133
+ # Store files without compression (fastest)
134
+ neozip -0 output.nzip ./src/
135
+ ```
136
+
137
+ ### Encryption Examples
138
+
139
+ ```bash
140
+ # Create encrypted archive (will prompt for password)
141
+ neozip -e secure.nzip file.txt
142
+
143
+ # Create encrypted archive with password
144
+ neozip -e -P "mypassword" secure.nzip file.txt
145
+
146
+ # Extract encrypted archive
147
+ neounzip -P "mypassword" secure.nzip extracted/
148
+ ```
149
+
150
+ ### Blockchain Examples
151
+
152
+ ```bash
153
+ # Tokenize archive on Base Sepolia (default)
154
+ neozip -b tokenized.nzip file.txt
155
+
156
+ # Tokenize with OpenTimestamp proof
157
+ neozip -ots timestamped.nzip file.txt
158
+
159
+ # Extract and verify blockchain integrity
160
+ neounzip tokenized.nzip extracted/
161
+ ```
162
+
163
+ ## Commands
164
+
165
+ ### `neozip` - Create and Manage Archives
166
+
167
+ Create, update, and manage ZIP archives.
168
+
169
+ **Basic Syntax:**
170
+ ```bash
171
+ neozip [options] <archive> [files...]
172
+ ```
173
+
174
+ **Common Options:**
175
+ - `-r, --recurse` - Include subdirectories recursively
176
+ - `-0` to `-9` - Compression level (0=store, 9=best)
177
+ - `-x, --exclude <pattern>` - Exclude files matching pattern
178
+ - `-i, --include <pattern>` - Include only matching files
179
+ - `-e, --encrypt` - Encrypt files (will prompt for password)
180
+ - `-P, --password <pwd>` - Encrypt with password
181
+ - `-b, --blockchain` - Enable blockchain tokenization
182
+ - `-ots, --opentimestamp` - Enable OpenTimestamp proof
183
+ - `-T, --test-integrity` - Test archive after creation
184
+ - `-v, --verbose` - Enable verbose output
185
+ - `-q, --quiet` - Suppress output
186
+
187
+ **Configuration Commands:**
188
+ ```bash
189
+ neozip init # Interactive wallet setup wizard
190
+ neozip config # Show current configuration
191
+ ```
192
+
193
+ **Examples:**
194
+ ```bash
195
+ # Compress directory recursively
196
+ neozip -r archive.nzip ./project/
197
+
198
+ # Compress with exclusions
199
+ neozip -x "*.log" -x "*.tmp" archive.nzip ./src/
200
+
201
+ # Compress from stdin
202
+ find . -name "*.txt" | neozip -@ archive.nzip
203
+
204
+ # Update existing archive
205
+ neozip -u archive.nzip ./src/
206
+
207
+ # Move files into archive
208
+ neozip -m archive.nzip ./temp/
209
+ ```
210
+
211
+ ### `neounzip` - Extract Archives
212
+
213
+ Extract files from ZIP archives.
214
+
215
+ **Basic Syntax:**
216
+ ```bash
217
+ neounzip [options] <archive> [output]
218
+ ```
219
+
220
+ **Common Options:**
221
+ - `-d, --exdir <dir>` - Extract to specific directory
222
+ - `-o, --overwrite` - Overwrite files without prompting
223
+ - `-t, --test` - Test archive integrity
224
+ - `-l, --list` - List contents without extracting
225
+ - `-P, --password <pwd>` - Password for encrypted archives
226
+ - `-x, --exclude <pattern>` - Exclude files from extraction
227
+ - `-i, --include <pattern>` - Include only matching files
228
+ - `-j, --junk-paths` - Extract files without directory structure
229
+ - `-v, --verbose` - Enable verbose output
230
+ - `-q, --quiet` - Suppress output
231
+
232
+ **Examples:**
233
+ ```bash
234
+ # Extract to current directory
235
+ neounzip archive.nzip
236
+
237
+ # Extract to specific directory
238
+ neounzip archive.nzip ./extracted/
239
+
240
+ # Test archive integrity
241
+ neounzip -t archive.nzip
242
+
243
+ # Extract with exclusions
244
+ neounzip -x "*.log" archive.nzip extracted/
245
+
246
+ # Extract encrypted archive
247
+ neounzip --password "mypassword" secure.nzip extracted/
248
+ ```
249
+
250
+ ### `neolist` - List Archive Contents
251
+
252
+ List and inspect ZIP archive contents.
253
+
254
+ **Basic Syntax:**
255
+ ```bash
256
+ neolist [options] <archive>
257
+ ```
258
+
259
+ **Common Options:**
260
+ - `-v, --verbose` - Detailed listing
261
+ - `-s, --short` - Short format
262
+ - `-j, --json` - Output as JSON
263
+ - `-u, --unix` - Unix-style listing
264
+ - `-b, --basic` - Basic listing
265
+ - `-1` - Filenames only
266
+ - `-2` - Filenames with header/totals
267
+
268
+ **Examples:**
269
+ ```bash
270
+ # Basic listing
271
+ neolist archive.nzip
272
+
273
+ # Verbose listing
274
+ neolist -v archive.nzip
275
+
276
+ # JSON output
277
+ neolist -j archive.nzip
278
+
279
+ # Filenames only
280
+ neolist -1 archive.nzip
281
+ ```
282
+
283
+ ## Configuration
284
+
285
+ ### Wallet Setup (for Blockchain Features)
286
+
287
+ To use blockchain features, you need to configure a wallet:
288
+
289
+ ```bash
290
+ # Interactive setup wizard
291
+ neozip init
292
+ ```
293
+
294
+ This will guide you through:
295
+ 1. Creating or importing a wallet
296
+ 2. Selecting a blockchain network
297
+ 3. Saving configuration to `~/.neozip/wallet.json`
298
+
299
+ ### Environment Variables
300
+
301
+ You can also configure via environment variables:
302
+
303
+ ```bash
304
+ export NEOZIP_WALLET_PASSKEY="your-wallet-key"
305
+ export NEOZIP_NETWORK="base-sepolia" # or base-mainnet, arbitrum-sepolia, etc.
306
+ ```
307
+
308
+ ### Configuration File
309
+
310
+ Configuration is stored in `~/.neozip/wallet.json`:
311
+
312
+ ```json
313
+ {
314
+ "walletKey": "0x...",
315
+ "network": "base-sepolia",
316
+ "rpcUrl": "https://..."
317
+ }
318
+ ```
319
+
320
+ ## Advanced Examples
321
+
322
+ ### Common Workflows
323
+
324
+ ```bash
325
+ # Create archive
326
+ neozip project.nzip src/ docs/ README.md
327
+
328
+ # List contents
329
+ neolist project.nzip
330
+
331
+ # Extract files
332
+ neounzip project.nzip extracted/
333
+
334
+ # Test integrity
335
+ neounzip -t project.nzip
336
+ ```
337
+
338
+ ### Compression Options
339
+
340
+ ```bash
341
+ # Maximum compression
342
+ neozip -9 archive.nzip large-folder/
343
+
344
+ # Fast compression
345
+ neozip -1 archive.nzip large-folder/
346
+
347
+ # Store only (no compression)
348
+ neozip -0 archive.nzip already-compressed-files/
349
+ ```
350
+
351
+ ### File Selection
352
+
353
+ ```bash
354
+ # Include only JavaScript files
355
+ neozip -i "*.js" code.nzip ./src/
356
+
357
+ # Exclude log files
358
+ neozip -x "*.log" -x "*.tmp" clean.nzip ./project/
359
+
360
+ # Recursive with exclusions
361
+ neozip -r -x "node_modules" -x "*.log" project.nzip ./
362
+ ```
363
+
364
+ ### Encryption
365
+
366
+ ```bash
367
+ # Create encrypted archive
368
+ neozip -e -P "secure-password" secret.nzip sensitive-files/
369
+
370
+ # Extract encrypted archive
371
+ neounzip -P "secure-password" secret.nzip decrypted/
372
+ ```
373
+
374
+ ### Blockchain Features
375
+
376
+ ```bash
377
+ # Tokenize archive
378
+ neozip -b tokenized.nzip important-file.txt
379
+
380
+ # Tokenize with OpenTimestamp
381
+ neozip -ots timestamped.nzip document.pdf
382
+
383
+ # Extract and verify
384
+ neounzip tokenized.nzip verified/
385
+ ```
386
+
387
+ ### Advanced Operations
388
+
389
+ ```bash
390
+ # Update existing archive
391
+ neozip -u archive.nzip ./updated-files/
392
+
393
+ # Move files into archive
394
+ neozip -m archive.nzip ./temp-files/
395
+
396
+ # Delete files from archive
397
+ neozip -d archive.nzip old-file.txt
398
+
399
+ # Preserve file permissions
400
+ neozip -X archive.nzip ./files/
401
+
402
+ # Handle symbolic links
403
+ neozip -y archive.nzip ./symlinks/
404
+ ```
405
+
406
+ ## Requirements
407
+
408
+ - **Node.js**: 16.0.0 or higher
409
+ - **Platform**: macOS, Linux, or Windows
410
+ - **Disk Space**: ~1MB for installation, additional space for archives
411
+
412
+ ## Documentation
413
+
414
+ The following documentation is included with this package:
415
+
416
+ - **[README.md](README.md)** - This file, containing installation, usage, and examples
417
+ - **[WHY_NEOZIP.md](WHY_NEOZIP.md)** - Introduction to NeoZip and its blockchain integration
418
+ - **[CHANGELOG.md](CHANGELOG.md)** - Version history and release notes
419
+ - **[DOCUMENTATION.md](DOCUMENTATION.md)** - Complete documentation index and reference
420
+
421
+ ## Troubleshooting
422
+
423
+ ### Installation Issues
424
+
425
+ **Command not found after installation:**
426
+ ```bash
427
+ # Verify npm global bin path is in your PATH
428
+ npm config get prefix
429
+
430
+ # Add to PATH if needed (example for macOS/Linux)
431
+ export PATH="$(npm config get prefix)/bin:$PATH"
432
+ ```
433
+
434
+ **Permission errors:**
435
+ ```bash
436
+ # Use sudo (not recommended) or fix npm permissions
437
+ sudo npm install -g neozip-cli@alpha
438
+
439
+ # Better: Fix npm permissions
440
+ mkdir ~/.npm-global
441
+ npm config set prefix '~/.npm-global'
442
+ export PATH=~/.npm-global/bin:$PATH
443
+ ```
444
+
445
+ ### Runtime Issues
446
+
447
+ **Archive integrity errors:**
448
+ ```bash
449
+ # Test archive integrity
450
+ neounzip -t archive.nzip
451
+
452
+ # Recreate archive if corrupted
453
+ neozip new-archive.nzip original-files/
454
+ ```
455
+
456
+ **Blockchain errors:**
457
+ ```bash
458
+ # Check wallet configuration
459
+ neozip config
460
+
461
+ # Reconfigure wallet
462
+ neozip init
463
+ ```
464
+
465
+ **Encryption errors:**
466
+ ```bash
467
+ # Verify password is correct
468
+ neounzip -P "your-password" archive.nzip
469
+
470
+ # Try different encryption method
471
+ neozip --pkzip-encrypt -P "password" archive.nzip files/
472
+ ```
473
+
474
+ ## Contributing
475
+
476
+ We welcome feedback and contributions! Since this is an alpha release, we're actively seeking input:
477
+
478
+ 1. **Report Issues**: Use [GitHub Issues](https://github.com/NeoWareInc/neozip-support/issues) or email [support@neozip.io](mailto:support@neozip.io)
479
+ 2. **Suggest Features**: Share your ideas and use cases
480
+ 3. **Test and Provide Feedback**: Help us improve by testing and reporting your experience
481
+
482
+ **Important**: This is an alpha release. API and behavior may change. Please test thoroughly.
483
+
484
+ ## License
485
+
486
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
487
+
488
+ ## Support
489
+
490
+ - **GitHub Issues**: [Report bugs or request features](https://github.com/NeoWareInc/neozip-support/issues) (public issue tracker)
491
+ - **Email Support**: [support@neozip.io](mailto:support@neozip.io)
492
+ - **Documentation**: See [DOCUMENTATION.md](DOCUMENTATION.md) for detailed guides
493
+
494
+ ## Acknowledgments
495
+
496
+ - Built with [NeoZipKit] - coming soon
497
+ - Compatible with InfoZip utilities
498
+ - Follows ZIP format specification (APPNOTE.TXT)
499
+
500
+ ---
501
+
502
+ **Version**: 0.70.0-alpha
503
+ **Status**: Alpha Release
504
+ **Last Updated**: 2025