Comments (24)
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.
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.
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.
This needs some work (please feel free to hack on it!), but here is some basic completion support:
The patterns fed to grep aren't escaped properly, so e.g. completing on "(" doesn't work correctly.
from lastpass-cli.
Is this merged yet? Doesn't seem to work on OSX 10.11.1
from lastpass-cli.
No, it is still unmerged, and still somewhat broken due to improper escaping.
from lastpass-cli.
Merged now.
from lastpass-cli.
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.
You need to load it into your bash session, e.g.:
source contrib/lpass_bash_completion
from lastpass-cli.
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.
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.
@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.
@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.
from lastpass-cli.
I believe the location it should actually be going into is:
$(brew --prefix)/etc/bash_completion.d
from lastpass-cli.
There was some discussion for zsh autocompletion.
For the record, bash completions are supported in zsh
using bashcompinit
. For more information, consult these instructions:
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.
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.
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.
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.
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.
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.
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.
I tried again the brew uninstall and reinstall, but still nothing happens.
@rderik
from lastpass-cli.
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)
- Engineering Opportunities at LastPass HOT 3
- Lpass CLI not able to write note record HOT 1
- Failed to enter correct password HOT 4
- deleteme
- Any update regarding support for this project? HOT 7
- Cannot login HOT 2
- Cannot change master password
- Windows: Automating CLI Login
- lpass extremely slow on MBP 16 inch M1 running MacOS 12.4 HOT 2
- Firewall settings/Whitelist
- Handle failed http requests better HOT 2
- No longer able to add entry from cli via the add command HOT 1
- Generate Password require numbers HOT 1
- Using CLI with Bash Script periodically works HOT 1
- Feature request. Allow OWASP FIPS-140 Password Iterations 310000 or more HOT 2
- Timestamps are off by several hours
- Question: what is the "id" for the `-i` flag in the lpass-att-export.sh script? HOT 2
- can't login "Error: Stream error in the HTTP/2 framing layer." HOT 4
- Fix folder separators
- Random lpass Error: Could not find decryption key
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lastpass-cli.