skills/connectors/data-upload-java-cli/SKILL.md
Java CLI (domoutil.jar) fallback for CSV upload to Domo; schema derivation, chunked uploads. Use when JSON connector is not suitable.
npx skillsauth add stahura/domo-ai-vibe-rules data-upload-java-cliInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Preferred Strategy — JSON Connector first, CLI fallback: When the data source is a REST/JSON API, always try the Domo JSON No-Code Connector (
domo-json-no-code-connectorskill) first. It creates a live, re-runnable connector stream inside Domo so data can be refreshed from the UI without re-running scripts. Only fall back to the Java CLI when:
- The JSON connector fails (auth issues, unsupported pagination, parsing errors), or
- The data is already in CSV form (local files, database exports, etc.) and there is no source API to connect to.
This guide covers the Java CLI fallback for uploading CSV data to Domo using domoutil.jar. The CLI handles schema derivation, dataset creation, chunked uploads, and indexing automatically.
When pulling from a REST/JSON API into Domo, use this two-path strategy in code:
def ingest_object(obj_type, cfg):
# Path 1 — JSON No-Code Connector (creates a live stream in Domo)
ok, dataset_id = try_json_connector(obj_type, cfg)
# Path 2 — CLI fallback (fetch → CSV → upload)
if not ok:
ok, dataset_id = try_cli_fallback(obj_type, cfg, work_dir)
Path 1 (JSON connector) steps:
POST /api/data/v1/accounts — create a json5 account for authPOST /api/data/v1/streams — configure URL, headers, parsing, pagingPOST /api/data/v1/streams/{id}/executions — trigger a runGET /api/data/v1/streams/{id}/executions/{execId} until currentState is "SUCCESS" or "ERROR""ERROR" or HTTP error at any step → fall through to Path 2Path 2 (CLI fallback) steps:
requestsderive-schema → build schema JSONcreate-dataset → get dataset UUIDupload-dataset -h → upload CSVWhen to skip directly to CLI:
Auth note for the JSON connector: Use credentialsType: "fields" with authentication: "none" and inject the Authorization header directly in jsonSelection.httpsHeaders. Do not use authType — it is not valid for json5 and returns a 400.
/Users/elliottleonard/Documents/Cursor/CLI/domoutil.jarjava -jar /Users/elliottleonard/Documents/Cursor/CLI/domoutil.jarDDCI...)instance.domo.com)connect -server <instance>.domo.com -token <API_TOKEN>
Verify with whoami.
derive-schema -d /path/to/data.csv -r 500
-d: Path to the CSV file-r: Number of rows to sample for type detection (500 is a good default)STRING, LONG, DOUBLE, DATETIME, etc.Output format:
Schema:
column_name1 STRING
column_name2 LONG
column_name3 DATETIME
Convert the derive-schema output into a JSON schema file:
{
"columns": [
{
"name": "column_name1",
"type": "STRING",
"metadata": null,
"upsertKey": false
},
{
"name": "column_name2",
"type": "LONG",
"metadata": null,
"upsertKey": false
},
{
"name": "column_name3",
"type": "DATETIME",
"metadata": null,
"upsertKey": false
}
],
"objects": []
}
Valid column types: STRING, LONG, DOUBLE, DECIMAL, DATETIME, DATE
create-dataset -n "<Dataset Name>" -t "<type>" -s /path/to/schema.json
-n: Dataset name (displayed in Domo)-t: Dataset type (use "domo-cli" as a general-purpose type)-s: Path to the schema JSON fileOutput:
Created DataSet: <dataset-uuid>
Save this UUID — you need it for the upload step.
upload-dataset -i <dataset-uuid> -f /path/to/data.csv -h
-i / --id: Dataset UUID from the create step-f / --data: Path to the CSV file-h / --headers: Required when the CSV has a header row (skips the first row)Output on success:
Started upload for DataSet <uuid>.
Finished upload for DataSet <uuid>. Bytes sent X.
Started indexing for dataset <uuid>
Finished indexing for dataset <uuid> with status SUCCESS
Data uploaded successfully
| Flag | Description |
|---|---|
| -i <ID> | Dataset UUID (required) |
| -f <FILE> | CSV file path |
| -h | CSV has a header row |
| -a / --append | Append to existing data instead of replacing |
| -d <DIR> | Upload all CSVs in a directory (files should NOT include headers) |
| -c | Files are gzipped (only with -d) |
| -p <TAG> | Partition tag (only with --append) |
| -m <N> | Max upload threads |
| -x | Skip indexing after upload |
Pipe commands via stdin for automation:
echo -e "connect -server instance.domo.com -token YOUR_TOKEN\nupload-dataset -i <uuid> -f data.csv -h\nquit" \
| java -jar /Users/elliottleonard/Documents/Cursor/CLI/domoutil.jar
Always end with quit to ensure clean exit.
This is the recommended approach for uploading multiple CSV files at once. The script:
import subprocess, json, os, re
csv_dir = "/path/to/csv/directory"
cli = "/Users/elliottleonard/Documents/Cursor/CLI/domoutil.jar"
server = "instance.domo.com"
token = "DDCI..."
schema_dir = "/tmp/domo_schemas"
os.makedirs(schema_dir, exist_ok=True)
csvs = sorted([f for f in os.listdir(csv_dir) if f.endswith('.csv')])
# --- Phase 1: Derive schemas and save as JSON ---
for csv_file in csvs:
csv_path = os.path.join(csv_dir, csv_file)
cmds = f"connect -server {server} -token {token}\nderive-schema -d {csv_path} -r 500\nquit"
result = subprocess.run(['java', '-jar', cli], input=cmds, capture_output=True, text=True, timeout=60)
columns = []
in_schema = False
for line in result.stdout.split('\n'):
if 'Schema:' in line:
in_schema = True
continue
if in_schema and line.startswith(' ') and line.strip():
parts = line.split()
if len(parts) >= 2:
col_type = parts[-1]
col_name = ' '.join(parts[:-1]).strip()
columns.append({"name": col_name, "type": col_type, "metadata": None, "upsertKey": False})
elif in_schema and line.startswith('>'):
in_schema = False
schema = {"columns": columns, "objects": []}
schema_path = os.path.join(schema_dir, csv_file.replace('.csv', '.json'))
with open(schema_path, 'w') as f:
json.dump(schema, f, indent=2)
# --- Phase 2: Create datasets ---
cmds = [f"connect -server {server} -token {token}"]
for csv_file in csvs:
schema_path = os.path.join(schema_dir, csv_file.replace('.csv', '.json'))
# Generate a friendly name from the filename
friendly_name = csv_file.replace('.csv', '').split('.')[-1].replace('_', ' ').title()
cmds.append(f'create-dataset -n "{friendly_name}" -t "domo-cli" -s {schema_path}')
cmds.append("quit")
result = subprocess.run(['java', '-jar', cli], input='\n'.join(cmds), capture_output=True, text=True, timeout=120)
# Parse dataset IDs from output
dataset_ids = []
for line in result.stdout.split('\n'):
match = re.search(r'Created DataSet: ([0-9a-f-]{36})', line)
if match:
dataset_ids.append(match.group(1))
# --- Phase 3: Upload data ---
cmds = [f"connect -server {server} -token {token}"]
for csv_file, dataset_id in zip(csvs, dataset_ids):
csv_path = os.path.join(csv_dir, csv_file)
cmds.append(f'upload-dataset -i {dataset_id} -f {csv_path} -h')
cmds.append("quit")
result = subprocess.run(['java', '-jar', cli], input='\n'.join(cmds), capture_output=True, text=True, timeout=600)
print(result.stdout)
For simpler cases, use a shell script:
CLI="/Users/elliottleonard/Documents/Cursor/CLI/domoutil.jar"
SERVER="instance.domo.com"
TOKEN="DDCI..."
# Create commands file
cat > /tmp/upload_cmds.txt << EOF
connect -server $SERVER -token $TOKEN
upload-dataset -i <dataset-id-1> -f /path/to/file1.csv -h
upload-dataset -i <dataset-id-2> -f /path/to/file2.csv -h
quit
EOF
cat /tmp/upload_cmds.txt | java -jar "$CLI"
To replace all data in an existing dataset (not append), use the same upload-dataset command without --append:
upload-dataset -i <existing-dataset-uuid> -f /path/to/new_data.csv -h
This performs a full replace — all existing rows are removed and replaced with the new CSV data.
To add rows to an existing dataset without removing existing data:
upload-dataset -i <dataset-uuid> -f /path/to/new_rows.csv -h --append
-h FlagIf your CSV has a header row and you forget -h, the header row will be imported as data. Always use -h for CSVs with headers.
upload-dataset Requires an Existing DatasetThe upload-dataset command does NOT create a dataset. You must first create-dataset with a schema file, then upload-dataset with the returned UUID. Uploading without a valid --id results in:
Executing POST: https://.../datasources/null/uploads
An error occurred while uploading the data from file
The column names in the schema JSON must match the CSV header names exactly (case-sensitive). Use derive-schema to auto-detect them.
-t Flag is Required for create-datasetThe dataset type (-t) is required. Use "domo-cli" as a safe default:
create-dataset -n "My Dataset" -t "domo-cli" -s schema.json
Files over ~10MB are automatically split into multiple upload parts. The CLI handles this transparently. For very large uploads, consider using -m to control thread count.
The derive-schema output can sometimes concatenate the first column name with preceding text. Always verify the first column name against your CSV header.
When using -d (directory upload), the CSV files should NOT contain header rows. This mode is designed for pre-split partitioned data.
After uploading, verify data is accessible:
query-data -id <dataset-uuid> -q "SELECT * FROM table LIMIT 10"
Or check dataset metadata:
get-dataset -id <dataset-uuid>
get-schema -id <dataset-uuid>
tools
Step-by-step orchestrator for building Domo App Studio apps with native KPI cards via community-domo-cli. Sequences app creation, pages, theme, hero metrics, native charts, filter cards, layout assembly, and navigation. CLI-first — no raw API calls.
tools
Create, update, and execute Magic ETL dataflows programmatically via API and CLI. Covers DAG-based JSON dataflow definitions, input/transform/output node wiring, join operations, and execution lifecycle.
tools
Magic ETL dataflows via community-domo-cli — list, get-definition, create, update, run, execution status; JSON DAG actions, transforms, joins. Use when automating dataflows with the community Domo CLI end-to-end. For REST/Java-CLI–first flows or mixed API patterns, use magic-etl instead.
development
Clean, professional dashboard theme for Domo custom apps. CSS custom properties, layout patterns, typography, and design polish that feel native to the Domo platform. Includes OKLCH color palette, layered shadows, concentric border radius, tabular numbers, and micro-interaction patterns.