Open Luke-Williams9 opened 1 year ago
oneTimeCode
can be passed as an option
parameter:
option=['f.oneTimeCode=otpauth://totp/?secret=DFGFDGFDGFDG']
This command is deprecated.
Commander has another command for adding records record-add
or record_edit. RecordAddCommand
https://docs.keeper.io/secrets-manager/commander-cli/command-reference/record-commands#record-add-and-record-update-commands
Command
record-add --record-type=login --title='Record Title' --notes='a\nb\nc\nd' --folder="Folder Name" login=email@company.io password=$GEN url=https://google.com oneTimeCode=otpauth://totp/?secret=DFGFDGFDGFDG "Custom Field"="Custom Value"
uses the following parser
record_add_parser = argparse.ArgumentParser(prog='record-add', description='Add a record to folder.')
record_add_parser.add_argument('--syntax-help', dest='syntax_help', action='store_true',
help='Display help on field parameters.')
record_add_parser.add_argument('-f', '--force', dest='force', action='store_true', help='ignore warnings')
record_add_parser.add_argument('-t', '--title', dest='title', action='store', help='record title')
record_add_parser.add_argument('-rt', '--record-type', dest='record_type', action='store', help='record type')
record_add_parser.add_argument('-n', '--notes', dest='notes', action='store', help='record notes')
record_add_parser.add_argument('--folder', dest='folder', action='store',
help='folder name or UID to store record')
record_add_parser.add_argument('fields', nargs='*', type=str,
help='load record type data from strings with dot notation')
can be translated to this code
command = record_edit.RecordAddCommand()
record_uid = command.execute(
connect_params,
record_type = 'login',
title = 'Record Title',
notes = 'a\nb\nc\nd',
folder='Folder Name',
fields=['login=email@company.io', 'password=$GEN',
'url=https://google.com',
'oneTimeCode=otpauth://totp/?secret=DFGFDGFDGFDG',
'"Custom Field"="Custom Value"'],
force = True
)
RecordAddCommand isn't adding an OTP code, is it possible or should I be looking at import functions instead?
here's my function. I've tried using oneTimeCode as a parameter, as well as passing a custom field "TFC:Keeper" to RecordAddCommand, and neither work.