Latchkey for developers

Everything you can script: the latchkey command-line tool, the references your files hold, the protocol the tool speaks to the app, and how to put agents and MCP servers behind it.

The pieces

How it fits together
latchkey (CLI)
   │  JSON over a Unix socket
   ▼
Broker (in the app) ──► iCloud Keychain
   ├─ approval panel, then Touch ID
   ├─ grants: keychain, this Mac only
   ├─ access log: access.jsonl (never values)
   └─ remote pushes: vercel, gh, railway, flyctl,
      or the services' APIs with a token item

Where to start

Quickstart
Install the tool, import an env file, run a command, grant a folder.
CLI reference
Every command and option, environment variables and exit codes.
Agents and MCP
Instructions for coding agents, narrower grants, keys an agent can use without reading, rotation after a session, SSH, and Latchkey’s MCP server.
References and API
The reference formats, the broker protocol, the access log, and the files Latchkey keeps.

Item IDs

An item is either shared, NAME, or belongs to one environment of a project, project/environment/NAME. Each part is letters, digits, _, - and ., at most 64 bytes. For an item, the ID is the only place its project and environment are stored.

Environments can be any name; development, preview, staging, production and test sort first. Use names like vercel.preview to tell apart the same environment in different places.

KindForMasked in output
tokenAPI tokens and keys, one lineYes
passwordPasswords and connection strings, one lineYes
keyKey material: SSH, GPG, .p8, .pem. Multi-lineYes, line by line
valueNot secret: host names, account IDsNo

What’s released without asking

A read is released without a prompt only when the item is agent-safe (No Approval in the app), or a grant covers the folder, session and command as applicable. Allow Once authorizes one request; approvals are not cached. Revoking a grant stops future reads through it, but cannot recall released values. Everything else shows the approval panel, then Touch ID, Apple Watch or your password. Earlier values always ask. Changes (set, update, delete, move, import, restore, push) always ask, once per request: the Touch ID sheet alone, with the panel behind its Details… button (pushes show the panel first).