References

capy:// references

A reference is a pointer, not a secret. It names where a credential lives; the value stays in the Keychain and never travels with it. That makes a reference safe to commit, safe to paste into a README, and safe to hand to an AI agent.

Grammar

text
capy://platform[/group][#field]

Three segments answering three questions, each present only when it is needed:

platform — which provider. Always present.

/group — which key, when a provider has more than one. Anthropic keys in both General and TEH GREP need capy://anthropic/general.

#field — which value, when a key holds more than one. CoinGecko's two fields are capy://coingecko#coingecko_api_key and capy://coingecko#coingecko_secret_key.

bash
capy://figma                            # unique provider, one field
capy://anthropic/general                # provider has keys in several groups
capy://coingecko#coingecko_secret_key   # key has several fields
capy://github/work#personal-access-token

When General is written out

General is the default bucket for keys you never assigned a group. While a vault has no other groups, it is left implicit — capy://openai.

The moment the vault contains any real group, General is written out even for a provider with a single key. Once you are organising with groups, a bare reference reads as “I forgot the group” rather than “deliberately ungrouped”, and the difference matters when someone else reads it.

bash
# A vault with no groups at all
capy://openai

# The same key, once any other key has a group
capy://openai/general

This changes only what Capykeys emits. Both forms still resolve, so nothing already written stops working.

Matching is forgiving

Case is ignored, and space, hyphen and underscore are treated as the same separator — so capy://nasa-api resolves a key stored as NASA API. References are emitted lowercased with spaces as hyphens, and the tidy form round-trips.

Resolution fails closed

Matching is exact — no substring or prefix fallback — and an ambiguous reference is an error, never a guess. It tells you what to add:

bash
capy resolve capy://anthropic
# Error: 'anthropic' is ambiguous — add a group to the reference.
#        Groups: General, TEH GREP.

capy ref coingecko --field nope
# Error: CoinGecko (Cheapass) has no field 'nope'.
#        Fields: COINGECKO_API_KEY, COINGECKO_SECRET_KEY.

A reference that resolves today cannot silently start resolving to a different key. If a newly added key makes an old reference ambiguous, it errors rather than picking one.

Where they go

.env — safe to commitbash
OPENAI_API_KEY=capy://openai/general
STRIPE_SECRET_KEY=capy://stripe#secret-key
bash
# Resolved into the child environment only, behind Touch ID.
capy run --env-file .env -- npm run dev

In the menu bar app, hold Option over any key to swap the copy action for its reference — the row relabels itself so you can see what you will get before you click.

A reference is inert on its own

Copying one takes no Touch ID and reads nothing from the Keychain, because there is nothing secret about it. Resolving one — on your machine, with your fingerprint — is the only step that touches a value.