D

DatoCMS CLI

CLI discovered

Details
Command
datocms
Docs
https://www.datocms.com/docs/cli
Authentication
DatoCMS CLI OAuth login oauth2 discovered $ npx datocms login

Acquired by the CLI — running npx datocms login opens the auth flow and stores the credential.

DatoCMS API token bearer discovered Get token ↗
env DATOCMS_API_TOKEN

In your DatoCMS project admin area (https://<your-project>.admin.datocms.com), go to Project Settings → API Tokens to use the default read-only token or create a custom token. When creating a custom token, choose a Role and enable the API surface flags you need: can_access_cda, can_access_cda_preview, and/or can_access_cma. The CMA auth guide and token resource docs explain the flow: Authentication, Create a new API token. For Site Search specifically, create a role with the Can perform Site Search API calls permission before minting the token: Perform searches via API.