packup-cli 1.2.0 → 1.2.1
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.
- package/README.md +145 -0
- package/package.json +4 -1
package/README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# packup-cli
|
|
2
|
+
|
|
3
|
+
Pack folders into portable, integrity-verified strings. Supports encryption for secure sharing.
|
|
4
|
+
|
|
5
|
+
## How it works
|
|
6
|
+
|
|
7
|
+
### Pack Flow
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
|
11
|
+
│ Folder │────▶│ ZIP Buffer │────▶│ Base64 │────▶│ PACKUP:1: │
|
|
12
|
+
│ ./src/* │ │ (in memory)│ │ encode │ │ hash:data │
|
|
13
|
+
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Encrypted Pack Flow
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
|
20
|
+
│ Folder │────▶│ ZIP Buffer │────▶│ AES-256 │────▶│ Base64 │────▶│ PACKUP:2: │
|
|
21
|
+
│ ./src/* │ │ (in memory)│ │ encrypt │ │ encode │ │ hash:data │
|
|
22
|
+
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
|
|
23
|
+
│
|
|
24
|
+
┌──────┴──────┐
|
|
25
|
+
│ Password │
|
|
26
|
+
│ + PBKDF2 │
|
|
27
|
+
└─────────────┘
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Unpack Flow
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
|
34
|
+
│ PACKUP:1: │────▶│ Verify │────▶│ Base64 │────▶│ Extract │
|
|
35
|
+
│ hash:data │ │ SHA-256 │ │ decode │ │ to disk │
|
|
36
|
+
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g packup-cli
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## CLI Usage
|
|
46
|
+
|
|
47
|
+
### Pack a folder
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Pack to clipboard
|
|
51
|
+
packup pack ./my-folder
|
|
52
|
+
|
|
53
|
+
# Pack to file
|
|
54
|
+
packup pack ./my-folder -o packed.txt
|
|
55
|
+
|
|
56
|
+
# Pack with encryption
|
|
57
|
+
packup pack ./my-folder -e
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Unpack
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Unpack from clipboard
|
|
64
|
+
packup unpack ./destination
|
|
65
|
+
|
|
66
|
+
# Unpack from file
|
|
67
|
+
packup unpack ./destination -i packed.txt
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If the packed string is encrypted, you'll be prompted for the password.
|
|
71
|
+
|
|
72
|
+
### Info
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Show info from clipboard
|
|
76
|
+
packup info
|
|
77
|
+
|
|
78
|
+
# Show info from file
|
|
79
|
+
packup info -i packed.txt
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Encryption
|
|
83
|
+
|
|
84
|
+
Use the `-e` flag to encrypt with AES-256-CBC:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
packup pack ./secret-folder -e
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Features:
|
|
91
|
+
|
|
92
|
+
- AES-256-CBC encryption
|
|
93
|
+
- PBKDF2 key derivation (100,000 iterations)
|
|
94
|
+
- SHA-256 integrity verification
|
|
95
|
+
- Cross-compatible with the bash version
|
|
96
|
+
|
|
97
|
+
## AI Agent / Automation
|
|
98
|
+
|
|
99
|
+
For non-interactive use, set the `PACKUP_PASSWORD` environment variable:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
export PACKUP_PASSWORD="mysecretpassword"
|
|
103
|
+
packup pack ./folder -e -o packed.txt
|
|
104
|
+
packup unpack ./dest -i packed.txt
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## API Usage
|
|
108
|
+
|
|
109
|
+
```javascript
|
|
110
|
+
import { pack, unpack, info, isEncrypted } from 'packup-cli';
|
|
111
|
+
|
|
112
|
+
// Pack a folder
|
|
113
|
+
const packedString = await pack('./my-folder');
|
|
114
|
+
|
|
115
|
+
// Pack with encryption
|
|
116
|
+
const encrypted = await pack('./my-folder', { password: 'secret' });
|
|
117
|
+
|
|
118
|
+
// Check if encrypted
|
|
119
|
+
if (isEncrypted(packedString)) {
|
|
120
|
+
console.log('This package is encrypted');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Unpack
|
|
124
|
+
await unpack(packedString, './destination');
|
|
125
|
+
await unpack(encrypted, './destination', { password: 'secret' });
|
|
126
|
+
|
|
127
|
+
// Get info
|
|
128
|
+
const metadata = await info(packedString);
|
|
129
|
+
console.log(metadata.files);
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Format
|
|
133
|
+
|
|
134
|
+
Packup strings follow this format:
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
PACKUP:<version>:<sha256-hash>:<base64-data>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
- Version 1: Unencrypted
|
|
141
|
+
- Version 2: Encrypted (AES-256-CBC)
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "packup-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Pack folders into portable, integrity-verified strings",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -23,5 +23,8 @@
|
|
|
23
23
|
"archiver": "^7.0.0",
|
|
24
24
|
"adm-zip": "^0.5.0",
|
|
25
25
|
"clipboardy": "^4.0.0"
|
|
26
|
+
},
|
|
27
|
+
"overrides": {
|
|
28
|
+
"glob": "^13.0.0"
|
|
26
29
|
}
|
|
27
30
|
}
|