XPManager 2.0.0

XPManager is a CLI tool specialized in dealing with passwords management and file encryption/decryption.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
## Index:

- [password-manager]#password-manager
    - [generate]#generate
    - [save]#save
    - [find]#find
    - [show]#show
    - [count]#count
    - [update]#update
    - [delete]#delete
    - [encrypt]#encrypt
    - [decrypt]#decrypt
- [encryption-manager]#encryption-manager
    - [encrypt-file]#encrypt-file
    - [decrypt-file]#decrypt-file
    - [encrypt-dir]#encrypt-dir
    - [decrypt-dir]#decrypt-dir
    - [encode]#encode
    - [decode]#decode
- [backup-manager]#backup-manager
    - [backup]#backup
    - [restore]#restore
- [log-manager]#log-manager
    - [clear]#clear
    - [show]#show-1
    - [find]#find-1
    - [delete]#delete-1

## password-manager:

Generate, save, update, delete, and manage passwords.

### generate:

Generate new password as ASCII/HEX.
```sh
# NOTE: password does NOT contain space.


# generate password in ASCII

$ xpm password-manager|pm generate|g <LENGTH>
# generate password in HEX
$ xpm password-manager|pm generate|g <LENGTH> --hex
# save the generated password

$ xpm password-manager|pm generate|g <LENGTH> --save <NAME>


# Exapmle:

## 33 character in ASCII

$ xpm pm g 33

## 16 character in HEX

$ xpm pm g 16 --hex

## 33 character in ASCII with save

$ xpm pm g 33 --save "github acount"

## 16 character in HEX with save 

$ xpm pm g 16 --hex --save "test xpm v2"
```

### save:

Save custom password in the database.
```sh
# save password

$ xpm password-manager|pm save <NAME>

# Exapmle:

$ xpm pm save "My custom password"
## It will ask you to enter the password.

## NOTE: If password manager database is encrypted it will ask you to enter the decryption key.

```

### find:

Search for password in the database.
```sh
# find password

$ xpm password-manager|pm find <STRING>

# Exapmle:

$ xpm pm find "github"
## NOTE: If password manager database is encrypted it will ask you to enter the decryption key.

## It will search base on the string to find the password that contains the string in the password name.

## NOTE: It is not case sensitive.

## It will display all passwords that match the string in this format:

###     <ID> - <CREATE-AT> - <UPDATE-AT> - <NAME>: <PASSWORD>

```

### show:

Display all passwords in the database.
```sh
# display passwords

## NOTE: this will display all passwords in this format:

###     <ID> - <CREATE-AT> - <UPDATE-AT> - <NAME>: <PASSWORD>

$ xpm password-manager|pm show
# display passwords in table format
## NOTE: this will not show the password, it will show only:

###     id, name, create_at, update_at as table.

$ xpm password-manager|pm show --table|-t

# Exapmle:

$ xpm pm show
## NOTE: If password manager database is encrypted it will ask you to enter the decryption key.

## OUTPUT: 1 - 2025-04-08 15:32:12 - 2025-04-10 15:32:12 - API token: 7FD47C5238D41635AB22E35B09FB6D


$ xpm pm show --table
## NOTE: If password manager database is encrypted it will ask you to enter the decryption key.

## OUTPUT:

###     ╭────┬──────────────────────────────┬─────────────────────┬─────────────────────╮

###     │ id │             name             │      create_at      │      update_at      │

###     ├────┼──────────────────────────────┼─────────────────────┼─────────────────────┤

###     │ 1  │ XPManager GitHub             │ 2025-04-08 15:32:12 │ 2025-04-09 08:43:46 │

###     │ 2  │ API token                    │ 2025-04-08 15:32:12 │ 2025-04-08 15:32:12 │

###     │ 3  │ test xpm                     │ 2025-04-09 08:38:55 │ 2025-04-09 08:38:55 │

###     ╰────┴──────────────────────────────┴─────────────────────┴─────────────────────╯

```

### count:

Get the number of passwords you saved in the database.
```sh
# count passwords

$ xpm password-manager|pm count

# Exapmle:

$ xpm pm count
## NOTE: If password manager database is encrypted it will ask you to enter the decryption key.

## OUTPUT: [INFO] - [count-password] there is 3 in the database. - 4ms

```

### update:

