GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing www.contentstack.com — CLI Authentication | V2.x.x | Contentstack CLI Authentication and Adding TokensupdateLast updated November 6, 2026 OverviewTo start using CLI commands, you must first authenticate yourself after installing the CLI and configuring the region. The Contentstack CLI Authentication feature allows you to securely log in or use tokens—such as Management or Delivery tokens—to perform content management tasks via the terminal. It supports login credentials, Two-Factor Authentication, and Single Sign-On (SSO). You can authenticate either by using the login command or by adding a Management Token to the local config. PrerequisitesCommandsAuthentication LoginThe auth:login command lets you log in to Contentstack and save the login information in your local storage. Note The Contentstack CLI supports Two-factor Authentication for enhanced security. Open the terminal and run the following command to log in with your Contentstack account credentials. Once you log in, you can use the Contentstack CLI commands such as export, import, clone, bulk publish and unpublish, seed, bootstrap, migration, etc. Usage 1 csdx auth:login OR 1 csdx login Options
Note To enable automatic OTP generation for MFA-enabled Contentstack accounts, set the CONTENTSTACK_MFA_SECRET environment variable using the MFA secret key provided by Contentstack. This allows the Contentstack CLI to generate one-time passwords (OTPs) automatically, eliminating the need to enter them manually from an authenticator app. LogoutThe auth:logout command lets you log out and clear the authentication from the local storage. Usage 1 csdx auth:logout OR 1 csdx logout Options
Display Username of the Logged in UserThe csdx auth:whoami command returns the username (email address) of the user who is currently logged in. Usage
1 csdx auth:whoami OR 1 csdx whoami Token Management Add Management TokenNote Ensure you have already generated a Management Token in your stack before running this command. The following command lets you add an existing Management Token from your Contentstack account to the local config for further use. Usage 1 csdx auth:tokens:add --management Options
Add Delivery TokenNote Ensure you have already generated a Delivery Token in your stack before running this command. For CLI commands, you may use a Delivery Token instead of a Management Token. However, Delivery Tokens cannot be used for importing or exporting content. Usage 1 csdx auth:tokens:add --delivery Options
Delete TokenNote This command will not delete the Management/Delivery token from the stack; it deletes the token from the local config. Usage 1 csdx auth:tokens:remove Options
List All TokensThe auth:tokens:list command lists all tokens stored in the local config. The output table has the columns alias, token, apiKey, environment, and type. The environment column shows - for a management token. If you have not added any tokens, the command prints No tokens are added. Use auth:tokens:add command to add tokens. Usage 1 csdx auth:tokens:list Warning csdx auth:tokens does not list tokens. It prints the help text for its sub-commands to standard output and exits successfully. A script that parses its output for a token table receives help text instead, with no error code to detect the problem. Use csdx auth:tokens:list to list tokens. The short alias csdx tokens is no longer available and fails with a command-not-found error. Options
ExamplesList Tokens 1 csdx auth:tokens:list 1 csdx auth:tokens:list --columns alias,type 1 csdx auth:tokens:list --filter type=management --output json Login 1 csdx auth:login -u [email protected] 1 csdx auth:login -u [email protected] -p ***** 1 csdx auth:login --username [email protected] --password ***** 1 csdx login -u [email protected] 1 csdx auth:login --oauth Logout 1 csdx auth:logout -y 1 csdx logout -y Add Management Token 1 csdx auth:tokens:add --management -a tokenname -k blt******** --token cs********* 1 csdx auth:tokens:add --management -a tokenname -k blt******** --token cs********* -y Note This command does not generate a new token in your stack. It only allows you to use an existing Management Token with the CLI. Add Delivery Token 1 csdx auth:tokens:add --delivery -a tokenname -k blt******** -e <ENVIRONMENT> --token cs********* 1 csdx auth:tokens:add --delivery -a tokenname -k blt******** -e <ENVIRONMENT> --token cs********* -y Delete Token 1 csdx auth:tokens:remove -a mytoken 1 csdx auth:tokens:remove --alias=mytoken Limitations
Next Steps
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |