Git Product home page Git Product logo

Comments (24)

 avatar commented on June 24, 2024 1

To anyone else that comes across this from google and is using homebrew:

find $(brew --prefix) -type f -name lpass

Mine was in:

/usr/local/Cellar/lastpass-cli/1.0.0/share/bash-completion/completions/lpass

from lastpass-cli.

bcopeland avatar bcopeland commented on June 24, 2024

The one tricky thing about this is that we might not be able to look into the blob while logged out, so I guess we'd just fail to complete if the key is not available in the agent (rather than prompt). But generally, I agree it'd be a handy feature.

For another take on fuzzy matching see this pull request: #52 -- comments and/or patches welcome on what form that should take.

from lastpass-cli.

rothgar avatar rothgar commented on June 24, 2024

I think it would be OK to assume you need to be logged in with the agent running for this to work. I would probably just change my timeout env variable to make tab completion more useful

from lastpass-cli.

bcopeland avatar bcopeland commented on June 24, 2024

This needs some work (please feel free to hack on it!), but here is some basic completion support:

fd599fa

The patterns fed to grep aren't escaped properly, so e.g. completing on "(" doesn't work correctly.

from lastpass-cli.

RowanKaag avatar RowanKaag commented on June 24, 2024

Is this merged yet? Doesn't seem to work on OSX 10.11.1

from lastpass-cli.

bcopeland avatar bcopeland commented on June 24, 2024

No, it is still unmerged, and still somewhat broken due to improper escaping.

from lastpass-cli.

bcopeland avatar bcopeland commented on June 24, 2024

Merged now.

from lastpass-cli.

RowanKaag avatar RowanKaag commented on June 24, 2024

excuse my (probably stupid) question, but in what context was the merge supposed to work? I might be entering wrong commands to try the autocomplete, but typing lpass log; and then pressing tap, isn't that supposed to autocomplete to login?

from lastpass-cli.

bcopeland avatar bcopeland commented on June 24, 2024

You need to load it into your bash session, e.g.:

source contrib/lpass_bash_completion

from lastpass-cli.

RowanKaag avatar RowanKaag commented on June 24, 2024

I've installed via Homebrew, which lpass returns /usr/local/bin, can't find any shell scripts in there. Nor can I find any in /usr/local/Cellar/. Any idea how I could add a line in .zshrc to make it a default for every new shell?

from lastpass-cli.

bcopeland avatar bcopeland commented on June 24, 2024

It's in the github repository; as I didn't do the homebrew build, I'm not sure where it might have contrib scripts.

If you are using zsh, it probably will not work for you. If using bash, you could just add the source /path/to/lpass_bash_completion to your ~/.bashrc. Unfortunately I don't use zsh so I don't know much about how completion works for it.

from lastpass-cli.

samhh avatar samhh commented on June 24, 2024

@timja This worked for me with 1.0.0, but on 1.1.1 there's no bash-completion directory. Just me or you as well?

from lastpass-cli.

timja avatar timja commented on June 24, 2024

@samhh Missing for me to. I hadn't noticed because the brew update kept around the old version

$ find $(brew --prefix) -type f -name lpass
/usr/local/Cellar/lastpass-cli/1.0.0/bin/lpass
/usr/local/Cellar/lastpass-cli/1.0.0/share/bash-completion/completions/lpass
/usr/local/Cellar/lastpass-cli/1.1.1/bin/lpass

from lastpass-cli.

bcopeland avatar bcopeland commented on June 24, 2024

from lastpass-cli.

timja avatar timja commented on June 24, 2024

I believe the location it should actually be going into is:

 $(brew --prefix)/etc/bash_completion.d

from lastpass-cli.

ssalonen avatar ssalonen commented on June 24, 2024

There was some discussion for zsh autocompletion.

For the record, bash completions are supported in zsh using bashcompinit. For more information, consult these instructions:

https://stackoverflow.com/questions/3249432/i-have-a-bash-tab-completion-script-is-there-a-simple-way-to-use-it-from-zsh

For me the following seems to work in ~/.zshrc (fedora installation)

# support bash autocompletion
# https://stackoverflow.com/questions/3249432/i-have-a-bash-tab-completion-script-is-t
autoload bashcompinit
bashcompinit

if [[ -f /usr/share/bash-completion/completions/lpass ]]; then
        source /usr/share/bash-completion/completions/lpass
fi

from lastpass-cli.

rderik avatar rderik commented on June 24, 2024

Just as an FYI, I got my pull-request to the Homebrew formula for lastpass-cli to now install bash_completion and completion for fish by default when you install it.

So if you have already installed lastpass-cli you'll have to manually reinstall because the version of the formula wasn't changed.

Homebrew/homebrew-core#24745 (comment)

Hope that helps

from lastpass-cli.

tbigueres avatar tbigueres commented on June 24, 2024

Hi @bcopeland

Any news on this ?
I have the same issue, on mac OS High Sierra and lastpass CLI 1.3.0.

Is there any way to get auto-completion for mac ?
Thanks

from lastpass-cli.

rderik avatar rderik commented on June 24, 2024

Hi @tbigueres,

If you install it through homebrew you should now have the auto-completion by default.

If you previously had lastpass cli installed the version didn't change so it doesn't apply if you do a update you'll have to manually uninstall and reinstall it again for it to get the auto-completion.

Have you tried that?

from lastpass-cli.

tbigueres avatar tbigueres commented on June 24, 2024

Hey @rderik

Thanks for the quick answer.
Indeed I tried

brew reinstall lastpass-cli

But it did not work. I still cannot use autocompletion.
If you have any idea it would be awesome.

from lastpass-cli.

rderik avatar rderik commented on June 24, 2024

I just try it now I did:
brew uninstall lastpass-cli
then
brew install lastpass-cli
Then open a new bash terminal and
lpass log[tab]
and got
login logout

What version of bash are you on?
echo $BASH_VERSION

from lastpass-cli.

tbigueres avatar tbigueres commented on June 24, 2024

I'm on ZSH,
A colleague of mine has the same issue and is on the following bash :

echo $BASH_VERSION 3.2.57(1)-release

from lastpass-cli.

tbigueres avatar tbigueres commented on June 24, 2024

I tried again the brew uninstall and reinstall, but still nothing happens.
@rderik

from lastpass-cli.

rderik avatar rderik commented on June 24, 2024

Oh yea,

When I did the new formula I didn't include the zsh autocomplete, only bash and fishshell :S
That's why is not working for you on zsh. I'll have to check if there is a zsh autocomplete and add it to the formula and ask for a pull request for it. I'll update you if I figure that out.

And for your friend it might be a good idea to update his bash, that is an outdated bash maybe the autocomplete only works on newer versions you can ask him to try a newer version of bash the one in homebrew is: 4.4.12 tell him to try that one and let me know if it works for him.

from lastpass-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.