Update the password information.
```sh
# update password

# NOTE: <ID> is integer.

$ xpm password-manager|pm update|up <ID> --password|-p
# update the password name
$ xpm password-manager|pm update|up <ID> --name|-n
# update both password and its name

$ xpm password-manager|pm update|up <ID> --name|-n --password|-n

# Exapmle:

## Update the password with id 1

$ xpm pm update 1 --password
## NOTE: If password manager database is encrypted it will ask you to enter the decryption key.

## It will ask you to enter the password.

## OUTPUT: [INFO] - [update-password] there is 1 password updated successfully. - 15ms


$ xpm pm update 1 --password --name
## NOTE: If password manager database is encrypted it will ask you to enter the decryption key.

## It will ask you to enter both password and name.

## OUTPUT: [INFO] - [update-password] there is 1 password updated successfully. - 15ms

```

### delete:

Delete specific password from the database.
```sh
# delete password

# NOTE: <ID> is integer.

$ xpm password-manager|pm delete <ID>

# Exapmle:

## Delete the password with id 1

$ xpm pm delete 1
## NOTE: If password manager database is encrypted it will ask you to enter the decryption key.

## OUTPUT: [INFO] - [delete-password] there is 1 deleted. - 12ms

```

### encrypt:

Encrypt the password manager database.
```sh
# encrypt passwords manager database without key

$ xpm password-manager|pm encrypt
# encrypt passwords manager database with key
$ xpm password-manager|pm encrypt --key

# Exapmle:

## encrypt without key

$ xpm pm encrypt
## NOTE: If password manager database is encrypted it will not encrypt it once again.

## It will display to you the key.

## Please store the key somewhere safe. 

## WARNING: if you lose the key, you will not be able to recover the passwords.


## encrypt with key

$ xpm pm encrypt --key
## NOTE: If password manager database is encrypted it will not encrypt it once again.

## It will ask you to enter the key.

```

### decrypt:

Decrypt the password manager database.
```sh
# decrypt passwords manager database

$ xpm password-manager|pm decrypt

# Exapmle:

## decrypt

$ xpm pm decrypt
## NOTE: If password manager database is decrypted it will not decrypt it once again.

## It will ask you to enter the key.

```

## encryption-manager:

Encrypt/Decrypt file and folder and encode/decode strings.

### encrypt-file:

Encrypt file.
```sh
# NOTE: --delete will wipe and delete the origin file

# encrypt file without key or delete

$ xpm encryption-manager|em encrypt-file|enf <PATH>
# encrypt file with key
$ xpm encryption-manager|em encrypt-file|enf <PATH> --key
# encrypt file with key and delete

$ xpm encryption-manager|em encrypt-file|enf <PATH> --key --delete
# encrypt file without key and with delete
$ xpm encryption-manager|em encrypt-file|enf <PATH> --delete

# Example:

## encrypt file without key or delete

$ xpm em enf "~/myfolder/myfile.txt"
## It will display to you the key.

## Please store the key somewhere safe. 

## WARNING: if you lose the key, you will not be able to recover the file.


## encrypt file with key

$ xpm em enf "~/myfolder/myfile.txt" --key
## It will ask you to enter the key.


## encrypt file with key and delete

$ xpm em enf "~/myfolder/myfile.txt" --key --delete
## It will ask you to enter the key.

## WARNING: It will wipe and detele the origin file.

###     in this case the origin file is 'myfile.txt'


## encrypt file without key and with delete

$ xpm em enf "~/myfolder/myfile.txt" --delete
## It will display to you the key.

## WARNING: It will wipe and detele the origin file.

###     in this case the origin file is 'myfile.txt'

```

### decrypt-file:

Decrypt file.
```sh
# NOTE: --delete will wipe and delete the origin file.

# NOTE: --xpmv1 use to decrypt XPManager v1.0 files.

# WARNING: Do NOT use --xpmv1 with files has been encrypted using XPManager >= v2.0

# decrypt file without delete

$ xpm encryption-manager|em decrypt-file|def <PATH>
# decrypt file with delete
$ xpm encryption-manager|em decrypt-file|def <PATH> --delete
# decrypt file that has been encrypted using XPManager v1.0 without delete

$ xpm encryption-manager|em decrypt-file|def <PATH> --xpmv1
# decrypt file that has been encrypted using XPManager v1.0 without delete
$ xpm encryption-manager|em decrypt-file|def <PATH> --xpmv1 --delete

# Example:

## decrypt file without delete

$ xpm em def "~/myfolder/myfile.txt.x"
## It will ask you to enter the key.


## decrypt file with delete

$ xpm em def "~/myfolder/myfile.txt.x" --delete
## It will ask you to enter the key.

## WARNING: It will wipe and detele the origin file.

###     in this case the origin file is 'myfile.txt.x'


## decrypt file that has been encrypted using XPManager v1.0 without delete

$ xpm em def "~/myfolder/myfile.txt.x" --xpmv1
## NOTE: You need to decode the old v1.0 key using 'xpm em decode --xpmv1'

## It will ask you to enter the key.


## decrypt file that has been encrypted using XPManager v1.0 without delete

$ xpm em def "~/myfolder/myfile.txt.x" --xpmv1 --delete
## NOTE: You need to decode the old v1.0 key using 'xpm em decode --xpmv1'

## It will ask you to enter the key.

## WARNING: It will wipe and detele the origin file.

###     in this case the origin file is 'myfile.txt.x'

```

