lastpass / lastpass-cli

LastPass command line interface tool
GNU General Public License v2.0
2.85k stars 290 forks source link

Using CLI with Bash Script periodically works #641

Closed JR-TFT closed 10 months ago

JR-TFT commented 1 year ago

The CLI does not seem to sync/push to the server when you running commands with a script. I have been testing pretty much all day and have not found any consistency using 'lpass share create SHARE'. I have ran the same script over and over, never receiving the same results. Output from the CLI informs me that "Folder Shared-00 'FOLDERNAME'" was created every time I run the script, however the folder is rarely (if ever) created.

An example of the script I am running is below. I call this script from powershell with the command wsl "pathToScript" "folderName"

#!/bin/sh

folderpath=$1

lpassCreateStoreFolder(){
    lpass share create "$folderpath"
}

lpassLogin(){    
    echo 'myPasswordHere' | LPASS_DISABLE_PINENTRY=1 lpass login --trust --force test@test.com
}

lpassLogin
lpassCreateStoreFolder

Am I doing something wrong here? Calling lpass sync rarely works either, usually just hangs and waits until I cancel the process.

JR-TFT commented 1 year ago

A little over a month later, this script runs with no problems??

Not really sure what is supposed to be going on with this interface at this point. I have made no edits or changes to the script above, but now my Shared Folder is being created in my vault like I expect when I run this script.

While the lpass share create "$folderpath" command works in scripts now, the lpass edit command does not work within a script all of the sudden. The Admin Console shows a log for "Change Site" from myself, but the changes are never reflected in the vault.

If anyone could provide some feedback on this that would be great. Like I said above I really don't know what is going on here now. At first I was going to draw it up to the lpass share create command just not working fully in scripts, but now I am experiencing the same issues with a different command. Do some commands just not work on certain days? The inconsistencies about whether the command is going to work within a script or not is frustrating to say the least