9 votes

A LastPass CLI, for you LastPass users who also heavily use a command line.

10 comments

  1. [10]
    Emerald_Knight
    (edited )
    Link
    Sometimes you have passwords stored that aren't used in your browser, e.g. when you're pushing your code changes to GitLab or GitHub over HTTPS rather than over SSH, so you don't get the benefit...

    Sometimes you have passwords stored that aren't used in your browser, e.g. when you're pushing your code changes to GitLab or GitHub over HTTPS rather than over SSH, so you don't get the benefit of password autofill. I found this pretty annoying, and a while back I found out that a CLI existed for LastPass. Now I have a bash function that I can call from the command line, which triggers a request for my LastPass password for authentication and immediately stores my GitLab password in my clipboard for quick use on success. I found this way more convenient than having to click through multiple times after opening up my LastPass vault through the browser or my phone, as I only have to do a quick $ functionName and enter my password.

    Granted, storing the password in memory through the clipboard like that isn't exactly ideal, but I find that to be less risky than having an insecure and easy to remember password that I can type in manually. Besides, if someone can gain access to my GitLab password via machine memory then they can probably snatch my SSH key without a problem or even set up a keylogger, and that would be far more catastrophic.

    3 votes
    1. [5]
      cfabbro
      (edited )
      Link Parent
      You are my hero! The LastPass browser extension has gone to absolute shit recently, so much so that I am looking for an alternative to switch to once my subscription runs out, but this solves so...

      You are my hero!

      The LastPass browser extension has gone to absolute shit recently, so much so that I am looking for an alternative to switch to once my subscription runs out, but this solves so many of my issues...

      The biggest one being having to click about 5 times now and wait for a bunch of bullshit to load just to access my damn stored passwords: click extension icon, open vault and wait for it to load, search for site/service, edit site/service, click show password + reenter my master password again, highlight the password manually then manually copy it to clipboard.

      It used to be you could at least access the stored passwords in the extension popup itself but now you can't anymore. Using the CLI will make this so much easier. Thank you. Thank you. Thank you.

      2 votes
      1. [4]
        Comment deleted by author
        Link Parent
        1. [3]
          cfabbro
          Link Parent
          I have not... I was mostly looking at KeePass (also opensource) but with a ton of feature plugins and the ability to host the vault database myself. But I will definitely add those to the list of...

          I have not... I was mostly looking at KeePass (also opensource) but with a ton of feature plugins and the ability to host the vault database myself. But I will definitely add those to the list of ones to check out when my LastPass subscription gets closer to ending. Thanks.

          1. [3]
            Comment deleted by author
            Link Parent
            1. [2]
              cfabbro
              Link Parent
              Heh, understandable why you wouldn't recommend it to most people. I like to think I am technically competent enough to use KeePass but even for me it's a bit of a scary proposition, especially...

              Heh, understandable why you wouldn't recommend it to most people. I like to think I am technically competent enough to use KeePass but even for me it's a bit of a scary proposition, especially with the potential of losing your entire password DB and getting locked out of all your accounts as a result. However I used to work in Data Recovery & Computer Forensics, so I am paranoid beyond paranoid when it comes to backups so I should be alright. ;)

              1 vote
              1. arghdos
                Link Parent
                I just sync my KeePas password database over Dropbox. It would require some real doing for me to lose it

                I just sync my KeePas password database over Dropbox. It would require some real doing for me to lose it

                1 vote
      2. Emerald_Knight
        Link Parent
        Haha, glad to hear that it'll remove a major pain point for you! I figured there would be at least one person who would find this to be a godsend :)

        Haha, glad to hear that it'll remove a major pain point for you! I figured there would be at least one person who would find this to be a godsend :)

        1 vote
    2. [4]
      Silbern
      Link Parent
      Thank you so much :D I will get a ton of use out of this. I don't like how annoying it is to look up some passwords in LastPass these days, as they broke the copy functionality, this will make my...

      Thank you so much :D I will get a ton of use out of this. I don't like how annoying it is to look up some passwords in LastPass these days, as they broke the copy functionality, this will make my life much easier. If I may ask though, where's the function? The link just goes to LastPass's official repo...

      1 vote
      1. [2]
        Emerald_Knight
        (edited )
        Link Parent
        Actually, screw it, for some reason it's bugging me that I'm not doing it now, so I'll do it now. I'm sure there's a better place to put the function, but I'm not really up to speed with best...

        Actually, screw it, for some reason it's bugging me that I'm not doing it now, so I'll do it now. I'm sure there's a better place to put the function, but I'm not really up to speed with best practices, so I just placed something like this in ~/.bashrc:

        function get_gitlab_password() {
            lpass show -cp gitlab.com
        }
        

        That's literally all there is to it (you need to update or restart your terminal before you can call it, of course). Minor adjustments may be necessary. The complexity is really just in installing and configuring the lastpass cli itself.

        3 votes
        1. [2]
          Comment deleted by author
          Link Parent
          1. Emerald_Knight
            Link Parent
            Yeah, that was my meaning by "update". It was after 1am and I had just worn myself out finishing up a day's worth of cleaning, though, so I wasn't entirely sure if I was remembering the command...

            Yeah, that was my meaning by "update". It was after 1am and I had just worn myself out finishing up a day's worth of cleaning, though, so I wasn't entirely sure if I was remembering the command correctly. Thanks for adding that here! :)

            1 vote
      2. Emerald_Knight
        Link Parent
        I'll try to remember to dig it up out of my work machine tomorrow and share it with you. It's fairly simple and straightforward from what I can remember, though!

        I'll try to remember to dig it up out of my work machine tomorrow and share it with you. It's fairly simple and straightforward from what I can remember, though!

        1 vote