### encrypt-dir:

Encrypt directory.
```sh
# NOTE: --delete will wipe and delete the origin files.

# encrypt folder without key or delete

$ xpm encryption-manager|em encrypt-dir|end <PATH>
# encrypt folder without key and with delete
$ xpm encryption-manager|em encrypt-dir|end <PATH> --delete
# encrypt folder with key and without delete

$ xpm encryption-manager|em encrypt-dir|end <PATH> --key
# encrypt folder with key and delete
$ xpm encryption-manager|em encrypt-dir|end <PATH> --key --delete

# Example:

## encrypt folder without key or delete

$ xpm em end "~/myfolder"
## It will ask you to confirm the process.

## It will display to you the key.


# encrypt folder without key and with delete

$ xpm xpm em end "~/myfolder" --delete
## It will ask you to confirm the process.

## It will display to you the key.

## WARNING: It will wipe and detele the origin files.

###     in this case the origin files is any file has been encrypted in '~/myfolder'

# encrypt folder with key and without delete

$ xpm em end "~/myfolder" --key
## It will ask you to enter the key.

## It will ask you to confirm the process.


# encrypt folder with key and delete

$ xpm em end "~/myfolder" --key --delete
## It will ask you to enter the key.

## It will ask you to confirm the process.

## WARNING: It will wipe and detele the origin files.

###     in this case the origin files is any file has been encrypted in '~/myfolder'
```

### decrypt-dir:
Decrypt directory.
```sh
# NOTE: --delete will wipe and delete the origin files.
# NOTE: --xpmv1 use to decrypt XPManager v1.0 folders.
# WARNING: Do NOT use --xpmv1 with folder has been encrypted using XPManager >= v2.0
# decrypt folder without delete
$ xpm encryption-manager|em decrypt-dir|ded <PATH>
# decrypt folder with delete
$ xpm encryption-manager|em decrypt-dir|ded <PATH> --delete
# decrypt folder that has been encrypted using XPManager v1.0 without delete
$ xpm encryption-manager|em decrypt-dir|ded <PATH> --xpmv1
# decrypt folder that has been encrypted using XPManager v1.0 with delete
$ xpm encryption-manager|em decrypt-dir|ded <PATH> --xpmv1 --delete

# Example
## decrypt folder without delete
$ xpm em ded "~/myfolder"
## It will ask you to enter the key.

## decrypt folder with delete
$ xpm em ded "~/myfolder" --delete
## It will ask you to enter the key.
## It will ask you to confirm the process.
## WARNING: It will wipe and detele the origin files.
###     in this case the origin files is any file has been deccrypted in '~/myfolder'

## decrypt folder that has been encrypted using XPManager v1.0 without delete
$ xpm em ded "~/myfolder" --xpmv1
## NOTE: You need to decode the old v1.0 key using 'xpm em decode --xpmv1'
## It will ask you to enter the key.

## decrypt folder that has been encrypted using XPManager v1.0 with delete
$ xpm em ded "~/myfolder" --xpmv1 --delete
## NOTE: You need to decode the old v1.0 key using 'xpm em decode --xpmv1'
## It will ask you to enter the key.
## It will ask you to confirm the process.
## WARNING: It will wipe and detele the origin files.
###     in this case the origin files is any file has been deccrypted in '~/myfolder'
```

### encode:

