Automate codesigning with hardware token

I have my DeveloperID certificate in a hardware PIV token, and am able to sign code from the command line using the codesign utility.

Now I want to automate the process, but codesign throws up a dialog box asking for my PIN "Enter PIN to allow this."

How do I unlock the PIV token from the command line so this doesn't need a human in the loop?

Thanks!

Wby are you using auto code signing with a process that seems to scream for manual?

You may not have the flexibility you want when you allow the process to assume control. I'd switch to manual, and then put efforts into sorting that out, instead of getting into a cage match w/auto.
Automate codesigning with hardware token
 
 
Q