The 1Password Community forums are in read-only mode from Jan 28th - Feb 4th, 2025. Find out more.

Insert a new password item via scripting or other means?

sensedatum
sensedatum
Community Member

I have a shell script that builds logins (name/password combos). What I'd like to do is have the script somehow insert those into 1Password programmatically so they are saved if I have to look them up later. I don't see a scripting dictionary nor an obvious x-url to make that happen. I suppose I could dig through the file specification, but I'd rather not if I can avoid it (and I'm not sure how supported that would be). Is there a way I'm missing? Maybe talking to 1password mini through http?

To be clear, I'm not trying to extract information, I'm trying to insert it. Thanks.


1Password Version: 5.3
Extension Version: Not Provided
OS Version: 10.10.x
Sync Type: Not Provided

Comments

  • MrC
    MrC
    Volunteer Moderator

    Hi @sensedatum,

    Yes, this can be done, by way of creating a 1Pif file and doing an Import. I have a suite of converters that provides a means. If you format your data as simple CSV, you can use on of the existing converters to get something functioning quickly.

    You can reply here, or contact me offline if you want more help. My email is at the top of the script.

  • Drew_AG
    Drew_AG
    1Password Alumni

    Hi @sensedatum,

    I hope MrC's information was helpful! I'm sure he'll be happy to help if you have more questions about that (or maybe you've already contacted him).

    If you have more questions or need anything else, be sure to let us know - we're always happy to help. :)

  • sensedatum
    sensedatum
    Community Member
    edited September 2015

    @MrC - thanks for your response. I poked around with your converters - that's a lot of work, thank you. My perl is super rusty, but it appears that, in the end, you have to eventually have the user (me) click File->import of the 1Pif file. Correct? Or did I miss something? I was hoping there was a way for me to automate the whole thing away. I'd rather a way to directly tell 1P about my request, but writing to file then telling 1P to import it programmatically would be an acceptable work around. It's not super critical, just a nice to have. Thanks.

  • MrC
    MrC
    Volunteer Moderator
    edited September 2015

    @sensedatum ,

    You don't have to know the Perl. I can tell you which existing converter will do the job for you, if you tell me the fields you need. I'll give you the field order and CSV requirements. A few of the converters will do the job.

    You can automate the process using AppleScript or Automater. Just create a script that does the conversion, launches 1Password if necessary, opens the File > Import dialog, selects the converted 1PIF file, and presses OK.

  • Hello @sensedatum,

    I'm super happy MrC is here as I'm pretty certain he can help in ways that might not come easily to us. He is a master at converting and understands the 1PIF better than many. Hopefully his suggestion of an Automater workflow or similar will help you achieve your end goal.

This discussion has been closed.