> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-openapi-sync-dataflows.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Domo CLI (Command Line Interface) Tool

### Intro

The Domo CLI (command line interface) tool allows you to perform many data management functions, such as uploading massive DataSets, renaming cards, managing users and groups, and exporting DataSets using text-based commands. Other available functions include importing/exporting from AWS S3 and DataFusion helpers. By automatically breaking large files into smaller parts, you can upload CSV or gzipped CSV files to your Domo instance more efficiently.

<Warning>
  **Important:** The tool requires Java 7 or later.
</Warning>

<Frame>
  <img alt="Screenshot 2023-08-01 at 2.34.21 PM.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/Bg_tFGvM-8KJbsB4/images/kb/ka0Vq000000Gnnx-00N5w00000Ri7BU-0EM5w000006vTTJ.jpg?fit=max&auto=format&n=Bg_tFGvM-8KJbsB4&q=85&s=b0a3f9a0476e9ede43f8a11f2c2644a2" style={{width: 500, height: 434}} width="1144" height="994" data-path="images/kb/ka0Vq000000Gnnx-00N5w00000Ri7BU-0EM5w000006vTTJ.jpg" />
</Frame>

***

***

### Install and Launch the CLI Tool

To use the Domo CLI tool, download and install it onto your own machine by following the instructions below.

1. In the navigation header, select **More** > **Admin Settings**.
2. In the **More** menu, select **Tool Downloads**.
3. Locate the **Domo CLI** tool and select **Try the Domo CLI**.

   The utility file downloads to your machine.
4. Open a terminal application (Terminal on macOS or PowerShell on Windows).
5. Run the CLI binary file using Java: `java -jar domoUtil.jar`

   <Tip>
     **Tip:** If using a Windows machine, place the.jar file into a folder such as C:\domo\java. Then, you can launch the CLI Tool by using the following command line: `java -jar C:\domo\java\domoUtil.jar`
   </Tip>

### View Available Commands

To view a list of available commands, enter `help` **.**

Enter `help [command name]` to view specific flags and parameters for that command.

### Deprecated Commands

Some commands that may be listed as available in your version of the tool have been deprecated since you downloaded it. See the list of deprecated commands below.

<table class="mt-responsive-table" data-aura-rendered-by="33:195;a"><tbody><tr><td class="mt-noheading" colspan="1" rowspan="1"><font face="monospace"> backup </font></td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"><font face="monospace"> backup-card </font></td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"><font face="monospace"> convert-sql </font></td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"><font face="monospace"> move-page </font></td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"><font face="monospace"> set-dataset-retention-window </font></td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"><font face="monospace"> restore card </font></td></tr></tbody></table>

### Command Use Cases

This section describes some command use cases and provides needed or helpful information for using the command. You can scroll through or navigate to them from the following list:

