Authorize the OpenPMM CLI in a browser and select a Workspace.
Run the browser authorization flow. You do not need to create or copy an API
key.
openpmm auth login
The CLI opens OpenPMM in your browser. Sign in, choose a Workspace when your
account has more than one, and select Authorize CLI. The CLI creates a
full-access API key, stores it in a user-only file, and completes the command.
It never receives your browser cookie or password.For an agent-friendly flow, return authorization metadata immediately, then
resume after browser approval:
The JSON metadata includes sensitive: true because the one-time browser URL
authorizes this CLI. Treat the complete JSON result as a credential. The CLI
stores the device secret locally, and neither JSON response contains the device
secret or resulting API key.When a JSON command has no credential, the error has a null HTTP status and
includes these commands in its structured recovery object. The error is
local. OpenPMM did not receive an HTTP request.
Use --with-token only when you already have an API key. The normal browser
authorization is faster and keeps the key out of your clipboard.The CLI stores credentials in ~/.config/openpmm/credentials.json. On systems
with POSIX permissions, the directory is mode 0700 and the file is mode
0600. openpmm auth logout removes the local credential for the active API
origin. It does not revoke the key in OpenPMM.
The credential store is an internal CLI implementation detail. Agents and
scripts must not read, parse, copy, export, or reuse its API key. Use the
openpmm command for a CLI-managed workflow.
If you build a direct /v1 API integration, create a separate API credential
with the minimum required scopes. Keep it in your secret manager. Do not import
the CLI credential into an existing HTTP client.Create, rotate, and revoke API keys in the OpenPMM portal. These operations
require a recent browser session.
Treat an API key like a password. Do not put it in source control, command arguments, URLs, screenshots, or logs.
The browser flow stores the approved Workspace. If a key can access exactly
one Workspace, the CLI also discovers it automatically.
openpmm workspaces list --jsonopenpmm posts list
Pass a Workspace only when the key can access more than one:
export OPENPMM_WORKSPACE=ws_01JABCDEFopenpmm destinations list --json
--workspace has priority over OPENPMM_WORKSPACE and the Workspace stored by
browser authorization. The CLI never guesses when more than one Workspace is
available.
The production API is the default. Use --api-base-url or
OPENPMM_API_BASE_URL for an approved staging or self-hosted deployment.
openpmm workspaces list \ --api-base-url https://api.openpmm.com/v1 \ --json
The CLI validates the origin and /v1 path. It refuses private /api/...
routes and URLs that contain credentials.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"OpenPMM","description":"Official documentation for the OpenPMM social publishing API, hosted MCP server, and first-party @openpmm/cli package","colors":{"primary":"#C83F1D","light":"#FF9A3D","dark":"#D84420"},"logo":"https://mintcdn.com/open-pmm/Y4bqcTFv_MCkrIIC/logo/openpmm.png?fit=max\u0026auto=format\u0026n=Y4bqcTFv_MCkrIIC\u0026q=85\u0026s=cdc550716e5a29bb13424cc795a18490","favicon":"https://mintcdn.com/open-pmm/Y4bqcTFv_MCkrIIC/favicon.ico?fit=max\u0026auto=format\u0026n=Y4bqcTFv_MCkrIIC\u0026q=85\u0026s=da4a9698e6119ac0274a1d31b0dc1248","api":{"playground":{"display":"simple"}},"appearance":{"default":"system","strict":false},"navbar":{"primary":{"type":"button","label":"Login","href":"https://app.openpmm.com"}},"seo":{"organization":{"name":"OpenPMM","url":"https://www.openpmm.com","sameAs":["https://github.com/OpenPMM/cli","https://www.npmjs.com/package/@openpmm/cli"]},"indexing":"navigable","trailingSlash":false},"integrations":{"telemetry":{"enabled":false}},"contextual":{"options":["copy","view","chatgpt","claude","cursor"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"OpenPMM","icon":"house","href":"https://www.openpmm.com"},{"anchor":"Dashboard","icon":"grid-2","href":"https://app.openpmm.com"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"open-pmm","hasAudioNarration":false,"actualSubdomain":"open-pmm","customDomains":["www.openpmm.com"],"gitSource":{"type":"github","owner":"openpmm","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6adf6b44d7cf896c8ad89e52","collectionId":"07a2f178-b073-447c-8eae-951e7ea8443b","liveDeploymentHistoryId":"6adf6b44d7cf896c8ad89e52","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6adf6b44d7cf896c8ad89e52","clientVersion":"0.0.4021","searchFilterCounts":[{"language":"default","tag":"API reference","count":71},{"language":"default","tag":"Guides","count":29},{"language":"default","tag":"CLI","count":12},{"language":"default","tag":"Publishing guides","count":11},{"language":"default","tag":"Get started","count":10},{"language":"default","tag":"Media guidelines","count":10},{"language":"default","tag":"Posts","count":10},{"language":"default","tag":"Inbox","count":9},{"language":"default","tag":"Workflows","count":8},{"language":"default","tag":"Destinations","count":7}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"cli/authentication","slug":"/cli/authentication","pageMetadata":{"title":"Authenticate the CLI","sidebarTitle":"Authentication","description":"Authorize the OpenPMM CLI in a browser and select a Workspace.","href":"/cli/authentication"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Authorize the OpenPMM CLI in a browser and select a Workspace.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Run the browser authorization flow. You do not need to create or copy an API\nkey.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openpmm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` auth`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` login`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The CLI opens OpenPMM in your browser. Sign in, choose a Workspace when your\naccount has more than one, and select `,_jsx(_components.strong,{children:`Authorize CLI`}),`. The CLI creates a\nfull-access API key, stores it in a user-only file, and completes the command.\nIt never receives your browser cookie or password.`]}),`\n`,_jsx(_components.p,{children:`For an agent-friendly flow, return authorization metadata immediately, then\nresume after browser approval:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openpmm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` auth`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` login`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --no-wait`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openpmm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` auth`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` login`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --resume`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --json`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The JSON metadata includes `,_jsx(_components.code,{children:`sensitive: true`}),` because the one-time browser URL\nauthorizes this CLI. Treat the complete JSON result as a credential. The CLI\nstores the device secret locally, and neither JSON response contains the device\nsecret or resulting API key.`]}),`\n`,_jsxs(_components.p,{children:[`When a JSON command has no credential, the error has a `,_jsx(_components.code,{children:`null`}),` HTTP status and\nincludes these commands in its structured `,_jsx(_components.code,{children:`recovery`}),` object. The error is\nlocal. OpenPMM did not receive an HTTP request.`]}),`\n`,_jsx(Heading,{level:`2`,id:`use-an-environment-variable`,children:`Use an environment variable`}),`\n`,_jsxs(_components.p,{children:[`Use the environment for automation and one-time `,_jsx(_components.code,{children:`npx`}),` commands:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` OPENPMM_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`opm_live_`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`...`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openpmm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` accounts`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` show`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --json`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The environment has priority over a stored credential.`}),`\n`,_jsx(Heading,{level:`2`,id:`import-an-existing-api-key`,children:`Import an existing API key`}),`\n`,_jsx(_components.p,{children:`Send the key through stdin. The CLI does not accept an API key as a flag,\npositional argument, or URL.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`printf`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '%s'`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$OPENPMM_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` openpmm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` auth`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` login`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --with-token`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`unset`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` OPENPMM_API_KEY`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openpmm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` accounts`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` show`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`--with-token`}),` only when you already have an API key. The normal browser\nauthorization is faster and keeps the key out of your clipboard.`]}),`\n`,_jsxs(_components.p,{children:[`The CLI stores credentials in `,_jsx(_components.code,{children:`~/.config/openpmm/credentials.json`}),`. On systems\nwith POSIX permissions, the directory is mode `,_jsx(_components.code,{children:`0700`}),` and the file is mode\n`,_jsx(_components.code,{children:`0600`}),`. `,_jsx(_components.code,{children:`openpmm auth logout`}),` removes the local credential for the active API\norigin. It does not revoke the key in OpenPMM.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The credential store is an internal CLI implementation detail. Agents and\nscripts must not read, parse, copy, export, or reuse its API key. Use the\n`,_jsx(_components.code,{children:`openpmm`}),` command for a CLI-managed workflow.`]})}),`\n`,_jsxs(_components.p,{children:[`If you build a direct `,_jsx(_components.code,{children:`/v1`}),` API integration, create a separate API credential\nwith the minimum required scopes. Keep it in your secret manager. Do not import\nthe CLI credential into an existing HTTP client.`]}),`\n`,_jsx(_components.p,{children:`Create, rotate, and revoke API keys in the OpenPMM portal. These operations\nrequire a recent browser session.`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Treat an API key like a password. Do not put it in source control, command arguments, URLs, screenshots, or logs.`})}),`\n`,_jsx(Heading,{level:`2`,id:`select-a-workspace`,children:`Select a workspace`}),`\n`,_jsx(_components.p,{children:`The browser flow stores the approved Workspace. If a key can access exactly\none Workspace, the CLI also discovers it automatically.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openpmm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` workspaces`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openpmm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` posts`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Pass a Workspace only when the key can access more than one:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` OPENPMM_WORKSPACE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ws_01JABCDEF`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openpmm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` destinations`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --json`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`--workspace`}),` has priority over `,_jsx(_components.code,{children:`OPENPMM_WORKSPACE`}),` and the Workspace stored by\nbrowser authorization. The CLI never guesses when more than one Workspace is\navailable.`]}),`\n`,_jsx(Heading,{level:`2`,id:`select-an-api-origin`,children:`Select an API origin`}),`\n`,_jsxs(_components.p,{children:[`The production API is the default. Use `,_jsx(_components.code,{children:`--api-base-url`}),` or\n`,_jsx(_components.code,{children:`OPENPMM_API_BASE_URL`}),` for an approved staging or self-hosted deployment.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openpmm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` workspaces`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --api-base-url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.openpmm.com/v1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --json`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The CLI validates the origin and `,_jsx(_components.code,{children:`/v1`}),` path. It refuses private `,_jsx(_components.code,{children:`/api/...`}),`\nroutes and URLs that contain credentials.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Authenticate the CLI","sidebarTitle":"Authentication","description":"Authorize the OpenPMM CLI in a browser and select a Workspace.","href":"/cli/authentication"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Use an environment variable","slug":"use-an-environment-variable","depth":2,"children":[]},{"title":"Import an existing API key","slug":"import-an-existing-api-key","depth":2,"children":[]},{"title":"Select a workspace","slug":"select-a-workspace","depth":2,"children":[]},{"title":"Select an API origin","slug":"select-an-api-origin","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"open-pmm","siteName":"OpenPMM","title":"Authenticate the CLI - OpenPMM","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-27T10:42:47.971Z","originalFileLocation":"cli/authentication.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Authorize the OpenPMM CLI in a browser and select a Workspace.\">\u003cmeta data-mint-head name=\"application-name\" content=\"OpenPMM\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/open-pmm/Q6BZMi2O6IrklsYx/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/open-pmm/Q6BZMi2O6IrklsYx/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/open-pmm/Q6BZMi2O6IrklsYx/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/open-pmm/Q6BZMi2O6IrklsYx/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/open-pmm/Q6BZMi2O6IrklsYx/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/open-pmm/Q6BZMi2O6IrklsYx/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/open-pmm/Q6BZMi2O6IrklsYx/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/open-pmm/Q6BZMi2O6IrklsYx/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/open-pmm/Q6BZMi2O6IrklsYx/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Authenticate the CLI - OpenPMM\">\u003cmeta data-mint-head property=\"og:description\" content=\"Authorize the OpenPMM CLI in a browser and select a Workspace.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"OpenPMM\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://www.openpmm.com/docs/cli/authentication\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://open-pmm.mintlify.app/_mintlify/api/og/v2?division=Get+started\u0026amp;title=Authenticate+the+CLI\u0026amp;description=Authorize+the+OpenPMM+CLI+in+a+browser+and+select+a+Workspace.\u0026amp;theme=d3f8c8d79f1e36f864055b30\u0026amp;signature=48b23bf2167f331e2a033265ba865c9e78f27fb923b86f4f3c7e78d5be33b1c2\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Authenticate the CLI - OpenPMM\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Authorize the OpenPMM CLI in a browser and select a Workspace.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://open-pmm.mintlify.app/_mintlify/api/og/v2?division=Get+started\u0026amp;title=Authenticate+the+CLI\u0026amp;description=Authorize+the+OpenPMM+CLI+in+a+browser+and+select+a+Workspace.\u0026amp;theme=d3f8c8d79f1e36f864055b30\u0026amp;signature=48b23bf2167f331e2a033265ba865c9e78f27fb923b86f4f3c7e78d5be33b1c2\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/open-pmm/Q6BZMi2O6IrklsYx/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"OpenPMM\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#C83F1D\">\u003clink data-mint-head rel=\"canonical\" href=\"https://www.openpmm.com/docs/cli/authentication\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/cli/authentication.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.openpmm.com/#organization\",\"name\":\"OpenPMM\",\"url\":\"https://www.openpmm.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/open-pmm/Y4bqcTFv_MCkrIIC/logo/openpmm.png?fit=max\u0026auto=format\u0026n=Y4bqcTFv_MCkrIIC\u0026q=85\u0026s=cdc550716e5a29bb13424cc795a18490\"},\"sameAs\":[\"https://github.com/OpenPMM/cli\",\"https://www.npmjs.com/package/@openpmm/cli\"]},{\"@type\":\"WebSite\",\"@id\":\"https://www.openpmm.com/docs#website\",\"name\":\"OpenPMM\",\"url\":\"https://www.openpmm.com/docs\",\"publisher\":{\"@id\":\"https://www.openpmm.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://www.openpmm.com/docs/cli/authentication#webpage\",\"url\":\"https://www.openpmm.com/docs/cli/authentication\",\"name\":\"Authenticate the CLI\",\"description\":\"Authorize the OpenPMM CLI in a browser and select a Workspace.\",\"dateModified\":\"2026-08-27T10:42:47.971Z\",\"isPartOf\":{\"@id\":\"https://www.openpmm.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://www.openpmm.com/docs/cli/authentication#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://www.openpmm.com/docs/cli/authentication#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Get started\",\"item\":\"https://www.openpmm.com/docs/cli/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Authenticate the CLI\",\"item\":\"https://www.openpmm.com/docs/cli/authentication\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://www.openpmm.com/docs/cli/authentication#article\",\"headline\":\"Authenticate the CLI\",\"name\":\"Authenticate the CLI\",\"description\":\"Authorize the OpenPMM CLI in a browser and select a Workspace.\",\"url\":\"https://www.openpmm.com/docs/cli/authentication\",\"mainEntityOfPage\":{\"@id\":\"https://www.openpmm.com/docs/cli/authentication#webpage\"},\"dateModified\":\"2026-08-27T10:42:47.971Z\",\"publisher\":{\"@id\":\"https://www.openpmm.com/#organization\"},\"isPartOf\":{\"@id\":\"https://www.openpmm.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"OpenPMM\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"OpenPMM","nav":{"global":{"anchors":[{"anchor":"OpenPMM","icon":"house","href":"https://www.openpmm.com"},{"anchor":"Dashboard","icon":"grid-2","href":"https://app.openpmm.com"}]},"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":""}]},{"tab":"MCP","pages":[{"title":"MCP","href":"/mcp/overview"}]},{"tab":"CLI","groups":[{"group":"Get started","pages":[{"title":"OpenPMM CLI","sidebarTitle":"Overview","href":"/cli/overview"},{"title":"Create an account","sidebarTitle":"Signup","description":"Create an OpenPMM signup link and start a verified account and Workspace from the CLI.","href":"/cli/signup"},{"title":"Authenticate the CLI","sidebarTitle":"Authentication","href":"/cli/authentication"},{"title":"Agent workflow","sidebarTitle":"Agent workflow","description":"Use OpenPMM through the CLI with deterministic files, safe credentials, and bounded publication status checks.","href":"/cli/agent-workflow"}]},{"group":"Workflows","pages":[{"title":"Draft and publish","sidebarTitle":"Draft and publish","href":"/cli/drafts-and-publishing"},{"title":"Analytics","sidebarTitle":"Analytics","href":"/cli/analytics"},{"title":"Inbox","sidebarTitle":"Inbox","href":"/cli/inbox"},{"title":"Manage assets and destinations","sidebarTitle":"Assets and destinations","href":"/cli/assets-and-connections"},{"title":"Billing","href":"/cli/billing"},{"title":"Send feedback with the OpenPMM CLI","sidebarTitle":"Feedback","href":"/cli/feedback"},{"title":"Manage webhooks","sidebarTitle":"Webhooks","href":"/cli/webhooks"}]},{"group":"Automation","pages":[{"title":"Automate with the CLI","sidebarTitle":"Automation and safety","href":"/cli/automation-and-safety"}]}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/reference/overview"}]}]},"title":"Authenticate the CLI - OpenPMM","buildId":"dpl_DGmhKsAzJdVqypJzon18vViniWRY","deploymentId":"dpl_DGmhKsAzJdVqypJzon18vViniWRY","dynamics":[],"chunks":[]}