How to access Keychain of my user from cron? security list-keychains print:

"/Users/vitaly-zdanevich/Library/Keychains/login.keychain-db"
"/Library/Keychains/System.keychain"


but the same command from cron return:

"/Library/Keychains/System.keychain"
"/Library/Keychains/System.keychain"


from cron I tried

security default-keychain -s "/Users/vitaly-zdanevich/Library/Keychains/login.keychain-db &amp;&amp; security list-keychains"


but result is the same.

In the help of cli-utility security I did not found any other way to explicitly set the path to the db.

Yes I know that Apple says that better way is to use launchd instead of cron, but I сurious to know - it is possible to manipulate my Keychain from cron?
Read the --help of the command that you intended to use:

$ security delete-generic-password --help
delete-generic-password: illegal option -- -
Usage: delete-generic-password [-a account] [-s service] [options...] [keychain...]
    -a  Match "account" string
    -c  Match "creator" (four-character code)
    -C  Match "type" (four-character code)
    -D  Match "kind" string
    -G  Match "value" string (generic attribute)
    -j  Match "comment" string
    -l  Match "label" string
    -s  Match "service" string
If no keychains are specified to search, the default search list is used.
        Delete a generic password item.


so the solution is:

* * * * * security delete-internet-password -l 'git-codecommit.us-east-1.amazonaws.com' '/Users/vitaly-zdanevich/Library/Keychains/login.keychain-db'

last arg string - is it the path to the Keychain db.