* [Connect to a Domo instance](#connect_domo_instance)
* [Disconnect from a Domo instance](#disconnect_domo_instance)
* [Create a new DataSet](#create_new_dataset)
* [Delete a DataSet](#delete_dataset)
* [Upload data to a DataSet](#upload_data_to_dataset)
* [Upload data from a database via JDBC](#upload_data_via_jdbc)
* [Create a user](#create_user)
* [Query (export) data](#query_data)
* [Generate card image](#generate_card_image)
* [Export card data](#export_card_data)
* [Move a dashboard](#move_dashboard)
* [Demote a dashboard](#demote_dashboard)
* [Promote a dashboard](#promote_dashboard)
* [Move data](#move_data)
* [List DataSets](#list_datasets)
* [Search Domo](#search_domo)
* [Who am I](#who_am_i)
* [End a session](#end_a_session)

# Connect to a Domo Instance

To connect to a Domo instance, run the `connect` command and enter the following parameters:

<table class="mt-responsive-table" data-aura-rendered-by="33:195;a"><tbody><tr><td class="mt-noheading" colspan="1" rowspan="1"> -u, --username \<USERNAME> </td><td class="mt-noheading" colspan="1" rowspan="1"> Domo login username </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -p, --password \<PASSWORD> </td><td class="mt-noheading" colspan="1" rowspan="1"> Domo login password </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -s, --server \<SERVERNAME> </td><td class="mt-noheading" colspan="1" rowspan="1"> Domo server </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -pp, --proxypassword \<proxypassword> </td><td class="mt-noheading" colspan="1" rowspan="1"> Proxy password </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -ps, --proxyserver \<proxyserver> </td><td class="mt-noheading" colspan="1" rowspan="1"> Proxy server </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -pt, --proxyport \<proxyport> </td><td class="mt-noheading" colspan="1" rowspan="1"> Proxy port </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -pu, --proxyuser \<proxyuser> </td><td class="mt-noheading" colspan="1" rowspan="1"> Proxy user </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -t, --token \<TOKEN> </td><td class="mt-noheading" colspan="1" rowspan="1"> Token </td></tr></tbody></table>

**Example**

`connect -u jim.smith@xyzcompany.com -p abc123 -s xyzcompany.domo.com`

`connect -s xyzcompany.domo.com -t mffde8e727f825ae23e1117070f0ad67cfeb40c607dddd`

***

# Disconnect From a Domo Instance

To disconnect from a Domo instance, run the `disconnect` command without using any parameters.

***

# Create a New DataSet

Follow these steps to create a new DataSet using the CLI Tool:

1. Create a Domo access token. For more information on how to create and manage access tokens, see
   [Manage Access Tokens](/s/article/360042934494).

2. Obtain the schema file in JSON format of the DataSet you want to upload to Domo by running the `derive-schema` command.

   <Note>
     **Note:** To derive the schema from an existing CSV file, use the following command, replacing ''filename.csv' with your file name. `derive-schema -d 'C:\directory\[filename.csv]' -s 'C:\directory\schemafile.json'`
   </Note>

3. Perform a pre-check on the data by generating a clean, true CSV with a small number of rows. Obtain the schema file and run the `create-dataset` command to validate the upload. You may then delete that DataSet from Domo at your discretion.

   <Tip>
     **Tip:** You will need to place double quotes (") around any commas in your CSV that you want to escape, otherwise the CLI Tool will use the comma as a delimiter.
   </Tip>

4. If the command is successful, you are presented with the DataSet ID.

5. When the pre-check is successful, run the `create-dataset` command using the full file's schema file.

***

# Delete a DataSet

To delete a DataSet in Domo, use the `delete-dataset` command, replacing \[dataset id] with the ID of the DataSet you want to delete.

`delete-dataset -id [dataset id]`

You can get a list of DataSet ID's by using the `list-dataset` command.

***

# Upload Data to a DataSet

To upload data to a DataSet after it has been created, use the `upload-dataset` command, replacing \[dataset id] with the ID of the DataSet you want to update.

<Warning>
  **Important:** By default, when updating a DataSet, the entire existing DataSet is replaced with the new upload unless you use the append parameter.
</Warning>

Parameters available for the `upload-dataset` command are:

<table class="mt-responsive-table" data-aura-rendered-by="33:195;a"><tbody><tr><td class="mt-noheading" colspan="1" rowspan="1"> -a, --append </td><td class="mt-noheading" colspan="1" rowspan="1"> Append to existing data. </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -c, --compressed </td><td class="mt-noheading" colspan="1" rowspan="1"> Data file(s) are gzipped. </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -d, --dir \<DIRECTORY> </td><td class="mt-noheading" colspan="1" rowspan="1"> Data (CSV) directory. </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -f, --data \<FILENAME> </td><td class="mt-noheading" colspan="1" rowspan="1"> Data (CSV) file. </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -h, --headers </td><td class="mt-noheading" colspan="1" rowspan="1"> Data file has a header row. </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -i, --id \<ID> </td><td class="mt-noheading" colspan="1" rowspan="1"> DataSet ID. </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -p, --partition \<arg> </td><td class="mt-noheading" colspan="1" rowspan="1"> Partition tag. </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -t, --temp-dir \<TEMP> </td><td class="mt-noheading" colspan="1" rowspan="1"> Temp path to use. </td></tr></tbody></table>

**Examples**

```
upload-dataset -id [dataset id] -data "c:\directory\datafile.csv"

upload-dataset -i <dataset_id> -f <filename>

upload-dataset -i <dataset_id> -f <filename> -a

upload-dataset -i <dataset_id> -f <filename> -a -p <partition_name>

upload-dataset -i <dataset_id> -d <directory_name>
```

***

# Upload Data from a Database via JDBC

Ensure the JDBC driver JAR file is in the current working directory.

For example, if your domoUtil.jar is in \~/bin, but you are starting the utility from \~, your driver file needs to be in \~.

**Example**

```
upload-jdbc
  --dataset example_jdbc_upload
  --jdbcConnection jdbc:mysql://localhost:3306
  --jar mysql-connector-java-8.0.18.jar
  --query "select * from example;"
  --jdbcUser root
  --jdbcPassword password
  --jdbcDriver com.mysql.cj.jdbc.Driver
```

***

# Create a User

Create a user using the CLI Tool by specifying an email, whether or not to send an email invitation, full name, and their access rights role. Currently, you can create users with the following access rights: Admin, Privileged, Editor, Particpant, and Social.

`create-user -n 'James Smith' -r Editor -i true -e jim.smith@xyzcompany.com`

***

# Query (Export) Data

<Warning>
  **Important:** By default, queries return a maximum of one million rows. You can specify a higher limit in your query but you may experience timeouts if the result is too large. For full exports, use the `export-data` command.
</Warning>

The `query-data` command exports the data from a specified DataSet ID to a CSV file. Either the `-q` or `-qf` parameters must be used with this command.

<Note>
  **Note:** The exported file respects any Personalized Data Permissions (PDP) that are set for the specified DataSet.
</Note>

The parameters available for this command are:

<table class="mt-responsive-table" data-aura-rendered-by="33:195;a"><tbody><tr><td class="mt-noheading" colspan="1" rowspan="1"> -i, --id \<ID> </td><td class="mt-noheading" colspan="1" rowspan="1"> DataSet ID </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -q, --query \<QUERY> </td><td class="mt-noheading" colspan="1" rowspan="1"> Query file in JSON format </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -qf, --queryfile \<QUERYFILE> </td><td class="mt-noheading" colspan="1" rowspan="1"> Query filename <a id="export_card_data" target="_blank" /></td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -xf, --exportfile \<EXPORTNAME> </td><td class="mt-noheading" colspan="1" rowspan="1"> Export filename </td></tr></tbody></table>

**Example**

```
query-data -i [dataset id] -qf [query file in JSON format] -xf [filename]
```

***

# Generate Card Image

The `generate-card-image` command generates a PNG image of the specified card ID.

`generate-card-image -i <card id> -f <file name>`

***

# Export Card Data

The `download-card-data` command downloads data from the specified card ID.

`download-card-data -i <card id> -f <output_csv_file>`

***

# Move a Dashboard

The `move-page` command allows you to move a page up in the hierarchy as a top level page or down in the hierarchy to a subpage.

The parameters available for this command are:

<table class="mt-responsive-table" data-aura-rendered-by="33:195;a"><tbody><tr><td class="mt-noheading" colspan="1" rowspan="1"> -a, --move type </td><td class="mt-noheading" colspan="1" rowspan="1"> Choose promote or demote depending on where the page should be moved. </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -c, --page </td><td class="mt-noheading" colspan="1" rowspan="1"> Page ID </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -p, --newparentpage </td><td class="mt-noheading" colspan="1" rowspan="1"> Parent page ID if demoting a page. </td></tr></tbody></table>

***

# Demote a Dashboard

`move-page -a demote -c 1234567 -p 7654321`

***

# Promote a Dashboard

`move-page -a promote -c 1234567`

***

# Move Data

The move-data command allows you to move data from one existing DataSet to another existing DataSet.

The parameters available for this command are:

<table class="mt-responsive-table" data-aura-rendered-by="33:195;a"><tbody><tr><td class="mt-noheading" colspan="1" rowspan="1"> -a, --append </td><td class="mt-noheading" colspan="1" rowspan="1"> Append to existing data </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -d, --destination \<destination> </td><td class="mt-noheading" colspan="1" rowspan="1"> Destination DataSet </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -s, --source \<source> </td><td class="mt-noheading" colspan="1" rowspan="1"> Source DataSet </td></tr></tbody></table>

**Example**

`move-data -a -s [DataSet ID of where the data is coming from] -d [DataSet ID of where the data will be moved to]`

<Note>
  **Note:** To move data using a replace method, remove the -a parameter from the command line.
</Note>

***

# List DataSets

The `list-dataset` command will list all of the DataSets based on owner, a search term, or a specific DataSet ID.

The parameters available for this command are:

<table class="mt-responsive-table" data-aura-rendered-by="33:195;a"><tbody><tr><td class="mt-noheading" colspan="1" rowspan="1"> -i, --id \<ID> </td><td class="mt-noheading" colspan="1" rowspan="1"> DataSet ID </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -n, --name-like \<NAME\_PATTERN> </td><td class="mt-noheading" colspan="1" rowspan="1"> Name filter </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -o, --owner-id \<TYPE> </td><td class="mt-noheading" colspan="1" rowspan="1"> DataSet Owner ID<div class="mdx-embed"><Note><p><b> Note </b><b>: </b> Use 'me' instead of a DataSet Owner ID to use the currently authenticated user. </p></Note></div></td></tr></tbody></table>

**Example**

```
list-dataset -o me -name-like "sales"

list-dataset -name-like "marketing"
```

***

# Search Domo

The `search-domo` command searches and exports a list from Domo by entity type and search term.

The parameters available for this command are:

<table class="mt-responsive-table" data-aura-rendered-by="33:195;a"><tbody><tr><td class="mt-noheading" colspan="1" rowspan="1"> -e, --entities \<ENTITIES> </td><td class="mt-noheading" colspan="1" rowspan="1"> Entity type. Valid entities include app, buzz, buzz\_channel, connector, dataflow, dataset, dojo\_message, feature, knowledge\_base, project, task, page, card, user, and group. </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -f, --filename \<NAME> </td><td class="mt-noheading" colspan="1" rowspan="1"> Filename to export information. </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -l, --limit \<LIMIT> </td><td class="mt-noheading" colspan="1" rowspan="1"> Result limit. </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -o, --offset \<OFFSET> </td><td class="mt-noheading" colspan="1" rowspan="1"> Result offset. </td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"> -t, --term \<TERM> </td><td class="mt-noheading" colspan="1" rowspan="1"> Search term. <a id="end_a_session" target="_blank" /></td></tr></tbody></table>

**Example**

`search-domo -e "card,dataset" -t "sales"`

***

# Who am I?

The whoami command returns the username and user ID of the individual that is currently logged in. There are no parameters for this command.

```
> whoami

John Smith (userid: 123456789)
```

***

# End a Session

To end your CLI session, run both the `disconnect` and `quit` commands. There are no parameters for these commands.

### Scripting

While you can type the commands shown above in the command prompt, you can also create a text file with the commands and execute it as a script file.

**Example script file**

`connect -t [access token id] -s xyzcompany.domo.com upload-dataset -id [dataset id] -data "c:\directory\datafile.csv" -append quit`

**Example script file execution**

`java -jar domoUtil-2.31.jar -script c:\directory\<uploadfile.script>`

<Tip>
  **Tip:** Update \<uploadfile.script> in the above example to your own script file name.
</Tip>

### Common Issues

If you have Java 17 or later installed, you must add the following JVM parameter to the command that runs the CLI:

```
--add-opens java.base/java.nio=ALL-UNNAMED
```

**Example:**

```
java --add-opens java.base/java.nio=ALL-UNNAMED -jar domoUtil.jar
```
