# Salesforce Dmp Krux Export Integration CLI

## Install ‘td’ Command

Install the [TD Toolbelt](https://toolbelt.treasuredata.com/).

## For On-demand Jobs

Add the Salesforce DMP result output destination by using the `-r` / `--result` option for the `td query` command:


```bash
td query -d mydb \
-w 'SELECT user_id, td_segment FROM source_table' \
--type presto \
-r '{"type":"krux_dmp", "access_key_id":"xxx", "secret_access_key":"xxx", "client_name": "name", "export_type":"first_party_segment"}'
```

Some parameters, such as **access_key_id**, **secret_access_key, client_name** are the same parameters that are used in by the data connector in TD Console.

## For Scheduled Jobs

Add the Salesforce DMP result output destination by using the `-r` / `--result` option for the `td sched:create` command:


```bash
td sched:create every_6_mins "*/6 * * * *" \
-d mydb -w 'SELECT user_id, td_segment FROM source_table' \
--type presto \
-r '{"type":"krux_dmp", "access_key_id":"xxx", "secret_access_key":"xxx", "client_name": "name", "export_type":"first_party_segment"}'
```