def gh_create_key(args):
    '''Usage: 
	gh create_key <title> [<public_key_path>]

Options:
	-h, --help   							This message

Examples:
	gh create_key ipad ~/.ssh/id_rsa.pub
	gh create_key ipad    (checks for ~/.ssh/id_rsa.pub, or creates new key if needed using ssh-keygen )
	'''
    title = args['<title>']
    default_keyfile = os.path.expanduser('~/.ssh/id_rsa.pub')
    if not args['<public_key_path>']:
        if not os.path.exists(default_keyfile):
            print('Creating a ssh key in ~/.ssh/')
            cmd_string = '''
			echo ssh-keygen -d rsa -b2048
			ssh-keygen -trsa -b2048
			'''
            _stash(cmd_string)
        args['<public_key_path>'] = default_keyfile
    #if private key, use pub key
    if not args['<public_key_path>'].endswith('.pub'):
        args['<public_key_path>'] += '.pub'
    if not os.path.exists(args['<public_key_path>']):
        raise Exception('Public Key file not found!')
    g, u = setup_gh()
    with open(args['<public_key_path>']) as pubkey:
        u.create_key(title, pubkey.read())
Usage: 
	gh create_key <title> [<public_key_path>]

Options:
	-h, --help   							This message

Examples:
	gh create_key ipad ~/.ssh/id_rsa.pub
	gh create_key ipad    (checks for ~/.ssh/id_rsa.pub, or creates new key if needed using ssh-keygen )
	
bin/gh.py