Encode strings using different techniques.
```sh
# encode strings as hexadecimal

$ xpm encryption-manager|em encode|enc 
# encode strings as hexadecimal 
$ xpm encryption-manager|em encode|enc --hex
# encode strings as binary 

$ xpm encryption-manager|em encode|enc --bin
# encode strings as XPManager v1.0 key 
$ xpm encryption-manager|em encode|enc --xpmv1
# encode strings as hexadecimal hash

$ xpm encryption-manager|em encode|enc --hex-hash

# Example:

## encode strings as hexadecimal

$ xpm em enc
## It will ask you to enter the string

## It will display the encode

## INPUT: XPManager

## OUTPUT: 58 50 4D 61 6E 61 67 65 72


## encode strings as hexadecimal

$ xpm em enc --hex
## It will ask you to enter the string

## It will display the encode

## INPUT: xpm

## OUTPUT: 78 70 6D


## encode strings as binary 

$ xpm em enc --bin
## It will ask you to enter the string

## It will display the encode

## INPUT: xpm

## OUTPUT: 1111000 1110000 1101101


## encode strings as XPManager v1.0 key 

$ xpm em enc --xpmv1
## It will ask you to enter the string

## It will ask you to enter the constant

## It will display the encode

## INPUT: 

###     string: xpm

###     constant: 9999

## OUTPUT: 0x124f08%$%0x111690%$%0x10a163


## encode strings as hex hash

$ xpm em enc --hex-hash
## It will ask you to enter the string

## It will display the encode

## INPUT: Rust is the best

## OUTPUT: 1AE DC 141 1AE

```


### decode:

Decode strings using different techniques.
```sh
# decode strings as hexadecimal

$ xpm encryption-manager|em decode|dec
# decode strings as hexadecimal 
$ xpm encryption-manager|em decode|dec --hex
# decode strings as binary 

$ xpm encryption-manager|em decode|dec --bin
# decode strings as XPManager v1.0 key 
$ xpm encryption-manager|em decode|dec --xpmv1

# Example:

## decode strings as hexadecimal

$ xpm em dec
## It will ask you to enter the encode string 

## It will display the decode

## INPUT: 58 50 4D 61 6E 61 67 65 72

## OUTPUT: XPManager


## decode strings as hexadecimal

$ xpm em dec --hex
## It will ask you to enter the encode string

## It will display the decode

## INPUT: 78 70 6D

## OUTPUT: xpm


## decode strings as binary 

$ xpm em dec --bin
## It will ask you to enter the string

## It will display the decode

## INPUT: xpm

## OUTPUT: 1111000 1110000 1101101


## decode strings as XPManager v1.0 key 

$ xpm em dec --xpmv1
## It will ask you to enter the encode string

## It will ask you to enter the constant

## It will display the decode

## INPUT: 

###     encode: 0x124f08%$%0x111690%$%0x10a163

###     constant: 9999

## OUTPUT: xpm

```

## backup-manager:

Create/Restore backup for passwords/logs database.

### backup:

Create backup for passwords/logs database.
```sh
# backup the password manager database

$ xpm backup-manager|bm backup <SAVE-PATH> --password 
# backup the log manager database
$ xpm backup-manager|bm backup <SAVE-PATH> --log 
# backup the log manager and password manager database

$ xpm backup-manager|bm backup <SAVE-PATH> --log --password 

# Example:

## backup the password manager database

$ xpm bm backup "~/myfolder/backup_folder" --password
## NOTE: It will not create the backup if the password manager database is not encrypted.

## In this case you will find the backup at '~/myfolder/backup_folder/passwords.db.x'

## backup the log manager database

$ xpm bm backup "~/myfolder/backup_folder" --log 
## In this case you will find the backup at '~/myfolder/backup_folder/xpm-log.db'

## backup the log manager and password manager database

$ xpm bm backup "~/myfolder/backup_folder" --log --password 
## NOTE: It will not create the backup if the password manager database is not encrypted.

## In this case you will find the log backup at '~/myfolder/backup_folder/xpm-log.db'
## And the passwords backup at '~/myfolder/backup_folder/passwords.db.x'

```

### restore:

Restore passwords/logs database.
```sh
# restore the password manager database

$ xpm backup-manager|bm restore <PATH> --password 
# restore the log manager database
$ xpm backup-manager|bm restore <PATH> --log
# restore the XPManager v1.0 passwords database

$ xpm backup-manager|bm restore <PATH> --xpmv1
# restore passwords from a json file
## NOET: We support the key value fomrat like this:

###     { 

###         "<PASSWORD-NAME>": "<PASSWORD>"

###     }

$ xpm backup-manager|bm restore <PATH> --password-json

# Example:

## restore the password manager database

$ xpm bm restore "~/myfolder/backup_folder/passwords.db.x" --password
## It will ask you to enter the decryption key to decrypt the restore file

## NOTE: If password manager database is encrypted it will ask you to enter the decryption key.

## NOTE: It will do merge and add the passwords above your passwords.


## restore the log manager database

$ xpm bm restore "~/myfolder/backup_folder/xpm-log.db" --log
## WARNING: If the restore file is encrypted we can not restore it

##      If you encrypt it by yourself, decrypt it and then restore it.

## NOTE: We do not support the merge in the log manager restore,

##      so it will delete the old database and restore the new one.


## restore the XPManager v1.0 passwords database

$ xpm bm restore "~/myfolder/backup_folder/.passwords.json.x" --xpmv1
## It will ask you to enter the decryption key to decrypt the restore file

## NOTE: You need to decode the old v1.0 key using 'xpm em decode --xpmv1'

## NOTE: If password manager database is encrypted it will ask you to enter the decryption key.

## NOTE: It will do merge and add the passwords above your passwords.


## restore passwords from a json file

$ xpm bm restore "~/myfolder/backup_folder/custom-passwords.json" --password-json
## WARNING: If the restore file is encrypted we can not restore it

##      If you encrypt it by yourself, decrypt it and then restore it.

## NOTE: It will do merge and add the passwords above your passwords.

```

## log-manager:

Show, find, delete, or clear xpm logs.

### clear:

Clear all logs.
```sh
# clear XPManager log database

$ xpm log-manager|lm clear

# Example:

## clear XPManager log database

$ xpm lm clear
## WARNING: This will delete all logs.

```

### show:

Display all/some logs.
```sh
# show all logs

$ xpm log-manager|lm show
# show some logs
$ xpm log-manager|lm show --length|-l <LENGTH>

# Example:

## show all logs

$ xpm lm show
## OUTPUT:

###     ╭─────┬─────────────────────────────────────────────────────┬─────────────────────╮

###     │ id  │                        log                          │      create_at      │

###     ├─────┼─────────────────────────────────────────────────────┼─────────────────────┤

###     │  1  │ file '~/myfolder/passwords.db' wiped                │ 2025-04-10 06:38:18 │
###     │  2  │ encrypt file at '~/myfolder/passwords.db'           │ 2025-04-10 07:06:06 │

###     │  3  │ file '~/myfolder/passwords.db' encrypted            │ 2025-04-10 07:06:31 │
###     │  4  │ password with id 2 updated                          │ 2025-04-10 10:59:58 │
###     │  5  │ delete passwor with id 3: rows affected 1           │ 2025-04-10 11:07:30 │
###     ╰─────┴─────────────────────────────────────────────────────┴─────────────────────╯

## show some logs

$ xpm lm show -l 2
###     ╭─────┬─────────────────────────────────────────────────────┬─────────────────────╮

###     │ id  │                        log                          │      create_at      │

###     ├─────┼─────────────────────────────────────────────────────┼─────────────────────┤

###     │  1  │ file '~/myfolder/passwords.db' wiped                │ 2025-04-10 06:38:18 │
###     │  2  │ encrypt file at '~/myfolder/passwords.db'           │ 2025-04-10 07:06:06 │

###     ╰─────┴─────────────────────────────────────────────────────┴─────────────────────╯

```

### find:

Find logs based on date/string.
```sh
# find logs based on year

$ xpm log-manager|lm find --year <YEAR>
# find logs based on month
$ xpm log-manager|lm find --month <MONTH>
# find logs based on day

$ xpm log-manager|lm find --day <DAY>
# find logs based on date
$ xpm log-manager|lm find --year <YEAR> --month <MONTH> --day <DAY>
# find using string

$ xpm log-manager|lm find <STRING>

# Example:

## find logs based on year

$ xpm lm find --year 2025
## It will display any log created at 2025


## find logs based on month

$ xpm lm find --month 4
## It will display any log created at 4


## find logs based on day

$ xpm lm find --day 10
## It will display any log created at 10


## find logs based on date

$ xpm lm find --year 2025 --month 4 --day 10
## It will display any log created at 2025 04 10


## find using string

$ xpm lm find "passwords"
## It will display any log has string "passwords"

```

### delete:

Delete single log by id.
```sh
# delete log based on id

$ xpm log-manager|lm delete <ID>

# Example:

## delete log based on id

$ xpm lm delete 2
## OUTPUT: [INFO] - [delete-log] deleted 1 from the database. - 11ms

```