Skip to content
Last updated

AI Agent Usage

This page explains how to use ml-cli with AI coding assistants such as Codex, Claude Code, Cursor, Gemini CLI, and others.


Copy to Agent

Copy the prompt below and paste it into your AI assistant to set up MoreLogin CLI automatically:

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.

You can also generate the same prompt from an installed CLI:

ml-cli install-prompt

Agent Guide Command

After installation, agents should read the built-in guide:

ml-cli agent-guide

The guide tells the agent:

  • when to use ml-cli
  • how to discover command formats
  • how to map natural language to commands
  • when to ask for confirmation
  • how to handle local sandbox errors such as connect EPERM 127.0.0.1:40000

Doctor Command

Use doctor to verify local API connectivity:

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

doctor checks port discovery and calls the MoreLogin local status endpoint.

Browser Profile Convenience Commands

Use these commands when users refer to profiles by name:

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

env find --keyword searches environment name, group name, tag name, and remark through the MoreLogin Local API. env open starts the profile only when exactly one candidate matches. If multiple profiles match, it prints the candidates and exits without starting anything.

Cloud Phone Convenience Commands

Use these commands when users refer to cloud phones by name:

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

cloudphone find --keyword searches cloud phone name, group name, tag name, and remark through the MoreLogin Local API. cloudphone open and cloudphone close operate only when exactly one candidate matches. If multiple cloud phones match, they print the candidates and exit without changing state. For --headless, false displays the Cloud Phone window, and true does not display it. The API default is true.

Natural Language Examples

After setup, you can ask:

How many browser profiles are on the first page in MoreLogin?
Show me the first page of MoreLogin browser profiles, including profile name, ID, and status.
Open the P-1 profile.
Check whether the P-1 profile is already running.
Close the P-1 profile.
Find browser profiles whose names contain Amazon.
Find browser profiles where the environment name, group name, tag name, or remark contains Amazon.
Open the browser environment whose group or tag contains Amazon. If there is more than one, show candidates first.
Start the first browser profile and tell me the debug port.
Show me all MoreLogin groups.
Show me all MoreLogin tags.
Show me the first page of proxy records.
Show me the cloud phone list.
Open the CP-1 cloud phone.
Find cloud phones whose group, tag, or remark contains Android.
Open the cloud phone whose name, group, tag, or remark contains CP-204 and display the window.
Close the CP-1 cloud phone.
Read ml-cli help and summarize the common browser profile commands.