secrez 2.1.16 → 2.2.0-beta.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/CHANGELOG.md +464 -0
- package/README.md +79 -497
- package/bin/secrez.js +11 -1
- package/package.json +14 -17
- package/src/PreCommand.js +16 -27
- package/src/Welcome.js +36 -1
- package/src/commands/Copy.js +12 -0
- package/src/commands/Edit.js +34 -101
- package/src/commands/Export.js +24 -2
- package/src/commands/Find.js +5 -1
- package/src/commands/Import.js +29 -2
- package/src/commands/Quit.js +8 -1
- package/src/commands/Shell.js +29 -2
- package/src/commands/Ssh.js +41 -13
- package/src/commands/Totp.js +37 -30
- package/src/editor/MemoryEditor.js +303 -0
- package/src/editor/onKeypress.js +131 -0
- package/src/prompts/CommandPrompt.js +2 -3
- package/src/prompts/MainPrompt.js +2 -0
- package/src/prompts/MainPromptMock.js +4 -0
- package/src/prompts/SigintManager.js +4 -0
- package/src/commands/Bash.js +0 -23
- package/src/prompts/MultiEditorPrompt.js +0 -41
package/README.md
CHANGED
|
@@ -89,7 +89,7 @@ Secrez uses [NaCl](https://github.com/dchest/tweetnacl-js) as its primary crypto
|
|
|
89
89
|
|
|
90
90
|
## How to install it
|
|
91
91
|
|
|
92
|
-
Secrez requires
|
|
92
|
+
Secrez requires Node.js 20 or later. If you have installed an older version, it may generate unclear errors and refuse to install or work properly. We recommend installing Node using nvm if possible. For more information, refer to [https://github.com/nvm-sh/nvm](https://github.com/nvm-sh/nvm).
|
|
93
93
|
|
|
94
94
|
Since this monorepo uses [Pnpm](https://pnpm.io/), it is better to install secrez using pnpm because the lock file will be used to avoid unexpected conflicts among modules. To install pnpm, run:
|
|
95
95
|
|
|
@@ -111,7 +111,7 @@ To get started with Secrez, simply run the command:
|
|
|
111
111
|
secrez
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
Upon first launch, Secrez will prompt you to enter a master password and the number of iterations. The number of iterations is used to derive a master key from your password, so the higher the number, the more secure your data will be. It's recommended to use between 500,000 and 1,000,000 iterations, but you can customize this based on your needs. For example, you can set the number of iterations explicitly by running:
|
|
114
|
+
Upon first launch, Secrez will prompt you to enter a master password and the number of iterations. The number of iterations is used to derive a master key from your password, so the higher the number, the more secure your data will be. It's recommended to use between 500,000 and 1,000,000 iterations, but you can customize this based on your needs. At signup, if you choose fewer than 100,000 iterations, Secrez shows a warning and asks for confirmation before proceeding (the threshold is lower than the recommended range because Secrez mixes the iteration count into the KDF salt, not just the password). For example, you can set the number of iterations explicitly by running:
|
|
115
115
|
|
|
116
116
|
```
|
|
117
117
|
secrez -i 1023896
|
|
@@ -140,7 +140,6 @@ Launching `help` you can list all available commands.
|
|
|
140
140
|
```
|
|
141
141
|
Available commands:
|
|
142
142
|
alias Create aliases of other commands.
|
|
143
|
-
bash << deprecated - use "shell" instead
|
|
144
143
|
cat Shows the content of a file.
|
|
145
144
|
cd Changes the working directory.
|
|
146
145
|
conf Shows current configuration and allow to change password and number of iterations).
|
|
@@ -197,6 +196,32 @@ This command will encrypt the file myWallet.json located on your Desktop, save i
|
|
|
197
196
|
|
|
198
197
|
This is particularly useful if you have just downloaded a private key to access your crypto wallet and want to encrypt it as soon as possible. With Secrez, you can import the file and delete the cleartext version in one command.
|
|
199
198
|
|
|
199
|
+
### Exporting and importing encrypted files
|
|
200
|
+
|
|
201
|
+
You can export a file encrypted for use outside Secrez with:
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
export mySecret.yml -e
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Secrez asks for a password and the number of PBKDF2 iterations. The exported file gets a `.secrez` extension (or `.secrezb` for binary files). Starting from version 2.2.0, password-based exports use format **v2**: a random salt is stored in the file, while the password and iteration count stay out of band (you must remember both to decrypt later).
|
|
208
|
+
|
|
209
|
+
To import a v2 file:
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
import mySecret.yml.secrez --password "your export password" -i 500000
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Use the same iteration count you chose at export time (`-i` on the command line, or Secrez will prompt you).
|
|
216
|
+
|
|
217
|
+
Files exported with older versions used format **v1** (weaker key derivation). You can still import them with the password only:
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
import old-backup.secrez --password "your export password"
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Exports encrypted for contacts or for yourself inside Secrez (shared keys) are unchanged and do not require a password or iterations at import time.
|
|
224
|
+
|
|
200
225
|
## Aliases — where the fun begins :-)
|
|
201
226
|
|
|
202
227
|
Suppose you have a bank card and want to log in to your online account. You could copy the email and password to the clipboard to paste them in the browser. If you expect to be able to move from the terminal to the browser in 4 seconds, you could run the command:
|
|
@@ -368,450 +393,7 @@ Secrez is not intended to compete with password managers, so do not expect it to
|
|
|
368
393
|
|
|
369
394
|
## History
|
|
370
395
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
- remove legacy second-factor handling from the CLI (`Welcome`, `Conf`)
|
|
374
|
-
- refactor `git` command tests to use a local bare repository instead of a private GitHub remote (no SSH keys or external setup required)
|
|
375
|
-
|
|
376
|
-
**2.1.15**
|
|
377
|
-
|
|
378
|
-
- add `find -R` to look for recent entries only. With `-l` to set a limit (default 10)
|
|
379
|
-
|
|
380
|
-
**2.1.14**
|
|
381
|
-
|
|
382
|
-
- reverse changes done in version 2.1.12
|
|
383
|
-
- add a push option to Git that checks if there are changes in the repo and, if so, pushes them remotely, updating the system
|
|
384
|
-
|
|
385
|
-
**2.1.12**
|
|
386
|
-
|
|
387
|
-
- enforce the usage of pnpm during global install. When that is not possible, for example with yarn, it blocks the execution asking the user to uninstall and install it again properly
|
|
388
|
-
|
|
389
|
-
**2.1.11**
|
|
390
|
-
|
|
391
|
-
- fix warning "(node:70960) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities" caused by the Git checker
|
|
392
|
-
|
|
393
|
-
**2.1.10**
|
|
394
|
-
|
|
395
|
-
- add external git change detection to block operations when repository state changes outside of Secrez (e.g., `git pull` in another terminal)
|
|
396
|
-
- fix critical cache bug in git conflict detection that prevented external changes from being detected within 30 seconds
|
|
397
|
-
- improve git conflict detection tests with comprehensive coverage for both git and non-git repositories
|
|
398
|
-
|
|
399
|
-
**2.1.9**
|
|
400
|
-
|
|
401
|
-
- add `<` parameter to reuse the last used path in commands (e.g., `totp <` will use the last path from previous command)
|
|
402
|
-
- fix deprecation warning in `execSync` by properly escaping command arguments
|
|
403
|
-
|
|
404
|
-
**2.1.8**
|
|
405
|
-
|
|
406
|
-
- add `git` command to check repository status and detect remote changes
|
|
407
|
-
- add git conflict detection middleware to prevent conflicts during data-changing operations
|
|
408
|
-
|
|
409
|
-
**2.1.7**
|
|
410
|
-
|
|
411
|
-
- add option `--no-export` to `export --crypto-env` to display the encrypted content in the console instead of writing it to a file
|
|
412
|
-
|
|
413
|
-
**2.1.6**
|
|
414
|
-
|
|
415
|
-
- export and encrypt, with option `--crypto-env`, the entire content of an item
|
|
416
|
-
|
|
417
|
-
**2.1.5**
|
|
418
|
-
|
|
419
|
-
- duplicate files using `touch <newfile> --from <file>` to copy the file from the source to the destination
|
|
420
|
-
|
|
421
|
-
**2.1.4**
|
|
422
|
-
|
|
423
|
-
- uses clipboard only on macOS
|
|
424
|
-
- fixes `copy` return message when clipboard is not available
|
|
425
|
-
|
|
426
|
-
**2.1.2**
|
|
427
|
-
|
|
428
|
-
- disable `copy` command when in headless shells
|
|
429
|
-
|
|
430
|
-
**2.1.1**
|
|
431
|
-
|
|
432
|
-
- manage missing clipboard when in headless shells
|
|
433
|
-
- fix bug in creating a `totp` when the target Yaml file is empty
|
|
434
|
-
|
|
435
|
-
**2.0.1**
|
|
436
|
-
|
|
437
|
-
- fix commands to change password and number of iterations
|
|
438
|
-
|
|
439
|
-
**2.0.0** (breaking changes)
|
|
440
|
-
|
|
441
|
-
- remove `@crypto/hub`, `@crypto/courier`, `@crypto/tunnel` and `@crypto/tls` since they are not maintained anymore
|
|
442
|
-
- add `show` command to show a card field as a QR code, for example to encode a private key and let a mobile wallet scan it
|
|
443
|
-
|
|
444
|
-
**1.1.6**
|
|
445
|
-
|
|
446
|
-
- add support for cryptoEnv format to `export` (look at https://github.com/secrez/cryptoenv for details about CryptoEnv)
|
|
447
|
-
|
|
448
|
-
**1.1.5**
|
|
449
|
-
|
|
450
|
-
- fix touch's help showing wrong, temporary options, changed during the development :-(
|
|
451
|
-
|
|
452
|
-
**1.1.4**
|
|
453
|
-
|
|
454
|
-
- add clear screen after 180 seconds to avoid that the user forgot its terminal open and accidentally shares it while sharing the screen during meetings — it happened to me :-(
|
|
455
|
-
- add option `--timeout, -t` to customize the timeout when launching secrez
|
|
456
|
-
|
|
457
|
-
**1.1.3**
|
|
458
|
-
|
|
459
|
-
- add new option `--keystore, -k` to `export`. If a file contains a private key field (i.e., a field with a name containing `private_key`), it can be exported in the keystore format. The file will have the same name with the extension replaced with `.keystore.json`.
|
|
460
|
-
- this README has been redacted by ChatGPT to make it more clear and concise.
|
|
461
|
-
|
|
462
|
-
**1.1.2**
|
|
463
|
-
|
|
464
|
-
- New options for `touch`:
|
|
465
|
-
- `--wait-for-content` to prompt the user to add the content, instead of expecting it as a parameter. The content will be trimmed at the first newline, if there is any.
|
|
466
|
-
- `--generate-wallet` to generate an Ethereum-compatible wallet in a new card or in an existing one. It generates the fields `private_key` and `address`, with private key and address.
|
|
467
|
-
- `--prefix` in combination with `--generate-wallet` specifies the prefix of the field, calling the fields, for example `my_private_key` and `my_address` if the prefix is `my`.
|
|
468
|
-
- `--amount` in combination with `--generate-wallet` specifies the amount of wallets to generate. The default is 1.
|
|
469
|
-
|
|
470
|
-
**1.1.1** (unpublished)
|
|
471
|
-
|
|
472
|
-
- using prettier for consistent formatting
|
|
473
|
-
|
|
474
|
-
**1.1.0**
|
|
475
|
-
|
|
476
|
-
- Remove `git`. If used carefully, the command was helpful, but still it is at risk of creating conflicts. After long thoughts, I disapproved my own proposal at: https://github.com/secrez/secrez/pull/163
|
|
477
|
-
|
|
478
|
-
**1.0.4**
|
|
479
|
-
|
|
480
|
-
- Fix wrong example in `import`
|
|
481
|
-
|
|
482
|
-
**1.0.3**
|
|
483
|
-
|
|
484
|
-
- `git` asks to quit Secrez and merge manually if there are remote changes
|
|
485
|
-
- `totp` allows to add a totp code to an existing yaml file using the option `--set` (see the examples)
|
|
486
|
-
- Default duration before clipboard reverse for `totp` is now 8 seconds
|
|
487
|
-
|
|
488
|
-
**1.0.2**
|
|
489
|
-
|
|
490
|
-
- Export and Import can encrypt/decrypt files using shared keys generated from a specified public key
|
|
491
|
-
- Can export ecrypted file for the user itself, files that can be decrypted only from inside the secrez account that exported them
|
|
492
|
-
|
|
493
|
-
**1.0.1**
|
|
494
|
-
|
|
495
|
-
- Export and Import can handle encryption. Files can be exported encrypted using a specified password or a key shared with contacts
|
|
496
|
-
- Contacts can add a contact also using contact's public key (previously you need a hub url)
|
|
497
|
-
- Import specifies the file that have been skipped (because binary, encrypted or both)
|
|
498
|
-
|
|
499
|
-
**1.0.0**
|
|
500
|
-
|
|
501
|
-
- Requires `@secrez/utils@1.0.1` which fixes a yaml parsing error with ETH-like addresses
|
|
502
|
-
|
|
503
|
-
**1.0.0-beta.3**
|
|
504
|
-
|
|
505
|
-
- Rm allows to delete specific versions of a file
|
|
506
|
-
|
|
507
|
-
**1.0.0-beta.2**
|
|
508
|
-
|
|
509
|
-
- Git has new options `--init`, `--remote-url` and `--main-branch` to initiate a repo from inside Secrez
|
|
510
|
-
|
|
511
|
-
**1.0.0-beta.1**
|
|
512
|
-
|
|
513
|
-
- use @secrez/core@1.0.0, which changes the encoding from base58 to base64, making the encoding much faster
|
|
514
|
-
- remove second factor authentication due to potentially critical issues with Python and the required libraries on macOS (2FA will be restored as soon as either a pure Javascript library is available or using external Python libraries is reliable again)
|
|
515
|
-
- `Bash` has been renamed `Shell`
|
|
516
|
-
|
|
517
|
-
**0.11.0**
|
|
518
|
-
|
|
519
|
-
- removed support for FIDO2 second factor authentication due to potential critical issues with Python and the required libraries on MacOS (2FA may be restored if a pure Javascript library becomes available)
|
|
520
|
-
|
|
521
|
-
**0.10.8**
|
|
522
|
-
|
|
523
|
-
- expose a prompt mock to allow other software to run commands programmatically
|
|
524
|
-
- fix bug in totp when the command is called but no totp is set
|
|
525
|
-
|
|
526
|
-
**0.10.7**
|
|
527
|
-
|
|
528
|
-
- fix bug in `git -i` showing less changed that expected
|
|
529
|
-
|
|
530
|
-
**0.10.6**
|
|
531
|
-
|
|
532
|
-
- use `£` as an alternative to `#` when getting find results (whoops, I made this for myself, because I use both English and Italian keyboards)
|
|
533
|
-
- add `leave` to leave a room
|
|
534
|
-
|
|
535
|
-
**10.0.5**
|
|
536
|
-
|
|
537
|
-
- fix bug in `git` wrongly returning `already up to date`
|
|
538
|
-
- fix `git`'s help
|
|
539
|
-
|
|
540
|
-
**0.10.4**
|
|
541
|
-
|
|
542
|
-
- remove spaces in secret when launching `totp`
|
|
543
|
-
- add a `--test` option, to test a secret
|
|
544
|
-
- remove deprecated `exit`
|
|
545
|
-
|
|
546
|
-
**0.10.3**
|
|
547
|
-
|
|
548
|
-
- since it's not possible to clear the entire terminal, the clear screen process creates a false sense of security and has been removed
|
|
549
|
-
- fix bug in `ls -l` when there are empty files
|
|
550
|
-
- add message to suggest user to clear or close the terminal after quitting
|
|
551
|
-
|
|
552
|
-
**0.10.2**
|
|
553
|
-
|
|
554
|
-
- add a `git` command to push changes to the repo and pull changes
|
|
555
|
-
- allow to run `bash` without parameters, asking later for the shell command
|
|
556
|
-
|
|
557
|
-
**0.10.1**
|
|
558
|
-
|
|
559
|
-
- encrypts binary files as is, without converting them to `base64` strings, like before
|
|
560
|
-
|
|
561
|
-
**0.10.0**
|
|
562
|
-
|
|
563
|
-
- use @secrez/hub 0.2.0 and @secrez/courier 0.2.0 (which are incompatible with the previous versions)
|
|
564
|
-
- duplicate `whoami` and `contacts` to make them working inside the `chat` environment
|
|
565
|
-
|
|
566
|
-
**0.9.4**
|
|
567
|
-
|
|
568
|
-
- fix bug during import, if a `path` contains `:`; now, they are replaced with `_`
|
|
569
|
-
|
|
570
|
-
**0.9.3**
|
|
571
|
-
|
|
572
|
-
- fix bug with `ds -l` not working
|
|
573
|
-
|
|
574
|
-
**0.9.2**
|
|
575
|
-
|
|
576
|
-
- fix issue in `ls -l` that was working only in the current dataset
|
|
577
|
-
- fix dates in `ls -l` in UTC time, instead than in local time
|
|
578
|
-
|
|
579
|
-
**0.9.1**
|
|
580
|
-
|
|
581
|
-
- `ls -l` returns details: size, creation date, last update date, number of versions and name
|
|
582
|
-
|
|
583
|
-
**0.9.0**
|
|
584
|
-
|
|
585
|
-
- Add `ds` to manage datasets
|
|
586
|
-
- `ds` is also able to delete a dataset (moving its content to the `trash` dataset)
|
|
587
|
-
- Remove feature `--rename` from `use`, since now `ds` manages the datasets
|
|
588
|
-
|
|
589
|
-
**0.8.10**
|
|
590
|
-
|
|
591
|
-
- If the default editor is not defined (env variable EDITOR) try to use nano or vim
|
|
592
|
-
|
|
593
|
-
**0.8.9**
|
|
594
|
-
|
|
595
|
-
- Pause clearScreen during editing
|
|
596
|
-
|
|
597
|
-
**0.8.8**
|
|
598
|
-
|
|
599
|
-
- Add the option `pathFrom` in `import` to build the `path` field using other fields
|
|
600
|
-
|
|
601
|
-
**0.8.7**
|
|
602
|
-
|
|
603
|
-
- Importing from a CSV file generates `.yaml` file instead of `.yml`
|
|
604
|
-
|
|
605
|
-
**0.8.6**
|
|
606
|
-
|
|
607
|
-
- Uses new onBeforeRewrite in [inquirer-command-prompt](https://github.com/sullof/inquirer-command-prompt) to remove the `#\d` when autocompleting the result of a search
|
|
608
|
-
|
|
609
|
-
**0.8.5**
|
|
610
|
-
|
|
611
|
-
- Fix issue with find results when they include datasets.
|
|
612
|
-
- Improve scripts (getting coverage only for modified packages)
|
|
613
|
-
- Add a secrez.png as a generic asset
|
|
614
|
-
|
|
615
|
-
**0.8.4**
|
|
616
|
-
|
|
617
|
-
- fix issue if a file starts with #\d, like `#2something`
|
|
618
|
-
|
|
619
|
-
**0.8.3**
|
|
620
|
-
|
|
621
|
-
- add autocomplete based on `find` results; for example `cat #2` and press `tab` will complete with the second result in the search
|
|
622
|
-
|
|
623
|
-
**0.8.2**
|
|
624
|
-
|
|
625
|
-
- fix bug in `show` which listed all the messages
|
|
626
|
-
|
|
627
|
-
**0.8.1**
|
|
628
|
-
|
|
629
|
-
- fix bug in `conf` setting a 2FA
|
|
630
|
-
- improve encapsulation of the `_Secrez` class
|
|
631
|
-
|
|
632
|
-
**0.8.0**
|
|
633
|
-
|
|
634
|
-
- add `contacts` to manage trusted users, i.e, trusted public keys
|
|
635
|
-
- add `whoami` to get info about the account
|
|
636
|
-
- add @secrez/courier to allow communication between local accounts
|
|
637
|
-
- add @secrez/hub for the remote hub
|
|
638
|
-
- add @secrez/tunnel to manage the tunneling for the Courier
|
|
639
|
-
- add `chat` to enter the chat environemnt, and send/receive messages and data to any trusted user
|
|
640
|
-
- add `chat`'s subcommands `join`, `send` and `show`.
|
|
641
|
-
- return `find` results as a numbered list, to be used as variable (like `$1`) in following commands
|
|
642
|
-
- deprecate `exit` in favor of `quit` to leave rooms, chat and app
|
|
643
|
-
- add `ssh` to connect via ssh to a remote server from inside Secrez, to protect private keys without password
|
|
644
|
-
|
|
645
|
-
**0.7.14**
|
|
646
|
-
|
|
647
|
-
- fix chained aliases generating prompt duplications
|
|
648
|
-
|
|
649
|
-
**0.7.13**
|
|
650
|
-
|
|
651
|
-
- fix autocomplete when single command
|
|
652
|
-
|
|
653
|
-
**0.7.12**
|
|
654
|
-
|
|
655
|
-
- adds support for Linux to `totp --from-clipboard`, using `xclip`
|
|
656
|
-
|
|
657
|
-
**0.7.11**
|
|
658
|
-
|
|
659
|
-
- returns an alert if `clipboardy` does not find the required libraries
|
|
660
|
-
|
|
661
|
-
**0.7.10**
|
|
662
|
-
|
|
663
|
-
- fixes the autocomplete loading the data only when needed
|
|
664
|
-
|
|
665
|
-
**0.7.9**
|
|
666
|
-
|
|
667
|
-
- fix bug in MainPrompt.js which caused an exit if command not found
|
|
668
|
-
|
|
669
|
-
**0.7.8**
|
|
670
|
-
|
|
671
|
-
- upgrade `@secrez/core` to `0.7.1` which fixes an error if `env.json` does not exists
|
|
672
|
-
|
|
673
|
-
**0.7.7**
|
|
674
|
-
|
|
675
|
-
- aliases now accept params (ex. `alias x -c 'copy $1 && ls $2 $1')
|
|
676
|
-
|
|
677
|
-
**0.7.6**
|
|
678
|
-
|
|
679
|
-
- `rm` ask confirmation before delete forever from the `trash` dataset
|
|
680
|
-
- `edit` does not crash if no path is passed
|
|
681
|
-
|
|
682
|
-
**0.7.5**
|
|
683
|
-
|
|
684
|
-
- `totp` can read an image to scan a qrcode and recover its secret
|
|
685
|
-
- on MacOs, `totp` can also read the image from the clipboard to recover its secret; it requires `pngpaste`
|
|
686
|
-
|
|
687
|
-
**0.7.4**
|
|
688
|
-
|
|
689
|
-
- fix bug in autocomplete showing the error stack
|
|
690
|
-
- add script to upgrade the versions of any changed packages
|
|
691
|
-
|
|
692
|
-
**0.7.3**
|
|
693
|
-
|
|
694
|
-
- `find` ignores `trash` during global searches if not using `--trash-too`
|
|
695
|
-
- update to `@secrez/fs 0.7.2`, which fixes a bug in the `DataCache` class
|
|
696
|
-
|
|
697
|
-
**0.7.2**
|
|
698
|
-
|
|
699
|
-
- `totp` allows to generate TOTP codes (like Google Authenticator)
|
|
700
|
-
- add option `--wait` to `copy` to force it to wait the end of the execution
|
|
701
|
-
- `alias` handles chains of commands, like `copy coinbase.yml -f email password -d 3 2 --wait && totp coinbase.yml`
|
|
702
|
-
|
|
703
|
-
**0.7.1**
|
|
704
|
-
|
|
705
|
-
- Calling a command with unknown options will generate an error
|
|
706
|
-
- Fix issue moving duplicates
|
|
707
|
-
- Adds to `mv` an explicit destination field
|
|
708
|
-
|
|
709
|
-
**0.7.0**
|
|
710
|
-
|
|
711
|
-
- Introduce a more secure derivation process, using the iterations number in the salt. During the upgrade existing second factors of authentication will be removed
|
|
712
|
-
- Allow to change password and number of iterations in `conf`. BE CAREFUl, any change in `conf` can cause conflicts in a remote repo. Don't do the same changes parallelly
|
|
713
|
-
|
|
714
|
-
**0.6.5**
|
|
715
|
-
|
|
716
|
-
- Add `duration` to `export` to delete the exported file after the duration (in seconds)
|
|
717
|
-
|
|
718
|
-
**0.6.4**
|
|
719
|
-
|
|
720
|
-
- Add `alias` to generate alias of any command
|
|
721
|
-
|
|
722
|
-
**0.6.3**
|
|
723
|
-
|
|
724
|
-
- Minor bug fix
|
|
725
|
-
|
|
726
|
-
**0.6.2**
|
|
727
|
-
|
|
728
|
-
- `copy` can put many fields in the clipboard, scheduling them
|
|
729
|
-
|
|
730
|
-
**0.6.1**
|
|
731
|
-
|
|
732
|
-
- Add support for U2F keys (Yubikey, Solokeys, etc.)
|
|
733
|
-
- `ls` now returns sorted results
|
|
734
|
-
- Fixed bug with `mv` and `rm` when using wildcards
|
|
735
|
-
- Dynamic format for help, managing large examples
|
|
736
|
-
|
|
737
|
-
**0.6.0**
|
|
738
|
-
|
|
739
|
-
- Allow multiple datasets; `main` and `trash` exists by default
|
|
740
|
-
- At start, purges old trees after successfully loading a dataset
|
|
741
|
-
- `use` allows to use and create new dataset
|
|
742
|
-
- `mv` supports `-d, --destination` for the destination
|
|
743
|
-
- `mv` allows to move files among datasets with a syntax like `mv somefile archive:/` or `mv archive:somefile main:/some/`
|
|
744
|
-
- `mv` adds `--find` and `--content-too` to use the result of a search as input
|
|
745
|
-
- `mv`, if no destination set, asks if like to use the active directory in the target dataset
|
|
746
|
-
- `ls -o d` and `ls -o f` to limit the listing only to folders or files
|
|
747
|
-
- `copy` allows to select the field to copy in yaml files
|
|
748
|
-
- Improve autocomplete to handle datasets
|
|
749
|
-
- Fix autocomplete in `lcat`, which was wrongly using the internal files
|
|
750
|
-
- `tag` is able to list and show tags along all the datasets, anche can use `--find` like `mv`
|
|
751
|
-
|
|
752
|
-
**0.5.13**
|
|
753
|
-
|
|
754
|
-
- Find in content excludes binary contents
|
|
755
|
-
|
|
756
|
-
**0.5.12**
|
|
757
|
-
|
|
758
|
-
- Optimize find inside contents caching the data
|
|
759
|
-
- Fix an error returning wrong cases in the results
|
|
760
|
-
- Remove an unnecessary message when nothing is recovered
|
|
761
|
-
|
|
762
|
-
**0.5.11**
|
|
763
|
-
|
|
764
|
-
- Use tags to prefix the path during import
|
|
765
|
-
|
|
766
|
-
**0.5.10**
|
|
767
|
-
|
|
768
|
-
- Fix the README that was not aligned
|
|
769
|
-
|
|
770
|
-
**0.5.9**
|
|
771
|
-
|
|
772
|
-
- Add Paste to paste the clipboard content in either a new or existent file, emptying the clipboard
|
|
773
|
-
- Fix bug with Copy that was preventing the command from working
|
|
774
|
-
|
|
775
|
-
**0.5.8**
|
|
776
|
-
|
|
777
|
-
- Allow Import, with the options `-t`, to recognize tags during the import from CSV
|
|
778
|
-
- Split Export in Export and Copy. The first only exports to the FS, the second copies to the clipboard
|
|
779
|
-
|
|
780
|
-
**0.5.7**
|
|
781
|
-
|
|
782
|
-
- Add wildcard support for Import, Mv, Rm and Tag
|
|
783
|
-
- Add support for recursion during import
|
|
784
|
-
|
|
785
|
-
**0.5.6**
|
|
786
|
-
|
|
787
|
-
- Add Tag command to tag files and folders
|
|
788
|
-
|
|
789
|
-
**0.5.5**
|
|
790
|
-
|
|
791
|
-
- Optimize Import avoiding intermediate saves of the tree
|
|
792
|
-
- Fix an issue with iterations at launch
|
|
793
|
-
|
|
794
|
-
**0.5.4**
|
|
795
|
-
|
|
796
|
-
- Add Import of many entries from CSV and JSON files
|
|
797
|
-
|
|
798
|
-
**0.5.3**
|
|
799
|
-
|
|
800
|
-
- Use Yaml files as cards, being able to read and edit single fields
|
|
801
|
-
|
|
802
|
-
**0.5.2**
|
|
803
|
-
|
|
804
|
-
- Remove obfuscation of the tree before saving (it was an overkill)
|
|
805
|
-
|
|
806
|
-
**0.5.1**
|
|
807
|
-
|
|
808
|
-
- Add Find to search in files and folders
|
|
809
|
-
|
|
810
|
-
**0.5.0**
|
|
811
|
-
|
|
812
|
-
- First stable version
|
|
813
|
-
|
|
814
|
-
Versions < 0.5.0 are deprecated because the format was sligtly different and they are incompatible.
|
|
396
|
+
See [CHANGELOG.md](CHANGELOG.md) for the full release history.
|
|
815
397
|
|
|
816
398
|
## Contribute
|
|
817
399
|
|
|
@@ -906,60 +488,60 @@ Thank you for any contributions! 😉
|
|
|
906
488
|
## Test coverage
|
|
907
489
|
|
|
908
490
|
```
|
|
909
|
-
|
|
491
|
+
211 passing (28s)
|
|
910
492
|
|
|
911
|
-
|
|
493
|
+
--------------------|---------|----------|---------|---------|--------------------------------------
|
|
912
494
|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
913
|
-
|
|
914
|
-
All files |
|
|
915
|
-
src |
|
|
916
|
-
Command.js |
|
|
917
|
-
PreCommand.js |
|
|
495
|
+
--------------------|---------|----------|---------|---------|--------------------------------------
|
|
496
|
+
All files | 86.68 | 74.22 | 86.18 | 86.62 |
|
|
497
|
+
src | 65.8 | 54.31 | 68.96 | 66.14 |
|
|
498
|
+
Command.js | 74.66 | 74.13 | 78.57 | 75.67 | ...5-62,73,80,93,127,164-172,179-182
|
|
499
|
+
PreCommand.js | 57.14 | 34.61 | 80 | 57.14 | 10-19,68-77
|
|
500
|
+
Welcome.js | 56.75 | 34.37 | 50 | 56.75 | ...4,129,138-140,148-163,174-175,181
|
|
918
501
|
cliConfig.js | 100 | 100 | 100 | 100 |
|
|
919
|
-
src/commands |
|
|
920
|
-
Alias.js |
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
Whoami.js | 27.77 | 0 | 20 | 27.77 | 20-50
|
|
502
|
+
src/commands | 89.08 | 75.91 | 93.77 | 89.02 |
|
|
503
|
+
Alias.js | 88.6 | 78.68 | 100 | 88.46 | 101,112,139,169,173,180,190,213-214
|
|
504
|
+
Cat.js | 98.91 | 88.88 | 100 | 98.91 | 152
|
|
505
|
+
Cd.js | 96.42 | 86.66 | 100 | 96.42 | 44
|
|
506
|
+
Conf.js | 90 | 74.46 | 77.77 | 90 | 107-110,138-141,150
|
|
507
|
+
Contacts.js | 86.06 | 75.6 | 100 | 85.95 | ...5,165,172,184,237,250,260,268-269
|
|
508
|
+
Copy.js | 87.5 | 71.92 | 72.72 | 87.36 | ...7,127,178,195,217-222,237-238,265
|
|
509
|
+
Ds.js | 90.27 | 82.6 | 100 | 90.14 | 99,108-113,125,147-148
|
|
510
|
+
Edit.js | 71.18 | 65 | 100 | 71.18 | 63,69,78,89-97,134-148
|
|
511
|
+
Export.js | 85.71 | 71.76 | 85.71 | 85.71 | ...4,232-236,241,253,262,265,269-283
|
|
512
|
+
Find.js | 90.3 | 74.16 | 100 | 90.12 | ...3,282-302,371,423-426,441-444,451
|
|
513
|
+
Git.js | 88.88 | 80.95 | 100 | 88.88 | 61,73,81,88,114
|
|
514
|
+
Help.js | 100 | 80 | 100 | 100 | 29
|
|
515
|
+
Import.js | 89.95 | 82.14 | 91.66 | 89.86 | ...4,414,420,468,484-485,493-500,527
|
|
516
|
+
Lcat.js | 100 | 85.71 | 100 | 100 | 54
|
|
517
|
+
Lcd.js | 95.65 | 81.81 | 100 | 95.65 | 50
|
|
518
|
+
Lls.js | 95.45 | 72.72 | 100 | 95.45 | 97
|
|
519
|
+
Lpwd.js | 92.3 | 100 | 100 | 92.3 | 36
|
|
520
|
+
Ls.js | 91.54 | 76.31 | 100 | 91.04 | 103,114-116,130,185
|
|
521
|
+
Mkdir.js | 92.59 | 60 | 100 | 92.59 | 56-57
|
|
522
|
+
Mv.js | 86.59 | 71.66 | 100 | 86.31 | 93-99,133,155-156,165,175-182
|
|
523
|
+
Paste.js | 84.61 | 70.83 | 100 | 84.61 | 72,78,81,89,113,130-131,139
|
|
524
|
+
Pwd.js | 92.3 | 100 | 100 | 92.3 | 33
|
|
525
|
+
Quit.js | 92.3 | 50 | 100 | 92.3 | 27
|
|
526
|
+
Rm.js | 90.9 | 76 | 100 | 90.74 | 63,125-126,136,144
|
|
527
|
+
Shell.js | 86.66 | 40 | 88.88 | 86.66 | 15,21,65,82
|
|
528
|
+
Show.js | 72.54 | 45.45 | 57.14 | 74 | ...8,100,106-114,117,123-126,132,145
|
|
529
|
+
Ssh.js | 78 | 57.69 | 85.71 | 78 | 87,95,100,129,133,141-148
|
|
530
|
+
Tag.js | 96.26 | 91.37 | 100 | 96.22 | 122,171,204-205
|
|
531
|
+
Totp.js | 89.28 | 72.3 | 92.3 | 89.18 | ...7,196-197,237,247,289-294,308-309
|
|
532
|
+
Touch.js | 96.36 | 80.64 | 100 | 96.29 | 164,240
|
|
533
|
+
Use.js | 91.66 | 86.95 | 100 | 91.66 | 68,83-84
|
|
534
|
+
Ver.js | 90 | 66.66 | 100 | 90 | 25
|
|
535
|
+
Whoami.js | 83.33 | 60 | 80 | 83.33 | 27,35,48
|
|
954
536
|
index.js | 87.5 | 50 | 100 | 86.95 | 15,22,31
|
|
955
|
-
src/prompts |
|
|
956
|
-
MainPromptMock.js |
|
|
957
|
-
src/utils |
|
|
958
|
-
AliasManager.js |
|
|
959
|
-
ContactManager.js |
|
|
960
|
-
HelpProto.js |
|
|
961
|
-
Logger.js |
|
|
962
|
-
|
|
537
|
+
src/prompts | 72 | 33.33 | 36.36 | 72 |
|
|
538
|
+
MainPromptMock.js | 72 | 33.33 | 36.36 | 72 | 29-35,44-50
|
|
539
|
+
src/utils | 83.58 | 78.43 | 69.23 | 83.33 |
|
|
540
|
+
AliasManager.js | 100 | 91.66 | 100 | 100 | 47
|
|
541
|
+
ContactManager.js | 73.33 | 60 | 85.71 | 73.33 | 12,34-36
|
|
542
|
+
HelpProto.js | 89.07 | 82.6 | 100 | 88.88 | 49,135-137,153-154,171-176,195
|
|
543
|
+
Logger.js | 65.9 | 56.25 | 42.1 | 65.11 | ...16,25,37-49,57,69,74,84,88,93,105
|
|
544
|
+
--------------------|---------|----------|---------|---------|--------------------------------------
|
|
963
545
|
```
|
|
964
546
|
|
|
965
547
|
## Copyright
|
package/bin/secrez.js
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const path = require("path");
|
|
4
|
-
const homedir = require("
|
|
4
|
+
const { homedir } = require("os");
|
|
5
5
|
const chalk = require("chalk");
|
|
6
6
|
const commandLineArgs = require("command-line-args");
|
|
7
7
|
|
|
8
8
|
const pkg = require("../package");
|
|
9
9
|
|
|
10
|
+
const nodeMajor = parseInt(process.versions.node.split(".")[0], 10);
|
|
11
|
+
if (nodeMajor < 20) {
|
|
12
|
+
console.error(
|
|
13
|
+
chalk.red(
|
|
14
|
+
`Secrez requires Node.js 20 or later (current: ${process.versions.node}).`
|
|
15
|
+
)
|
|
16
|
+
);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
10
20
|
const MainPrompt = require("../src/prompts/MainPrompt");
|
|
11
21
|
const Logger = require("../src/utils/Logger");
|
|
12
22
|
// Check if the package was installed with pnpm (skip check in development)
|