CARTO CLI
The CARTO CLI is our command line interface for interacting with CARTO directly from the terminal (or through an AI agent). With it, users can:
Find and manage Maps, Workflows, connections and developer credentials
Transfer Maps and Workflows between different organizations
Check your organization's quotas and activity
Interact with existing AI Agents in the organization
Transfer assets between users
For a full list of features, please refer to the CLI's documentation.

Getting started
To get started with the CARTO CLI, head over to the NPM package page and follow the installation instructions:
Once the CLI is installed, you can use the following command to authenticate to your CARTO account using the browser. Organizations with SSO configured must include their organization name: carto auth login --organizaion-name acme.
To work with multiple organizations in the CLI, create named profiles. This step will be necessary for transferring maps and workflows between organizations. Each profile stores separate credentials and their names must be unique. Use carto auth use <profile> to switch between them. To create a profile, simply add its desired name to the end of the login command:
Your authentication token will eventually expire (typically within 24 hours). The CLI will warn you when your token is expiring and prompt you to reauthenticate. You can check your authentication status, user details and available CLI profiles at any time with:
Transferring maps and workflows between organizations
Users can use the CLI to transfer maps and workflows from one organization to another. As a prerequisite, you need to be authenticated to both organizations (the one containing the asset and the one receiving it) using profiles.
Once the profiles are set up, you will need the ID of the map or workflow that you wish to copy across. You can get this ID from the CARTO Workspace, by clicking on the three dots of the Map/Workflow card in the workspace or from the Map/Workflow URL. Alternatively, you can search for a specific Map/Workflow by name directly in the CLI using the command carto maps list --search map name and carto workflows list --search workflow name
Once you have the ID, run the following command to copy the Map/Workflow across to the other organization:
By default, CARTO will try to map the connection(s) used by the Map/Workflow with connections in the second organization that have the same name (i.e if a map is using a Snowflake connection called production, the CLI will look for another connection with the same name in the second organization to use it in the newly copied map). If there are no connections with the same name, you will have to map them manually using --connection-mapping . For example:
The CLI assumes mapped connections have the same data access permissions. If not, the copied resources will fail to load.
Copying does not delete the original resource.
Last updated
Was this helpful?
