Created
October 23, 2019 15:07
-
-
Save whi-tw/4baa367bfcba4fba2b483e490119b3cd to your computer and use it in GitHub Desktop.
mykman - a dummy ykman to get 2fa codes from pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
some-aws-account: amazon.com/totp | |
some-github-account: github.com/totp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'yaml' | |
config = YAML.load_file(ENV['HOME'] + '/.mykman.yml') | |
def list(*, config) | |
config.each do |item, _pass_path| | |
puts item | |
end | |
end | |
def code(args, config) | |
puts "#{args[0]} #{`pass otp #{config[args[0]]}`}" | |
end | |
send(ARGV[1], ARGV.drop(2), config=config) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment