secrez 1.1.4 → 1.1.6

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
@@ -371,6 +371,14 @@ Secrez is not intended to compete with password managers, so do not expect it to
371
371
 
372
372
  ## History
373
373
 
374
+ **1.1.6**
375
+
376
+ - add support for cryptoEnv format to `export` (look at https://github.com/secrez/cryptoenv for details about CryptoEnv)
377
+
378
+ **1.1.5**
379
+
380
+ - fix touch's help showing wrong, temporary options, changed during the development :-(
381
+
374
382
  **1.1.4**
375
383
 
376
384
  - 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 :-(
@@ -828,73 +836,73 @@ Thank you for any contributions! 😉
828
836
  1 pending
829
837
 
830
838
  -----------------------|---------|----------|---------|---------|-----------------------------------
831
- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
839
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
832
840
  -----------------------|---------|----------|---------|---------|-----------------------------------
833
- All files | 71.22 | 58.41 | 71.25 | 71.11 |
834
- src | 59.63 | 54.79 | 55 | 60.19 |
835
- Command.js | 79.66 | 78.72 | 76.92 | 81.03 | 32,55-62,73,80,119
836
- PreCommand.js | 21.95 | 11.54 | 14.29 | 21.95 | 8-99,116
837
- cliConfig.js | 100 | 100 | 100 | 100 |
838
- src/commands | 81.53 | 67 | 89.95 | 81.4 |
839
- Alias.js | 90.54 | 77.36 | 100 | 90.41 | 101,112,139,169,173,180,190
840
- Bash.js | 75 | 0 | 66.67 | 75 | 18-19
841
- Cat.js | 98.9 | 88.89 | 100 | 98.9 | 152
842
- Cd.js | 96.43 | 86.67 | 100 | 96.43 | 44
843
- Chat.js | 19.51 | 0 | 16.67 | 19.51 | 23-144
844
- Conf.js | 10.45 | 0 | 25 | 10.45 | 134-499
845
- Contacts.js | 74.67 | 65.98 | 92.86 | 74.5 | ...90-214,240,247,259,315,328,338
846
- Copy.js | 94.87 | 74.51 | 100 | 94.81 | 111,162,179,204
847
- Courier.js | 63.54 | 41.86 | 85.71 | 63.83 | ...37,152-171,188,200-203,215-221
848
- Ds.js | 92.54 | 82.05 | 100 | 92.42 | 99,108-113,125
849
- Edit.js | 13.58 | 0 | 40 | 13.58 | 88-214
850
- Export.js | 87.63 | 67.74 | 100 | 87.63 | ...66,175,182-186,191,203,212,215
851
- Find.js | 93.59 | 86.67 | 100 | 93.42 | 101,164,200-203,209
852
- Help.js | 100 | 80 | 100 | 100 | 29
853
- Import.js | 93.2 | 85.48 | 100 | 93.14 | ...65,367,387,393,441,456-463,490
854
- Lcat.js | 100 | 85.71 | 100 | 100 | 54
855
- Lcd.js | 95.65 | 81.82 | 100 | 95.65 | 50
856
- Lls.js | 95.45 | 72.73 | 100 | 95.45 | 97
857
- Lpwd.js | 92.31 | 100 | 100 | 92.31 | 36
858
- Ls.js | 91.3 | 75 | 100 | 90.77 | 103,114-116,130,181
859
- Mkdir.js | 100 | 66.67 | 100 | 100 | 38-44
860
- Mv.js | 88.04 | 73.21 | 100 | 87.78 | 93-99,133,155,165-172
861
- Paste.js | 87.23 | 75 | 100 | 87.23 | 72,78,81,89,113,129
862
- Pwd.js | 92.31 | 100 | 100 | 92.31 | 33
863
- Quit.js | 90 | 50 | 100 | 90 | 27
864
- Rm.js | 94 | 80.95 | 100 | 93.88 | 63,126,134
865
- Shell.js | 88.24 | 60 | 100 | 88.24 | 38,55
866
- Ssh.js | 25 | 0 | 40 | 25 | 72-120
867
- Tag.js | 98.04 | 92.31 | 100 | 98.02 | 122,171
868
- Totp.js | 96.47 | 74.47 | 100 | 96.47 | 188-189,235
869
- Touch.js | 95.92 | 81.48 | 100 | 95.83 | 152,202
870
- Use.js | 96.77 | 89.47 | 100 | 96.77 | 68
871
- Ver.js | 90 | 66.67 | 100 | 90 | 25
872
- Whoami.js | 93.1 | 63.64 | 80 | 93.1 | 29,64
873
- chat.js | 85.37 | 53.85 | 100 | 85.37 | 105,117-130,136,142
874
- index.js | 91.67 | 60 | 100 | 91.3 | 22,31
875
- src/commands/chat | 79.44 | 63.29 | 92.31 | 79.33 |
876
- Contacts.js | 80 | 42.86 | 80 | 80 | 54,65,69,81
877
- Help.js | 86.67 | 60 | 100 | 86.67 | 37-38
878
- Join.js | 95.65 | 82.61 | 100 | 95.56 | 43,110
879
- Leave.js | 100 | 60 | 100 | 100 | 24,28
880
- Quit.js | 100 | 75 | 100 | 100 | 24
881
- Send.js | 67.65 | 46.67 | 100 | 67.65 | 37,41,44,77,86-95
882
- Show.js | 68.75 | 70.59 | 100 | 68.75 | 74-78,87,102-108
883
- Whoami.js | 42.86 | 0 | 60 | 42.86 | 22,30-39
884
- src/prompts | 14.72 | 0 | 13.43 | 14.85 |
885
- ChatPrompt.js | 6.1 | 0 | 0 | 6.1 | 8-164
886
- ChatPromptMock.js | 100 | 100 | 66.67 | 100 |
887
- CommandPrompt.js | 9.8 | 0 | 0 | 9.93 | 24-318
888
- Completion.js | 4.41 | 0 | 0 | 4.48 | 6-103
889
- MainPromptMock.js | 100 | 100 | 66.67 | 100 |
890
- MultiEditorPrompt.js | 25 | 0 | 0 | 25 | 7-36
891
- SigintManager.js | 25 | 0 | 20 | 25 | 10-36
892
- src/utils | 69.92 | 63.28 | 56.25 | 69.55 |
893
- AliasManager.js | 100 | 91.67 | 100 | 100 | 47
894
- ContactManager.js | 71.43 | 60 | 85.71 | 71.43 | 12,35-37
895
- Fido2Client.js | 15.38 | 0 | 11.11 | 15.38 | 14-108
896
- HelpProto.js | 91.6 | 84.06 | 100 | 91.45 | 49,153-154,171-176,195
897
- Logger.js | 63.64 | 56.25 | 36.84 | 62.79 | ...37-49,57,65-69,74,84,88,93,105
841
+ All files | 71.22 | 58.41 | 71.25 | 71.11 |
842
+ src | 59.63 | 54.79 | 55 | 60.19 |
843
+ Command.js | 79.66 | 78.72 | 76.92 | 81.03 | 32,55-62,73,80,119
844
+ PreCommand.js | 21.95 | 11.54 | 14.29 | 21.95 | 8-99,116
845
+ cliConfig.js | 100 | 100 | 100 | 100 |
846
+ src/commands | 81.53 | 67 | 89.95 | 81.4 |
847
+ Alias.js | 90.54 | 77.36 | 100 | 90.41 | 101,112,139,169,173,180,190
848
+ Bash.js | 75 | 0 | 66.67 | 75 | 18-19
849
+ Cat.js | 98.9 | 88.89 | 100 | 98.9 | 152
850
+ Cd.js | 96.43 | 86.67 | 100 | 96.43 | 44
851
+ Chat.js | 19.51 | 0 | 16.67 | 19.51 | 23-144
852
+ Conf.js | 10.45 | 0 | 25 | 10.45 | 134-499
853
+ Contacts.js | 74.67 | 65.98 | 92.86 | 74.5 | ...90-214,240,247,259,315,328,338
854
+ Copy.js | 94.87 | 74.51 | 100 | 94.81 | 111,162,179,204
855
+ Courier.js | 63.54 | 41.86 | 85.71 | 63.83 | ...37,152-171,188,200-203,215-221
856
+ Ds.js | 92.54 | 82.05 | 100 | 92.42 | 99,108-113,125
857
+ Edit.js | 13.58 | 0 | 40 | 13.58 | 88-214
858
+ Export.js | 87.63 | 67.74 | 100 | 87.63 | ...66,175,182-186,191,203,212,215
859
+ Find.js | 93.59 | 86.67 | 100 | 93.42 | 101,164,200-203,209
860
+ Help.js | 100 | 80 | 100 | 100 | 29
861
+ Import.js | 93.2 | 85.48 | 100 | 93.14 | ...65,367,387,393,441,456-463,490
862
+ Lcat.js | 100 | 85.71 | 100 | 100 | 54
863
+ Lcd.js | 95.65 | 81.82 | 100 | 95.65 | 50
864
+ Lls.js | 95.45 | 72.73 | 100 | 95.45 | 97
865
+ Lpwd.js | 92.31 | 100 | 100 | 92.31 | 36
866
+ Ls.js | 91.3 | 75 | 100 | 90.77 | 103,114-116,130,181
867
+ Mkdir.js | 100 | 66.67 | 100 | 100 | 38-44
868
+ Mv.js | 88.04 | 73.21 | 100 | 87.78 | 93-99,133,155,165-172
869
+ Paste.js | 87.23 | 75 | 100 | 87.23 | 72,78,81,89,113,129
870
+ Pwd.js | 92.31 | 100 | 100 | 92.31 | 33
871
+ Quit.js | 90 | 50 | 100 | 90 | 27
872
+ Rm.js | 94 | 80.95 | 100 | 93.88 | 63,126,134
873
+ Shell.js | 88.24 | 60 | 100 | 88.24 | 38,55
874
+ Ssh.js | 25 | 0 | 40 | 25 | 72-120
875
+ Tag.js | 98.04 | 92.31 | 100 | 98.02 | 122,171
876
+ Totp.js | 96.47 | 74.47 | 100 | 96.47 | 188-189,235
877
+ Touch.js | 95.92 | 81.48 | 100 | 95.83 | 152,202
878
+ Use.js | 96.77 | 89.47 | 100 | 96.77 | 68
879
+ Ver.js | 90 | 66.67 | 100 | 90 | 25
880
+ Whoami.js | 93.1 | 63.64 | 80 | 93.1 | 29,64
881
+ chat.js | 85.37 | 53.85 | 100 | 85.37 | 105,117-130,136,142
882
+ index.js | 91.67 | 60 | 100 | 91.3 | 22,31
883
+ src/commands/chat | 79.44 | 63.29 | 92.31 | 79.33 |
884
+ Contacts.js | 80 | 42.86 | 80 | 80 | 54,65,69,81
885
+ Help.js | 86.67 | 60 | 100 | 86.67 | 37-38
886
+ Join.js | 95.65 | 82.61 | 100 | 95.56 | 43,110
887
+ Leave.js | 100 | 60 | 100 | 100 | 24,28
888
+ Quit.js | 100 | 75 | 100 | 100 | 24
889
+ Send.js | 67.65 | 46.67 | 100 | 67.65 | 37,41,44,77,86-95
890
+ Show.js | 68.75 | 70.59 | 100 | 68.75 | 74-78,87,102-108
891
+ Whoami.js | 42.86 | 0 | 60 | 42.86 | 22,30-39
892
+ src/prompts | 14.72 | 0 | 13.43 | 14.85 |
893
+ ChatPrompt.js | 6.1 | 0 | 0 | 6.1 | 8-164
894
+ ChatPromptMock.js | 100 | 100 | 66.67 | 100 |
895
+ CommandPrompt.js | 9.8 | 0 | 0 | 9.93 | 24-318
896
+ Completion.js | 4.41 | 0 | 0 | 4.48 | 6-103
897
+ MainPromptMock.js | 100 | 100 | 66.67 | 100 |
898
+ MultiEditorPrompt.js | 25 | 0 | 0 | 25 | 7-36
899
+ SigintManager.js | 25 | 0 | 20 | 25 | 10-36
900
+ src/utils | 69.92 | 63.28 | 56.25 | 69.55 |
901
+ AliasManager.js | 100 | 91.67 | 100 | 100 | 47
902
+ ContactManager.js | 71.43 | 60 | 85.71 | 71.43 | 12,35-37
903
+ Fido2Client.js | 15.38 | 0 | 11.11 | 15.38 | 14-108
904
+ HelpProto.js | 91.6 | 84.06 | 100 | 91.45 | 49,153-154,171-176,195
905
+ Logger.js | 63.64 | 56.25 | 36.84 | 62.79 | ...37-49,57,65-69,74,84,88,93,105
898
906
  -----------------------|---------|----------|---------|---------|-----------------------------------
899
907
 
900
908
  ```
package/coverage.report CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- > secrez@1.1.4 test /Users/francescosullo/Projects/Secrez/secrez/packages/secrez
2
+ > secrez@1.1.6 test /Users/francescosullo/Projects/Secrez/secrez/packages/secrez
3
3
  > cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha test/*.test.js test/**/*.test.js test/**/**/*.js --exit
4
4
 
5
5
 
@@ -29,10 +29,10 @@
29
29
  #Cat
30
30
  ✓ should return the help
31
31
  ✓ should show the content of a file
32
- ✓ should show either one or all the versions of a file (1021ms)
32
+ ✓ should show either one or all the versions of a file (1016ms)
33
33
  ✓ should throw if entry is not a file or file does not exist
34
34
  ✓ should throw if trying to cat a binary file
35
- ✓ should show the content of a Yaml file (1023ms)
35
+ ✓ should show the content of a Yaml file (1018ms)
36
36
 
37
37
  #Cd
38
38
  ✓ should return the help
@@ -41,7 +41,7 @@
41
41
 
42
42
  #Chat
43
43
  ✓ should return the help
44
- ✓ should run the chat if the courier is ready (164ms)
44
+ ✓ should run the chat if the courier is ready (551ms)
45
45
 
46
46
  #Contacts
47
47
  ✓ should return the help
@@ -55,17 +55,17 @@
55
55
 
56
56
  #Copy
57
57
  ✓ should return the help
58
- ✓ should copy a file to the clipboard (376ms)
59
- ✓ should copy a string to the clipboard (246ms)
60
- ✓ should copy a card to the clipboard (855ms)
58
+ ✓ should copy a file to the clipboard (401ms)
59
+ ✓ should copy a string to the clipboard (244ms)
60
+ ✓ should copy a card to the clipboard (883ms)
61
61
  ✓ should return an error if the file does not exist or is a folder
62
62
  ✓ should throw if copying to clipboard a binary files
63
63
 
64
64
  #Courier
65
65
  ✓ should return the help
66
66
  ✓ should check if it is ready
67
- ✓ should set up the courier (140ms)
68
- ✓ should set up the courier and get the default message when is already set up (144ms)
67
+ ✓ should set up the courier (172ms)
68
+ ✓ should set up the courier and get the default message when is already set up (171ms)
69
69
 
70
70
  #Ds
71
71
  ✓ should return the help
@@ -81,11 +81,12 @@
81
81
  ✓ should export an encrypted file to the current local folder
82
82
  ✓ should export a file and delete it after 1 second (1205ms)
83
83
  ✓ should return an error if the file does not exist or is a folder
84
- ✓ should export a keystore json file if a private_key exists in the entry (726ms)
84
+ ✓ should export a keystore json file if a private_key exists in the entry (1050ms)
85
+ ✓ should export a cryptoenv file if a private_key exists in the entry
85
86
 
86
87
  #Find
87
88
  ✓ should return the help
88
- ✓ should show find a string in the tree (1031ms)
89
+ ✓ should show find a string in the tree (1024ms)
89
90
  ✓ should find no result without parameters
90
91
  ✓ should skip binary files from search
91
92
 
@@ -103,7 +104,7 @@
103
104
  ✓ should import an encrypted binary file and export it again verifying it is fine
104
105
  ✓ should import files recursively
105
106
  ✓ should read a folder and import the only text file
106
- should read a folder and import text and binary files
107
+ 1) should read a folder and import text and binary files
107
108
  ✓ should simulate the import of two files
108
109
  ✓ should move the imported file
109
110
  ✓ should import a backup from another software spanning the data among folders and files
@@ -150,7 +151,7 @@
150
151
 
151
152
  #Mv
152
153
  ✓ should return the help
153
- ✓ should rename a file (1009ms)
154
+ ✓ should rename a file (1010ms)
154
155
  ✓ should move a file to another folder
155
156
  ✓ should move many files to another folder
156
157
  ✓ should move a file to another subfolder
@@ -159,14 +160,14 @@
159
160
  ✓ should move file to another dataset using wildcards
160
161
  ✓ should move file managing duplicates
161
162
  ✓ should throw if parameters are missed or wrong
162
- ✓ should move files from and to other datasets (1027ms)
163
+ ✓ should move files from and to other datasets (1018ms)
163
164
  ✓ should move the results of a find
164
165
 
165
166
  #Paste
166
167
  ✓ should return the help
167
- ✓ should paste the clipboard content to a new file (51ms)
168
- ✓ should paste the clipboard content to an existent file (71ms)
169
- ✓ should paste a single field to a yml card (63ms)
168
+ ✓ should paste the clipboard content to a new file (69ms)
169
+ ✓ should paste the clipboard content to an existent file (110ms)
170
+ ✓ should paste a single field to a yml card (67ms)
170
171
 
171
172
  #Pwd
172
173
  ✓ should return the help
@@ -180,7 +181,7 @@
180
181
  ✓ should delete a file with one version
181
182
  ✓ should delete many files usign wildcards
182
183
  ✓ should return errors if wrong parameters
183
- ✓ should delete some versions of a file (1011ms)
184
+ ✓ should delete some versions of a file (1008ms)
184
185
 
185
186
  #Shell
186
187
  ✓ should return the help
@@ -196,13 +197,13 @@
196
197
 
197
198
  #Totp
198
199
  ✓ should return the help
199
- ✓ should totp a file to the clipboard (365ms)
200
- ✓ should read a totp secret from an image and add the totp field to the card (50ms)
201
- ✓ should read a totp secret from an image and return the secret
200
+ ✓ should totp a file to the clipboard (360ms)
201
+ ✓ should read a totp secret from an image and add the totp field to the card (68ms)
202
+ ✓ should read a totp secret from an image and return the secret (54ms)
202
203
  ✓ should throw if bad image
203
204
  ✓ should throw if missing parameters
204
- ✓ should throw if the yaml is malformed
205
- ✓ should read a totp secret from the clipboard (87ms)
205
+ ✓ should throw if the yaml is malformed (45ms)
206
+ ✓ should read a totp secret from the clipboard (310ms)
206
207
 
207
208
  #Touch
208
209
  ✓ should return the help
@@ -225,7 +226,7 @@ New file "/folder2/file1" created.
225
226
 
226
227
  #Whoami
227
228
  ✓ should return the help
228
- ✓ should see who am I
229
+ ✓ should see who am I (38ms)
229
230
 
230
231
  #Help
231
232
  ✓ should return the help
@@ -234,7 +235,7 @@ New file "/folder2/file1" created.
234
235
  ✓ should return the help
235
236
  ✓ should join a chat with user0x
236
237
  ✓ should join a chat with user0x
237
- ✓ should jump between chats
238
+ ✓ should jump between chats (39ms)
238
239
  ✓ should return all the users
239
240
  ✓ should throw if contact not found or multiple chat
240
241
 
@@ -244,29 +245,44 @@ New file "/folder2/file1" created.
244
245
 
245
246
  #Quit
246
247
  ✓ should return the help
247
- ✓ should quit the chat, even if inside a room (51ms)
248
+ ✓ should quit the chat, even if inside a room (57ms)
248
249
 
249
250
  #Send
250
251
  ✓ should return the help
251
- ✓ should send a message to user0 (87ms)
252
+ ✓ should send a message to user0 (245ms)
252
253
 
253
254
  #Show
254
255
  ✓ should return the help
255
- ✓ should show history messages (369ms)
256
+ ✓ should show history messages (452ms)
256
257
 
257
258
 
258
- 166 passing (24s)
259
+ 166 passing (30s)
259
260
  1 pending
261
+ 1 failing
262
+
263
+ 1) #Import
264
+ should read a folder and import text and binary files:
265
+
266
+ AssertionError: expected 'Invalid count value' to equal 'Imported files:'
267
+ + expected - actual
268
+
269
+ -Invalid count value
270
+ +Imported files:
271
+
272
+ at assertConsole (/Users/francescosullo/Projects/Secrez/secrez/packages/test-helpers/src/index.js:121:16)
273
+ at Context.<anonymous> (test/commands/Import.test.js:331:5)
274
+
275
+
260
276
 
261
277
  -----------------------|---------|----------|---------|---------|-----------------------------------
262
278
  File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
263
279
  -----------------------|---------|----------|---------|---------|-----------------------------------
264
- All files | 71.22 | 58.41 | 71.25 | 71.11 |
280
+ All files | 71.26 | 58.57 | 71.25 | 71.15 |
265
281
  src | 59.63 | 54.79 | 55 | 60.19 |
266
282
  Command.js | 79.66 | 78.72 | 76.92 | 81.03 | 32,55-62,73,80,119
267
283
  PreCommand.js | 21.95 | 11.54 | 14.29 | 21.95 | 8-99,116
268
284
  cliConfig.js | 100 | 100 | 100 | 100 |
269
- src/commands | 81.53 | 67 | 89.95 | 81.4 |
285
+ src/commands | 81.57 | 67.18 | 89.95 | 81.43 |
270
286
  Alias.js | 90.54 | 77.36 | 100 | 90.41 | 101,112,139,169,173,180,190
271
287
  Bash.js | 75 | 0 | 66.67 | 75 | 18-19
272
288
  Cat.js | 98.9 | 88.89 | 100 | 98.9 | 152
@@ -278,7 +294,7 @@ All files | 71.22 | 58.41 | 71.25 | 71.11 |
278
294
  Courier.js | 63.54 | 41.86 | 85.71 | 63.83 | ...37,152-171,188,200-203,215-221
279
295
  Ds.js | 92.54 | 82.05 | 100 | 92.42 | 99,108-113,125
280
296
  Edit.js | 13.58 | 0 | 40 | 13.58 | 88-214
281
- Export.js | 87.63 | 67.74 | 100 | 87.63 | ...66,175,182-186,191,203,212,215
297
+ Export.js | 88.12 | 70.59 | 100 | 88.12 | ...75,185,197-201,206,218,227,230
282
298
  Find.js | 93.59 | 86.67 | 100 | 93.42 | 101,164,200-203,209
283
299
  Help.js | 100 | 80 | 100 | 100 | 29
284
300
  Import.js | 93.2 | 85.48 | 100 | 93.14 | ...65,367,387,393,441,456-463,490
@@ -327,3 +343,4 @@ All files | 71.22 | 58.41 | 71.25 | 71.11 |
327
343
  HelpProto.js | 91.6 | 84.06 | 100 | 91.45 | 49,153-154,171-176,195
328
344
  Logger.js | 63.64 | 56.25 | 36.84 | 62.79 | ...37-49,57,65-69,74,84,88,93,105
329
345
  -----------------------|---------|----------|---------|---------|-----------------------------------
346
+  ELIFECYCLE  Test failed. See above for more details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "secrez",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "license": "MIT",
5
5
  "nyc": {
6
6
  "include": "src",
@@ -66,6 +66,11 @@ class Export extends require("../Command") {
66
66
  alias: "k",
67
67
  type: Boolean,
68
68
  },
69
+ {
70
+ name: "crypto-env",
71
+ alias: "C",
72
+ type: Boolean,
73
+ },
69
74
  ];
70
75
  }
71
76
 
@@ -106,6 +111,10 @@ class Export extends require("../Command") {
106
111
  "export my-wallet.yml -k",
107
112
  "it will export a private key from the entry to a keystore file. The fill will be named as the entry replacing the extension with '.keystore.json'. If in the entry there are more than one private_key, it will ask which one to export. If no '--password' is specified, it will ask for a password to encrypt the keystore file. The entry must be a valid card, with at least one 'private_key' field.",
108
113
  ],
114
+ [
115
+ "export my-wallet.yml --crypto-env",
116
+ "it works like with keystore files, but it will export to file with .crypto.env extension ready to be used with @secrez/cryptoenv. Notice that the option -k has priority over -C.",
117
+ ],
109
118
  ],
110
119
  };
111
120
  }
@@ -140,7 +149,7 @@ class Export extends require("../Command") {
140
149
  if (Node.isBinary(entry) && typeof content === "string") {
141
150
  content = Crypto.bs64.decode(content);
142
151
  }
143
- if (options.keystore) {
152
+ if (options.keystore || options.cryptoEnv) {
144
153
  let card;
145
154
  try {
146
155
  card = yamlParse(content);
@@ -165,17 +174,23 @@ class Export extends require("../Command") {
165
174
  });
166
175
  privateKey = card[pk];
167
176
  }
177
+ let fileType = options.keystore ? "keystore" : "crypto-env";
168
178
  let pwd =
169
179
  options.password ||
170
180
  (await this.useInput({
171
181
  type: "password",
172
- message: "Type the password to encrypt the keystore file",
182
+ message: `Type the password to encrypt the ${fileType} file`,
173
183
  }));
174
184
  if (!pwd) {
175
185
  throw new Error("Operation canceled");
176
186
  }
177
- content = await encryptPrivateKeyAsKeystoreJson(privateKey, pwd);
178
- name = name.replace(/\.[^.]+$/, ".keystore.json");
187
+ if (options.keystore) {
188
+ content = await encryptPrivateKeyAsKeystoreJson(privateKey, pwd);
189
+ name = name.replace(/\.[^.]+$/, ".keystore.json");
190
+ } else {
191
+ content = await Crypto.encrypt(privateKey, Crypto.SHA3(pwd));
192
+ name = name.replace(/\.[^.]+$/, ".crypto.env");
193
+ }
179
194
  } else if (options.encrypt) {
180
195
  const myPublicKey = this.secrez.getPublicKey();
181
196
  if (options.publicKeys) {
@@ -80,31 +80,31 @@ class Touch extends require("../Command") {
80
80
  'touch -p afile --content "Password: 1432874565"',
81
81
  'touch ether -c "Private Key: eweiu34y23h4y23ih4uy23hiu4y234i23y4iuh3"',
82
82
  [
83
- "touch sample.txt -e",
84
- "Prompt the user to type the content of the file. The text cannot contain newlines. It will cut at the first one, if so. If '-e' and '-c' are both present, '-c' will be ignored.",
83
+ "touch sample.txt -w",
84
+ "Prompt the user to type the content of the file. The text cannot contain newlines. It will cut at the first one, if so. If '-w' and '-c' are both present, '-c' will be ignored.",
85
85
  ],
86
86
  [
87
87
  "touch walletPassword -n",
88
- "Prompt the user to type the password without showing it. Notice that '-n' has priority on '-e' and '-c'",
88
+ "Prompt the user to type the password without showing it. Notice that '-n' has priority on '-w' and '-c'",
89
89
  ],
90
90
  [
91
91
  "touch gilbert -f name -c 'Albert Goose'",
92
92
  "If the file does not exists, it creates 'gilbert.yaml' with the field 'name'. If a yaml file exists, it adds the field 'name' to it if the the field does not exist.",
93
93
  ],
94
94
  [
95
- "touch new-wallet -w",
95
+ "touch new-wallet -g",
96
96
  "Creates a new wallet file containing 'private_key' and `address`. Wallet has priority on other creation options.",
97
97
  ],
98
98
  [
99
- "touch new-wallets.yaml -w -n 3",
99
+ "touch new-wallets.yaml -g --amount 3",
100
100
  "Creates 'new-wallets.yaml', containing 3 wallet, calling them 'private_key', `private_key2` and `private_key3`, and relative addresses.",
101
101
  ],
102
102
  [
103
- "touch new-wallet --wallet -x trust0",
103
+ "touch new-wallet --generate-wallet -x trust0",
104
104
  "In combination con '-x', it creates a new wallet file calling the fields 'trust0_private_key' and 'trust0_address'.",
105
105
  ],
106
106
  [
107
- "touch new-wallets.yaml -wi",
107
+ "touch new-wallets.yaml -gi",
108
108
  "Includes the mnemonic. In this case, it will also add the fields 'mnemonic' (mnemonic phrase) and 'derived_path' (path used to generate the keys). ",
109
109
  ],
110
110
  ],