Signing back into the Community for the first time? You'll need to reset your password to access your account.  Find out more.

Forum Discussion

cliKing's avatar
cliKing
Occasional Contributor
3 years ago

Feature request: add --fields flag to "op item create"

When I create an item with op item create --generate-password, I would like to get the generated password.

op item get has --fields flags to select the output, but op item create doesn't.


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser:_ Not Provided

  • andi_t_1P's avatar
    andi_t_1P
    Icon for 1Password Team rank1Password Team

    Hi cliKing , thanks for your message! op item create allows for adding custom field assignments using the following syntax:


    op item create --category=login --title='My Example Item' --vault='Test' \
    --url https://www.acme.com/login \
    --generate-password=20,letters,digits \
    username=jane@acme.com \
    'Test Field 1=my test secret' \
    'Test Section 1.Test Field2[text]=Jane Doe' \
    'Test Section 1.Test Field3[date]=1995-02-23' \
    'Test Section 2.Test Field4[text]='$myNotes

    When running op item create --category login --title 'myLogin' --generate-password a 32-length random password will be generated and assigned to the password field specifically. In order to get the password you would then need to run op read op://Private/myLogin/password.

    Hope this helps,
    Andi