near / near-cli

General purpose command line tools for interacting with NEAR Protocol
https://docs.near.org
MIT License
193 stars 92 forks source link

--keyPath option removed #1103

Open wackazong opened 4 months ago

wackazong commented 4 months ago

Describe the bug It seems the --keyPath option was removed silently from near-cli

To Reproduce Using the option is not recogized by near-cli, it was removed from the code

Expected behavior Either document this as a change, or preferrably, bring it back.

gagdiez commented 4 months ago

where did you find this documented? I did not see it in our docs or the README here

wackazong commented 4 months ago

https://github.com/near/near-cli/commit/8895ea7a45d5af192c938fa3718ca2ebc0460899#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L1331

For me it was rather useful in scripted deployments using bash process substitution and sourcing the key json from 1Password.

gagdiez commented 4 months ago

I removed --keypath and added near add-credentials. This is because near-cli / near-api-js already have a simple logic to handle key-stores, and options such as --keypath makes us need to handle different cases.

Do you think you could use near add-credentials to import the key into near-cli?

wackazong commented 4 months ago

Storing the credentials unencrypted on disk is a security issue IMHO. I would prefer --keyPath. Or, even better, an env var that can be used to supply the private key.

gagdiez commented 4 months ago

ok, I think I have a simple way to bring this back, and we can use env vars to make it clean. Give me some time to code it and will ping you back.