# Resource Workflows

Read actual IDs from the list commands before using the write examples. Set `ENV_ID`, `PHONE_ID`, `TEAM_APP_ID`, `GROUP_ID` and `FILE_ID` to the intended resources; they identify different resource types. Examples are separate recipes, not one batch script.

## Browser Profiles and Cores

```bash
ml-cli env find --keyword Amazon
ml-cli --timeout 30 env open --keyword Amazon --exact
ml-cli --timeout 30 env start --env-id "$ENV_ID" --is-headless false --cdp-evasion true
ml-cli env core-download --core 1:124 --core 2:146
```

`find/open` can match name, group, tag or remark; open only proceeds for exactly one candidate. `env start` also supports `--encrypt-key` for encrypted profiles. Core types are `1` Chrome and `2` Firefox; submit 1–20 entries, or JSON `Cores`. Example versions are illustrative, not an availability guarantee.

`env create-quick` now has group, proxy, credentials, location and IP-monitoring flags. `fingerprint-refresh` supports `--browser-type-id`, `--operator-system-id`, `--ua-version`, `--advanced-setting`; `resolution-list` supports `--ua`. `set-group/set-remark` accept `--env-ids` or `--unique-ids`. `app-hide-accessibility --package-name` is repeatable (`--package-names` is an alias). Consult [Commands](/cli/commands) for every field.

## Cloud Phones

```bash
ml-cli cloudphone find --keyword android-test
ml-cli --timeout 120 cloudphone open --keyword android-test --headless false
ml-cli --timeout 120 cloudphone power-on --id "$PHONE_ID" --headless true --disable-money-saving-mode false
ml-cli --timeout 30 cloudphone close --keyword android-test
```

`headless=false` shows the Cloud Phone window; `true` hides it. Power-on also supports `--disable-money-saving-mode`. Opening by name or keyword requires exactly one match. A successful request alone is not proof that streaming or device startup finished.

## Team Apps

`team-app-list` reads the team library; `app-list` reads the app catalogue. Use the team record ID, not a phone ID or catalogue ID. List `versionCode` is text, but `--version-code` and raw JSON `versionCode` must be signed i64 integers, not strings, floats, version names or version-record IDs.

`team-app-list` defaults to `pageNo=1`, `pageSize=10`; pagination values must fit u32. Select `PACKAGE_NAME` and integer `VERSION_CODE` from `app-list`. Version updates support store apps only and require a different available version with the same package name; the backend validates availability.

```bash
ml-cli cloudphone team-app-list --app-name Facebook --page-no 1 --page-size 10
ml-cli cloudphone app-list --app-name Facebook
ml-cli --fail-on-business-error cloudphone team-app-create --package-name "$PACKAGE_NAME" --version-code "$VERSION_CODE"
ml-cli --fail-on-business-error cloudphone team-app-update-group --id "$TEAM_APP_ID" --is-all false --group-ids "$GROUP_ID"
ml-cli --fail-on-business-error cloudphone team-app-enable --id "$TEAM_APP_ID" --enabled false
ml-cli --fail-on-business-error cloudphone team-app-update-install-setting --id "$TEAM_APP_ID" --install-setting 2
ml-cli --fail-on-business-error cloudphone team-app-update-enable-root --id "$TEAM_APP_ID" --enable-root false
ml-cli --fail-on-business-error cloudphone team-app-update-version --id "$TEAM_APP_ID" --package-name "$PACKAGE_NAME" --version-code "$VERSION_CODE"
ml-cli --fail-on-business-error cloudphone team-app-update-setting --id "$TEAM_APP_ID" --setting-type keep-alive --enabled false
ml-cli --fail-on-business-error cloudphone team-app-operate --id "$TEAM_APP_ID" --operation START --only-started-by-me true
ml-cli --fail-on-business-error cloudphone team-app-delete --id "$TEAM_APP_ID"
```

Creation supports store apps only and returns `data.id`; it does not upload custom APKs. With `isAll=false`, supply non-empty group IDs; `true` allows omitted/null groups. Installation policy `1` overwrites, `2` skips. Delete removes the team entry and preinstall scope, keeping installed device apps and data.

