Skip to content
Last updated

AI Agent Usage

Set up an AI coding assistant to drive MoreLogin through ml-cli, then control browser profiles and cloud phones in plain language.

Works with Codex, Claude Code, Cursor, Gemini CLI, and any other assistant that can run shell commands.

Looking for a different integration route? Use MCP for MCP-capable clients, or Agent Skills for OpenClaw and Hermes. See the route comparison if you are not sure which to pick.


Step 1: Give your agent the setup prompt

Paste this into your assistant. It installs and verifies MoreLogin CLI without further hand-holding.

This template's language is not my preference. Before your first substantive reply, detect and use my OS UI language (Windows: `Get-UICulture`, then `Get-Culture`); if unavailable, use my latest non-template message's language.

Follow the MoreLogin installation, verification, and `ml-cli` usage guide:
https://github.com/MoreLoginBrowser/morelogin-skills/blob/main/skills/morelogin-setup/install.md

Keep commands, paths, JSON/API fields, and original MoreLogin responses unchanged. Ask before permissions, login/security steps, downloads, installation, GUI launches, or state changes.

If the CLI is already installed, generate the same prompt from it:

ml-cli install-prompt

The last paragraph matters: it tells the agent to preserve MoreLogin responses verbatim and to stop and ask before anything that changes state. Keep it.

Step 2: Point the agent at the built-in guide

ml-cli agent-guide

This is the agent's reference, not yours. It covers when to reach for ml-cli, how to discover command formats, how to map a natural-language request to a command, when to pause for confirmation, and how to recover from local sandbox failures such as connect EPERM 127.0.0.1:40000.

If your agent runs in a sandbox that blocks loopback connections, that EPERM error is the signal. Grant the agent local network access or run it outside the sandbox.

Step 3: Verify connectivity

ml-cli doctor
ml-cli doctor --output-json

doctor discovers the local API port and calls the MoreLogin status endpoint. Use --output-json when you want the agent to parse the result instead of reading it.

Requires the MoreLogin desktop client to be running and signed in.


Name-based lookup, and why it is safe

Users say "open P-1", not "open 1993244721490239488". The find and open commands accept names, and they refuse to guess:

ml-cli env find --name P-1
ml-cli env find --keyword Amazon
ml-cli env open --name P-1
ml-cli env open --name P-1 --exact

--keyword matches profile name, group name, tag name, and remark. --name matches the profile name; add --exact to require an exact match.

open acts only when exactly one profile matches. On multiple matches it prints the candidates and exits without starting anything. This is the behavior that makes it safe to hand to an agent: an ambiguous request never silently starts the wrong profile.

Cloud phones follow the same rule:

ml-cli cloudphone find --keyword "android-test"
ml-cli --timeout 120 cloudphone open --name CP-1
ml-cli --timeout 120 cloudphone open --name CP-1 --headless false
ml-cli --timeout 30 cloudphone close --name CP-1

Cloud phone operations are slow, so pass --timeout. For --headless, false shows the window and true hides it; the API default is true.


What you can ask

Browser profiles

AskWhat the agent does
How many browser profiles are on the first page?Lists page 1 and counts
Show profile name, ID, and status for the first pageLists page 1 with fields
Open the P-1 profileResolves the name, then starts it
Is P-1 already running?Checks run status before acting
Close the P-1 profileStops it
Start the first profile and tell me the debug portStarts it and returns the CDP debug port

Search by name, group, tag, or remark

AskWhat the agent does
Find profiles whose names contain Amazonenv find --name
Find profiles where name, group, tag, or remark contains Amazonenv find --keyword
Open the profile whose group or tag contains Amazon; show candidates if more than oneenv open --keyword, stops on ambiguity

Cloud phones

AskWhat the agent does
Show me the cloud phone listLists cloud phones
Open the CP-1 cloud phoneResolves the name, then powers on
Find cloud phones whose group, tag, or remark contains Androidcloudphone find --keyword
Open the cloud phone matching CP-204 and display the windowOpens with --headless false
Close the CP-1 cloud phonePowers off

Shared resources

AskWhat the agent does
Show me all groupsLists groups
Show me all tagsLists tags
Show me the first page of proxy recordsLists proxies

Discovery

AskWhat the agent does
Read ml-cli help and summarize the common profile commandsReads help output and summarizes

Asking the agent to read its own help is the reliable way to handle a command this page does not cover.


Next steps

TopicWhere
Full command and flag referenceCLI Commands
Installing and configuring the CLICLI Quick Start
CLI-side view of this guideCLI AI Agent Usage
Underlying HTTP endpointsBrowser Local API