Skip to content

Instantly share code, notes, and snippets.

@whi-tw
Created October 23, 2019 15:07
Show Gist options
  • Save whi-tw/4baa367bfcba4fba2b483e490119b3cd to your computer and use it in GitHub Desktop.
Save whi-tw/4baa367bfcba4fba2b483e490119b3cd to your computer and use it in GitHub Desktop.
mykman - a dummy ykman to get 2fa codes from pass
---
some-aws-account: amazon.com/totp
some-github-account: github.com/totp
#!/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