{"id":20898114,"url":"https://github.com/aheissenberger/keychain-macos","last_synced_at":"2026-04-11T17:02:14.308Z","repository":{"id":57687111,"uuid":"479513906","full_name":"aheissenberger/keychain-macos","owner":"aheissenberger","description":"Set and Get Notes from the macOS keychain","archived":false,"fork":false,"pushed_at":"2023-04-15T19:39:13.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-21T21:53:49.792Z","etag":null,"topics":["deno","javascript","macos"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aheissenberger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-08T19:26:11.000Z","updated_at":"2023-01-20T09:42:54.000Z","dependencies_parsed_at":"2024-11-15T19:51:36.449Z","dependency_job_id":"b37f7260-0098-42ac-8e7a-763ef996a709","html_url":"https://github.com/aheissenberger/keychain-macos","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"34cf77144c7394caf83c699787cbbddeb26c4014"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/aheissenberger/keychain-macos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheissenberger%2Fkeychain-macos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheissenberger%2Fkeychain-macos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheissenberger%2Fkeychain-macos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheissenberger%2Fkeychain-macos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aheissenberger","download_url":"https://codeload.github.com/aheissenberger/keychain-macos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheissenberger%2Fkeychain-macos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31687881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","javascript","macos"],"created_at":"2024-11-18T11:08:53.546Z","updated_at":"2026-04-11T17:02:14.291Z","avatar_url":"https://github.com/aheissenberger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# keychain-macos\n\n\u003e Set and Get Notes from the macOS keychain with the command line utility `security`.\n\n**Requires the `--allow-env` and `--allow-run` flags**\n\n## Usage\n\n**NPM**\n```js\nimport { deleteNote, getNoteTXT, setNote } from \"keychain-macos\"\n```\n\n**Deno**\n```js\nimport { deleteNote, getNoteTXT, setNote } from 'https://deno.land/x/keychain_macos/mod.ts'\n```\n\n```js\nawait setNote({ name:\"keychain-macos-test\", data:{key: 1} });\n\nconst result = await getNoteTXT(\"keychain-macos-test\");\n\n\nawait deleteNote(\"keychain-macos-test\");\n```\n\n## API\n\n### setNote({name,data},update)\n\nInsert a new note to macOS keychain.\n\n**name:** _string_ - Name of the item\n**data:** _object_ | _string_ | _number_\n**update:** _boolean_ - if update is true, an existing entry will be replaced - Default: FALSE\n\nObjects are converted to JSON. String and Number will converted with `.toString()`\n\n**Errors:**\n\n* If you try to insert and update is FALSE and the note exists `Deno.errors.AlreadyExists`is thrown.\n\n### getNoteTXT(name)\n\nFind a Note with the name `name` in the macOS keychain. The data in the note is expected to be Text.\n\n**Errors:**\n\n* If a Note is not found a `Deno.errors.NotFound` is thrown.\n### getNoteRTF(name)\n\nFind a Note with the name `name` in the macOS keychain.\nData pasted into the keychain App is allways saved as RTF data und needs to be converted back to a text only representation.\n\n**Errors:**\n\n* If a Note is not found a `Deno.errors.NotFound` is thrown.\n\n### deleteNote(name)\n\nDelete a note by name.\n\n**Errors:**\n\n* If a Note is not found a `Deno.errors.NotFound` is thrown.\n\n## Tipps\n\nTo avoid RTF when manual adding credentials you can use this simple bash script which will add the current content of the clippboard.\n\n\n```sh\n#!/bin/sh\nnotename=\"$1\"\nif [ -z $notename ]; then\necho \"\"\n    echo \"$0: \u003cname of note\u003e [-U]\"\n    echo \"\\tThe content of the clipboard will be used for the note body.\"\n    echo \"\\t-U: with this an update of an existing note will fail\"\n    echo \"\"\n    exit 1\nfi\nsecurity add-generic-password -a $USER -s \"$1\" $2 -C note -X \"$(pbpaste| xxd -ps -c 0)\"\n```\n\n`pb2keychain.sh test66`\n\n\u003e will only create a note if the note does not exist - use `-U` to overwrite as existing note!\n\n## Build for NPM\n\n```sh\ndeno task npm:build \u003cnew version\u003e\ncd npm\nnpm publish\n```\n\n## Authors\n\n[Andreas Heissenberger](https://github.com/aheissenberger)\n\n## Version History\n\n* 0.1.0\n    * Initial Release\n* 0.1.1\n    * add Option `update` on `setNote()` to replace existing note\n    * add Error handling\n* 0.1.2-0.1.6\n    * changes to publish on NPM\n## License\n\nThis project is licensed under the \"bsd-2-clause\" License - see the LICENSE.txt file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faheissenberger%2Fkeychain-macos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faheissenberger%2Fkeychain-macos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faheissenberger%2Fkeychain-macos/lists"}