Org Secrets Management
Manage organization-wide secrets shared across every Primitive Function from the terminal, without redeclaring the same credential on each deploy.
Org secrets are credentials shared across your organization's Primitive Functions rather than bound to a single function. Reach for them when two or more functions need the same value (an LLM API key, a shared token) and you want one place to rotate it.
This page covers the primitive org-secrets-* command group. Per-function secrets, deploy flags, and routing live in Primitive Functions: Deploy, Route, and Manage.
Prerequisites#
You need the CLI installed and an authenticated session before any org-secrets-* command will work.
- 1
Install the CLI#
npm install -g primitiveOr run it without installing:
npx primitive@latest org-secrets-list - 2
Confirm you're authenticated#
primitive whoamiIf this fails, sign in with
primitive loginorprimitive signin, or setPRIMITIVE_API_KEYin your environment. See Authentication: login, signup, logout, whoami.
Discover the exact flags#
Run the command's own help to get the authoritative flag and argument surface, which the CLI generates from the API:
primitive org-secrets-set --help
primitive org-secrets-list --help
primitive org-secrets-remove --help
Per-command help carries enough detail to compose any operation without leaving the terminal, so treat it as the reference for argument order and optional flags.
Set an org secret#
primitive org-secrets-set writes a key-value secret at the organization scope, creating it or overwriting an existing value.
primitive org-secrets-set OPENAI_API_KEY "$OPENAI_API_KEY"
Secret keys follow the same convention as function secrets: uppercase letters, digits, and underscores, with the first character a letter or underscore (^[A-Z_][A-Z0-9_]*$).
Read the value from your own environment rather than typing it inline, so the secret never lands in shell history or the process list. The CLI uses the same pattern for wallet keys with PRIMITIVE_X402_PRIVATE_KEY.
List org secrets#
primitive org-secrets-list prints the org secrets currently configured, so you can audit what's set before a deploy or confirm a rotation landed.
primitive org-secrets-list
Remove an org secret#
primitive org-secrets-remove deletes an org secret by key.
primitive org-secrets-remove OPENAI_API_KEY
Removal affects every function that reads the key. Re-run primitive org-secrets-list afterwards to confirm, and redeploy or re-check any function that depended on it.
Next steps#
Deploy functions and manage per-function secrets alongside shared org secrets.
What is the Primitive CLI?See how the org-secrets command group fits into the CLI's full command surface.
Primitive Functions and Recipient Routing (Platform Concepts)Understand how functions consume secrets and routes at runtime.
Authentication: login, signup, logout, whoamiSet up the CLI credentials required before managing org secrets.
Was this page helpful?