secrez 2.1.15 → 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/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 at least Node 10. If you have installed a previous 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).
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,445 +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
- **2.1.15**
372
-
373
- - add `find -R` to look for recent entries only. With `-l` to set a limit (default 10)
374
-
375
- **2.1.14**
376
-
377
- - reverse changes done in version 2.1.12
378
- - add a push option to Git that checks if there are changes in the repo and, if so, pushes them remotely, updating the system
379
-
380
- **2.1.12**
381
-
382
- - 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
383
-
384
- **2.1.11**
385
-
386
- - 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
387
-
388
- **2.1.10**
389
-
390
- - add external git change detection to block operations when repository state changes outside of Secrez (e.g., `git pull` in another terminal)
391
- - fix critical cache bug in git conflict detection that prevented external changes from being detected within 30 seconds
392
- - improve git conflict detection tests with comprehensive coverage for both git and non-git repositories
393
-
394
- **2.1.9**
395
-
396
- - add `<` parameter to reuse the last used path in commands (e.g., `totp <` will use the last path from previous command)
397
- - fix deprecation warning in `execSync` by properly escaping command arguments
398
-
399
- **2.1.8**
400
-
401
- - add `git` command to check repository status and detect remote changes
402
- - add git conflict detection middleware to prevent conflicts during data-changing operations
403
-
404
- **2.1.7**
405
-
406
- - add option `--no-export` to `export --crypto-env` to display the encrypted content in the console instead of writing it to a file
407
-
408
- **2.1.6**
409
-
410
- - export and encrypt, with option `--crypto-env`, the entire content of an item
411
-
412
- **2.1.5**
413
-
414
- - duplicate files using `touch <newfile> --from <file>` to copy the file from the source to the destination
415
-
416
- **2.1.4**
417
-
418
- - uses clipboard only on macOS
419
- - fixes `copy` return message when clipboard is not available
420
-
421
- **2.1.2**
422
-
423
- - disable `copy` command when in headless shells
424
-
425
- **2.1.1**
426
-
427
- - manage missing clipboard when in headless shells
428
- - fix bug in creating a `totp` when the target Yaml file is empty
429
-
430
- **2.0.1**
431
-
432
- - fix commands to change password and number of iterations
433
-
434
- **2.0.0** (breaking changes)
435
-
436
- - remove `@crypto/hub`, `@crypto/courier`, `@crypto/tunnel` and `@crypto/tls` since they are not maintained anymore
437
- - 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
438
-
439
- **1.1.6**
440
-
441
- - add support for cryptoEnv format to `export` (look at https://github.com/secrez/cryptoenv for details about CryptoEnv)
442
-
443
- **1.1.5**
444
-
445
- - fix touch's help showing wrong, temporary options, changed during the development :-(
446
-
447
- **1.1.4**
448
-
449
- - 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 :-(
450
- - add option `--timeout, -t` to customize the timeout when launching secrez
451
-
452
- **1.1.3**
453
-
454
- - 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`.
455
- - this README has been redacted by ChatGPT to make it more clear and concise.
456
-
457
- **1.1.2**
458
-
459
- - New options for `touch`:
460
- - `--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.
461
- - `--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.
462
- - `--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`.
463
- - `--amount` in combination with `--generate-wallet` specifies the amount of wallets to generate. The default is 1.
464
-
465
- **1.1.1** (unpublished)
466
-
467
- - using prettier for consistent formatting
468
-
469
- **1.1.0**
470
-
471
- - 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
472
-
473
- **1.0.4**
474
-
475
- - Fix wrong example in `import`
476
-
477
- **1.0.3**
478
-
479
- - `git` asks to quit Secrez and merge manually if there are remote changes
480
- - `totp` allows to add a totp code to an existing yaml file using the option `--set` (see the examples)
481
- - Default duration before clipboard reverse for `totp` is now 8 seconds
482
-
483
- **1.0.2**
484
-
485
- - Export and Import can encrypt/decrypt files using shared keys generated from a specified public key
486
- - Can export ecrypted file for the user itself, files that can be decrypted only from inside the secrez account that exported them
487
-
488
- **1.0.1**
489
-
490
- - Export and Import can handle encryption. Files can be exported encrypted using a specified password or a key shared with contacts
491
- - Contacts can add a contact also using contact's public key (previously you need a hub url)
492
- - Import specifies the file that have been skipped (because binary, encrypted or both)
493
-
494
- **1.0.0**
495
-
496
- - Requires `@secrez/utils@1.0.1` which fixes a yaml parsing error with ETH-like addresses
497
-
498
- **1.0.0-beta.3**
499
-
500
- - Rm allows to delete specific versions of a file
501
-
502
- **1.0.0-beta.2**
503
-
504
- - Git has new options `--init`, `--remote-url` and `--main-branch` to initiate a repo from inside Secrez
505
-
506
- **1.0.0-beta.1**
507
-
508
- - use @secrez/core@1.0.0, which changes the encoding from base58 to base64, making the encoding much faster
509
- - 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)
510
- - `Bash` has been renamed `Shell`
511
-
512
- **0.11.0**
513
-
514
- - 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)
515
-
516
- **0.10.8**
517
-
518
- - expose a prompt mock to allow other software to run commands programmatically
519
- - fix bug in totp when the command is called but no totp is set
520
-
521
- **0.10.7**
522
-
523
- - fix bug in `git -i` showing less changed that expected
524
-
525
- **0.10.6**
526
-
527
- - use `£` as an alternative to `#` when getting find results (whoops, I made this for myself, because I use both English and Italian keyboards)
528
- - add `leave` to leave a room
529
-
530
- **10.0.5**
531
-
532
- - fix bug in `git` wrongly returning `already up to date`
533
- - fix `git`'s help
534
-
535
- **0.10.4**
536
-
537
- - remove spaces in secret when launching `totp`
538
- - add a `--test` option, to test a secret
539
- - remove deprecated `exit`
540
-
541
- **0.10.3**
542
-
543
- - since it's not possible to clear the entire terminal, the clear screen process creates a false sense of security and has been removed
544
- - fix bug in `ls -l` when there are empty files
545
- - add message to suggest user to clear or close the terminal after quitting
546
-
547
- **0.10.2**
548
-
549
- - add a `git` command to push changes to the repo and pull changes
550
- - allow to run `bash` without parameters, asking later for the shell command
551
-
552
- **0.10.1**
553
-
554
- - encrypts binary files as is, without converting them to `base64` strings, like before
555
-
556
- **0.10.0**
557
-
558
- - use @secrez/hub 0.2.0 and @secrez/courier 0.2.0 (which are incompatible with the previous versions)
559
- - duplicate `whoami` and `contacts` to make them working inside the `chat` environment
560
-
561
- **0.9.4**
562
-
563
- - fix bug during import, if a `path` contains `:`; now, they are replaced with `_`
564
-
565
- **0.9.3**
566
-
567
- - fix bug with `ds -l` not working
568
-
569
- **0.9.2**
570
-
571
- - fix issue in `ls -l` that was working only in the current dataset
572
- - fix dates in `ls -l` in UTC time, instead than in local time
573
-
574
- **0.9.1**
575
-
576
- - `ls -l` returns details: size, creation date, last update date, number of versions and name
577
-
578
- **0.9.0**
579
-
580
- - Add `ds` to manage datasets
581
- - `ds` is also able to delete a dataset (moving its content to the `trash` dataset)
582
- - Remove feature `--rename` from `use`, since now `ds` manages the datasets
583
-
584
- **0.8.10**
585
-
586
- - If the default editor is not defined (env variable EDITOR) try to use nano or vim
587
-
588
- **0.8.9**
589
-
590
- - Pause clearScreen during editing
591
-
592
- **0.8.8**
593
-
594
- - Add the option `pathFrom` in `import` to build the `path` field using other fields
595
-
596
- **0.8.7**
597
-
598
- - Importing from a CSV file generates `.yaml` file instead of `.yml`
599
-
600
- **0.8.6**
601
-
602
- - 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
603
-
604
- **0.8.5**
605
-
606
- - Fix issue with find results when they include datasets.
607
- - Improve scripts (getting coverage only for modified packages)
608
- - Add a secrez.png as a generic asset
609
-
610
- **0.8.4**
611
-
612
- - fix issue if a file starts with #\d, like `#2something`
613
-
614
- **0.8.3**
615
-
616
- - add autocomplete based on `find` results; for example `cat #2` and press `tab` will complete with the second result in the search
617
-
618
- **0.8.2**
619
-
620
- - fix bug in `show` which listed all the messages
621
-
622
- **0.8.1**
623
-
624
- - fix bug in `conf` setting a 2FA
625
- - improve encapsulation of the `_Secrez` class
626
-
627
- **0.8.0**
628
-
629
- - add `contacts` to manage trusted users, i.e, trusted public keys
630
- - add `whoami` to get info about the account
631
- - add @secrez/courier to allow communication between local accounts
632
- - add @secrez/hub for the remote hub
633
- - add @secrez/tunnel to manage the tunneling for the Courier
634
- - add `chat` to enter the chat environemnt, and send/receive messages and data to any trusted user
635
- - add `chat`'s subcommands `join`, `send` and `show`.
636
- - return `find` results as a numbered list, to be used as variable (like `$1`) in following commands
637
- - deprecate `exit` in favor of `quit` to leave rooms, chat and app
638
- - add `ssh` to connect via ssh to a remote server from inside Secrez, to protect private keys without password
639
-
640
- **0.7.14**
641
-
642
- - fix chained aliases generating prompt duplications
643
-
644
- **0.7.13**
645
-
646
- - fix autocomplete when single command
647
-
648
- **0.7.12**
649
-
650
- - adds support for Linux to `totp --from-clipboard`, using `xclip`
651
-
652
- **0.7.11**
653
-
654
- - returns an alert if `clipboardy` does not find the required libraries
655
-
656
- **0.7.10**
657
-
658
- - fixes the autocomplete loading the data only when needed
659
-
660
- **0.7.9**
661
-
662
- - fix bug in MainPrompt.js which caused an exit if command not found
663
-
664
- **0.7.8**
665
-
666
- - upgrade `@secrez/core` to `0.7.1` which fixes an error if `env.json` does not exists
667
-
668
- **0.7.7**
669
-
670
- - aliases now accept params (ex. `alias x -c 'copy $1 && ls $2 $1')
671
-
672
- **0.7.6**
673
-
674
- - `rm` ask confirmation before delete forever from the `trash` dataset
675
- - `edit` does not crash if no path is passed
676
-
677
- **0.7.5**
678
-
679
- - `totp` can read an image to scan a qrcode and recover its secret
680
- - on MacOs, `totp` can also read the image from the clipboard to recover its secret; it requires `pngpaste`
681
-
682
- **0.7.4**
683
-
684
- - fix bug in autocomplete showing the error stack
685
- - add script to upgrade the versions of any changed packages
686
-
687
- **0.7.3**
688
-
689
- - `find` ignores `trash` during global searches if not using `--trash-too`
690
- - update to `@secrez/fs 0.7.2`, which fixes a bug in the `DataCache` class
691
-
692
- **0.7.2**
693
-
694
- - `totp` allows to generate TOTP codes (like Google Authenticator)
695
- - add option `--wait` to `copy` to force it to wait the end of the execution
696
- - `alias` handles chains of commands, like `copy coinbase.yml -f email password -d 3 2 --wait && totp coinbase.yml`
697
-
698
- **0.7.1**
699
-
700
- - Calling a command with unknown options will generate an error
701
- - Fix issue moving duplicates
702
- - Adds to `mv` an explicit destination field
703
-
704
- **0.7.0**
705
-
706
- - Introduce a more secure derivation process, using the iterations number in the salt. During the upgrade existing second factors of authentication will be removed
707
- - 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
708
-
709
- **0.6.5**
710
-
711
- - Add `duration` to `export` to delete the exported file after the duration (in seconds)
712
-
713
- **0.6.4**
714
-
715
- - Add `alias` to generate alias of any command
716
-
717
- **0.6.3**
718
-
719
- - Minor bug fix
720
-
721
- **0.6.2**
722
-
723
- - `copy` can put many fields in the clipboard, scheduling them
724
-
725
- **0.6.1**
726
-
727
- - Add support for U2F keys (Yubikey, Solokeys, etc.)
728
- - `ls` now returns sorted results
729
- - Fixed bug with `mv` and `rm` when using wildcards
730
- - Dynamic format for help, managing large examples
731
-
732
- **0.6.0**
733
-
734
- - Allow multiple datasets; `main` and `trash` exists by default
735
- - At start, purges old trees after successfully loading a dataset
736
- - `use` allows to use and create new dataset
737
- - `mv` supports `-d, --destination` for the destination
738
- - `mv` allows to move files among datasets with a syntax like `mv somefile archive:/` or `mv archive:somefile main:/some/`
739
- - `mv` adds `--find` and `--content-too` to use the result of a search as input
740
- - `mv`, if no destination set, asks if like to use the active directory in the target dataset
741
- - `ls -o d` and `ls -o f` to limit the listing only to folders or files
742
- - `copy` allows to select the field to copy in yaml files
743
- - Improve autocomplete to handle datasets
744
- - Fix autocomplete in `lcat`, which was wrongly using the internal files
745
- - `tag` is able to list and show tags along all the datasets, anche can use `--find` like `mv`
746
-
747
- **0.5.13**
748
-
749
- - Find in content excludes binary contents
750
-
751
- **0.5.12**
752
-
753
- - Optimize find inside contents caching the data
754
- - Fix an error returning wrong cases in the results
755
- - Remove an unnecessary message when nothing is recovered
756
-
757
- **0.5.11**
758
-
759
- - Use tags to prefix the path during import
760
-
761
- **0.5.10**
762
-
763
- - Fix the README that was not aligned
764
-
765
- **0.5.9**
766
-
767
- - Add Paste to paste the clipboard content in either a new or existent file, emptying the clipboard
768
- - Fix bug with Copy that was preventing the command from working
769
-
770
- **0.5.8**
771
-
772
- - Allow Import, with the options `-t`, to recognize tags during the import from CSV
773
- - Split Export in Export and Copy. The first only exports to the FS, the second copies to the clipboard
774
-
775
- **0.5.7**
776
-
777
- - Add wildcard support for Import, Mv, Rm and Tag
778
- - Add support for recursion during import
779
-
780
- **0.5.6**
781
-
782
- - Add Tag command to tag files and folders
783
-
784
- **0.5.5**
785
-
786
- - Optimize Import avoiding intermediate saves of the tree
787
- - Fix an issue with iterations at launch
788
-
789
- **0.5.4**
790
-
791
- - Add Import of many entries from CSV and JSON files
792
-
793
- **0.5.3**
794
-
795
- - Use Yaml files as cards, being able to read and edit single fields
796
-
797
- **0.5.2**
798
-
799
- - Remove obfuscation of the tree before saving (it was an overkill)
800
-
801
- **0.5.1**
802
-
803
- - Add Find to search in files and folders
804
-
805
- **0.5.0**
806
-
807
- - First stable version
808
-
809
- 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.
810
397
 
811
398
  ## Contribute
812
399
 
@@ -901,60 +488,60 @@ Thank you for any contributions! 😉
901
488
  ## Test coverage
902
489
 
903
490
  ```
904
- 1 passing (15s)
491
+ 211 passing (28s)
905
492
 
906
- --------------------|---------|----------|---------|---------|----------------------------------
493
+ --------------------|---------|----------|---------|---------|--------------------------------------
907
494
  File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
908
- --------------------|---------|----------|---------|---------|----------------------------------
909
- All files | 14.72 | 2.34 | 17.88 | 14.78 |
910
- src | 25.42 | 6.25 | 15 | 25.64 |
911
- Command.js | 24 | 8.62 | 21.42 | 24.32 | 22-35,40-110,116,127,130-182
912
- PreCommand.js | 8.82 | 0 | 0 | 8.82 | 6-97
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
913
501
  cliConfig.js | 100 | 100 | 100 | 100 |
914
- src/commands | 13.44 | 1.7 | 19.32 | 13.52 |
915
- Alias.js | 7.59 | 0 | 25 | 7.69 | 62-228
916
- Bash.js | 62.5 | 0 | 33.33 | 62.5 | 11-19
917
- Cat.js | 11.95 | 0 | 14.28 | 11.95 | 61-222
918
- Cd.js | 17.85 | 0 | 25 | 17.85 | 28-73
919
- Conf.js | 7.4 | 0 | 10 | 7.4 | 34-216
920
- Contacts.js | 5.73 | 0 | 7.69 | 5.78 | 53-284
921
- Copy.js | 10.98 | 0 | 12.5 | 11.11 | 71-268
922
- Ds.js | 5.55 | 0 | 16.66 | 5.63 | 39-170
923
- Edit.js | 11.76 | 0 | 20 | 11.76 | 61-222
924
- Export.js | 9.82 | 0 | 16.66 | 9.82 | 82-325
925
- Find.js | 7.69 | 0 | 8.33 | 7.89 | 63-211
926
- Git.js | 48.88 | 35.71 | 75 | 48.88 | 31,49-54,61,70-97,103,108,114
927
- Help.js | 33.33 | 0 | 50 | 33.33 | 26-43
928
- Import.js | 6.16 | 0 | 9.09 | 6.22 | 87-506
929
- Lcat.js | 30 | 0 | 25 | 30 | 35-65
930
- Lcd.js | 17.39 | 0 | 25 | 17.39 | 30-72
931
- Lls.js | 22.72 | 0 | 25 | 22.72 | 49-99
932
- Lpwd.js | 30.76 | 0 | 25 | 30.76 | 15-38
933
- Ls.js | 5.63 | 0 | 10 | 5.97 | 46-187
934
- Mkdir.js | 18.51 | 0 | 25 | 18.51 | 27-71
935
- Mv.js | 6.18 | 0 | 16.66 | 6.31 | 46-250
936
- Paste.js | 13.46 | 0 | 25 | 13.46 | 40-141
937
- Pwd.js | 30.76 | 0 | 25 | 30.76 | 15-35
938
- Quit.js | 50 | 0 | 33.33 | 50 | 19-40
939
- Rm.js | 14.54 | 0 | 16.66 | 14.81 | 36-147
940
- Shell.js | 29.41 | 0 | 25 | 29.41 | 25-57
941
- Show.js | 15.68 | 0 | 14.28 | 16 | 45-147
942
- Ssh.js | 22.22 | 0 | 20 | 22.22 | 49-120
943
- Tag.js | 8.41 | 0 | 9.09 | 8.49 | 66-246
944
- Totp.js | 13.59 | 0 | 9.09 | 13.59 | 76-327
945
- Touch.js | 14.54 | 0 | 25 | 14.81 | 75-245
946
- Use.js | 11.11 | 0 | 25 | 11.11 | 30-95
947
- Ver.js | 50 | 0 | 33.33 | 50 | 17-28
948
- 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
949
536
  index.js | 87.5 | 50 | 100 | 86.95 | 15,22,31
950
- src/prompts | 58.33 | 0 | 25 | 58.33 |
951
- MainPromptMock.js | 58.33 | 0 | 25 | 58.33 | 22-44
952
- src/utils | 15.89 | 6.86 | 10.25 | 15.62 |
953
- AliasManager.js | 5.88 | 0 | 0 | 5.88 | 3-48
954
- ContactManager.js | 6.66 | 0 | 0 | 6.66 | 3-44
955
- HelpProto.js | 4.2 | 0 | 16.66 | 4.27 | 11-200
956
- Logger.js | 54.54 | 43.75 | 15.78 | 53.48 | 8,12,16-57,65-69,74,84,88,93,105
957
- --------------------|---------|----------|---------|---------|----------------------------------
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
+ --------------------|---------|----------|---------|---------|--------------------------------------
958
545
  ```
959
546
 
960
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("homedir");
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)