Settings accept `permission/keep-alive/auto-start/hide` or `PERMISSION/KEEP_ALIVE/AUTO_START/HIDE`. Operations accept `start/stop/restart/uninstall` or their uppercase forms. Flags and JSON accept those exact spellings and send uppercase API enums. Unknown values are rejected. `onlyStartedByMe` omitted/null defaults to false; `enabled` missing/null is rejected.

```bash
ml-cli --fail-on-business-error cloudphone team-app-update-setting --json-data '{"id":"123456","settingType":"KEEP_ALIVE","enabled":true}' --enabled false
```

Version/settings writes return `data=null`; this confirms saving, not device completion. Version, permission and auto-start apply through startup rules; keep-alive/hide may also be dispatched asynchronously by the backend. Batch `data=true` does not guarantee every device succeeded. The CLI does not boot phones, retry writes or poll automatically. Batch uninstall can remove device app data but preserves team preinstall configuration. Read back settings with `team-app-list`; verify device effects separately.

## Cloud Storage

```bash
ml-cli cloud-storage info
ml-cli cloud-storage list --keyword video --page-no 1 --page-size 20
ml-cli cloud-storage presign --file-name video.mp4
```

Upload in three steps: presign, HTTP PUT of the binary to the returned `presignedUrl`, then `complete --id` with the returned ID. Include any returned upload headers. Run complete only after a successful PUT. If PUT is blocked by the host sandbox/network, obtain network access or have the user run the same upload locally. Presigned URLs are temporary and must not be published.

```bash
curl -f -L -X PUT --upload-file ./video.mp4 "$PRESIGNED_URL"
ml-cli cloud-storage complete --id "$UPLOAD_ID"
```

```powershell
curl.exe -f -L -X PUT --upload-file .\video.mp4 "$env:PRESIGNED_URL"
ml-cli cloud-storage complete --id "$env:UPLOAD_ID"
```

```bash
ml-cli cloud-storage labels
ml-cli cloud-storage label-create --label-name automation --color "#2F80ED"
ml-cli cloud-storage label-update --label-id "$LABEL_ID" --label-name automation-ready --color "#27AE60"
ml-cli cloud-storage file-labels --file-id "$FILE_ID"
ml-cli cloud-storage add-labels --file-id "$FILE_ID" --tag-id "$LABEL_ID"
ml-cli cloud-storage set-labels --file-id "$FILE_ID" --tag-id "$LABEL_ID"
ml-cli cloud-storage label-delete --label-id "$LABEL_ID"
ml-cli cloud-storage delete --file-id "$FILE_ID"
```

RPA can reference uploaded storage files as `morelogin://cloudfile?ids=<fileId>` or multiple IDs separated by commas. Preserve the required `__Extra__` metadata in RPA parameters. Use `schedule template-market/template-personal/list/create-once-task/cancel/subtask-list/subtask-detail/subtask-cancel` for scheduling and execution queries.

## Cloud Browsers

```bash
ml-cli cloud-browser list --page-no 1 --page-size 10
ml-cli --timeout 30 cloud-browser start --env-id "$ENV_ID"
ml-cli cloud-browser connect --env-id "$ENV_ID"
ml-cli cloud-browser stop --env-id "$ENV_ID" --force false
```

These commands manage remote cloud-browser runtimes, unlike `env start/open`, which controls local browser profiles. Start/stop/connect use their own flags and JSON contracts; inspect help before reusing an environment ID or port.

## Groups, Tags, Proxies and Response Metadata

```bash
ml-cli group list
ml-cli tag list
ml-cli proxy list
ml-cli env set-group --help
ml-cli env set-proxy --help
ml-cli env set-remark --help
```

List/detail responses may include `groupName` (null when ungrouped), `tagInfos` (empty array when untagged), and browser `envRemark`. Tag IDs remain strings. Table output prioritizes these fields; JSON retains nested structures. Group/tag/proxy create, edit and delete flags are all listed in [Commands](/cli/commands).