Was this page helpful?

Authentication with the Contentful CLI

For every request, clients need to provide an API key, which is created per space and used to delimit applications and content classes. This helps you authenticate with the contentful-cli.

Requirements

Login

contentful login

Contentful-login gif

If you have no browser available on your machine you can generate the management token manually and pass it directly to the login command. Login and create a management token at Settings > API keys > Content management tokens > Generate personal token.

contentful login --management-token <management-token>

The output should look similar to this:

Great! Your CMA token is now stored on your system. (Located at ~/.contentfulrc.json)
You can always run contentful logout to remove it.

Logout

To log out and remove your current management token from .contentfulrc.json

contentful logout

The output should look similar to this:

Successfully logged you out.

Next steps

Not what you’re looking for? Try our FAQ.