kp:// references
A kp:// reference says where a value lives in a vault, never the value, so a file of references can be committed. keypaste run resolves each one when it starts a command.
| Form | Names |
|---|---|
kp://<project>/<stage>/<KEY> | One variable of one stage of an environment, such as kp://acme-api/staging/DATABASE_URL. |
kp:///<group>/<title>#<field> | One field of one item, by its group and title. Without #<field> it names the password. |
Every character other than letters, digits, -, ., _ and ~ is percent-encoded, so a reference holds no space, quote or separator of its own, and a title holding / stays one segment.
.env.keypaste
Section titled “.env.keypaste”A .env.keypaste is a .env whose values are references:
keypaste env export acme-api -p staging > .env.keypasteDATABASE_URL=kp://acme-api/staging/DATABASE_URLThe desktop app’s Environments writes the same file with Edit › Export .env.keypaste…. Run with it:
keypaste run --env-file .env.keypaste -- npm start- Every reference resolves, or nothing starts.
- A line whose value is not a reference passes through as written. Those literal values are listed before the vault opens, because a cloned repository’s file can set a value such as
HTTPS_PROXY. - With no environment and no
--env-file,keypaste runuses the.env.keypastein the folder the app saved for an environment, and only when it names nothing but that environment’s variables.
Elsewhere
Section titled “Elsewhere”- An agent’s
runtool takes references in itsenv(The bridge and its tools). keypaste sharetakes a reference in place of an item, and shares the field it names (Share links).
A reference file is only as trustworthy as whoever wrote it: read a cloned repository’s .env.keypaste before you run with it (THREATS T-31).