{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"AI Agent Usage"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"ai-agent-usage","__idx":0},"children":["AI Agent Usage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set up an AI coding assistant to drive MoreLogin through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ml-cli"]},", then control browser profiles and cloud phones in plain language."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Works with Codex, Claude Code, Cursor, Gemini CLI, and any other assistant that can run shell commands."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Looking for a different integration route? Use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/mcp/overview"},"children":["MCP"]}," for MCP-capable clients, or"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/skills"},"children":["Agent Skills"]}," for OpenClaw and Hermes. See the"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ai-agent-integrations"},"children":["route comparison"]}," if you are not sure which to pick."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-1-give-your-agent-the-setup-prompt","__idx":1},"children":["Step 1: Give your agent the setup prompt"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Paste this into your assistant. It installs and verifies MoreLogin CLI without further hand-holding."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"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.\n\nFollow the MoreLogin installation, verification, and `ml-cli` usage guide:\nhttps://github.com/MoreLoginBrowser/morelogin-skills/blob/main/skills/morelogin-setup/install.md\n\nKeep commands, paths, JSON/API fields, and original MoreLogin responses unchanged. Ask before permissions, login/security steps, downloads, installation, GUI launches, or state changes.\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the CLI is already installed, generate the same prompt from it:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"ml-cli install-prompt\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-2-point-the-agent-at-the-built-in-guide","__idx":2},"children":["Step 2: Point the agent at the built-in guide"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"ml-cli agent-guide\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is the agent's reference, not yours. It covers when to reach for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["connect EPERM 127.0.0.1:40000"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If your agent runs in a sandbox that blocks loopback connections, that ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EPERM"]}," error is the signal. Grant the agent local network access or run it outside the sandbox."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-3-verify-connectivity","__idx":3},"children":["Step 3: Verify connectivity"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"ml-cli doctor\nml-cli doctor --output-json\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["doctor"]}," discovers the local API port and calls the MoreLogin status endpoint. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--output-json"]}," when you want the agent to parse the result instead of reading it."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Requires the MoreLogin desktop client to be running and signed in."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"name-based-lookup-and-why-it-is-safe","__idx":4},"children":["Name-based lookup, and why it is safe"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Users say \"open P-1\", not \"open 1993244721490239488\". The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["find"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["open"]}," commands accept names, and they refuse to guess:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"ml-cli env find --name P-1\nml-cli env find --keyword Amazon\nml-cli env open --name P-1\nml-cli env open --name P-1 --exact\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--keyword"]}," matches profile name, group name, tag name, and remark. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--name"]}," matches the profile name; add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--exact"]}," to require an exact match."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Cloud phones follow the same rule:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"ml-cli cloudphone find --keyword \"android-test\"\nml-cli --timeout 120 cloudphone open --name CP-1\nml-cli --timeout 120 cloudphone open --name CP-1 --headless false\nml-cli --timeout 30 cloudphone close --name CP-1\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Cloud phone operations are slow, so pass ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--timeout"]},". For ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--headless"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," shows the window and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," hides it; the API default is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},"."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-you-can-ask","__idx":5},"children":["What you can ask"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"browser-profiles","__idx":6},"children":["Browser profiles"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Ask"},"children":["Ask"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What the agent does"},"children":["What the agent does"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["How many browser profiles are on the first page?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Lists page 1 and counts"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Show profile name, ID, and status for the first page"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Lists page 1 with fields"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Open the P-1 profile"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Resolves the name, then starts it"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Is P-1 already running?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Checks run status before acting"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Close the P-1 profile"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Stops it"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Start the first profile and tell me the debug port"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Starts it and returns the CDP debug port"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"search-by-name-group-tag-or-remark","__idx":7},"children":["Search by name, group, tag, or remark"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Ask"},"children":["Ask"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What the agent does"},"children":["What the agent does"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Find profiles whose names contain Amazon"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["env find --name"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Find profiles where name, group, tag, or remark contains Amazon"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["env find --keyword"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Open the profile whose group or tag contains Amazon; show candidates if more than one"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["env open --keyword"]},", stops on ambiguity"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"cloud-phones","__idx":8},"children":["Cloud phones"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Ask"},"children":["Ask"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What the agent does"},"children":["What the agent does"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Show me the cloud phone list"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Lists cloud phones"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Open the CP-1 cloud phone"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Resolves the name, then powers on"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Find cloud phones whose group, tag, or remark contains Android"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cloudphone find --keyword"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Open the cloud phone matching CP-204 and display the window"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Opens with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--headless false"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Close the CP-1 cloud phone"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Powers off"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"shared-resources","__idx":9},"children":["Shared resources"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Ask"},"children":["Ask"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What the agent does"},"children":["What the agent does"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Show me all groups"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Lists groups"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Show me all tags"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Lists tags"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Show me the first page of proxy records"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Lists proxies"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"discovery","__idx":10},"children":["Discovery"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Ask"},"children":["Ask"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What the agent does"},"children":["What the agent does"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Read ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ml-cli"]}," help and summarize the common profile commands"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Reads help output and summarizes"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Asking the agent to read its own help is the reliable way to handle a command this page does not cover."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":11},"children":["Next steps"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Topic"},"children":["Topic"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Where"},"children":["Where"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Full command and flag reference"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/cli/commands"},"children":["CLI Commands"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Installing and configuring the CLI"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/cli/quick-start"},"children":["CLI Quick Start"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["CLI-side view of this guide"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/cli/agent"},"children":["CLI AI Agent Usage"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Underlying HTTP endpoints"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/browser/local-api"},"children":["Browser Local API"]}]}]}]}]}]}]},"headings":[{"value":"AI Agent Usage","id":"ai-agent-usage","depth":1},{"value":"Step 1: Give your agent the setup prompt","id":"step-1-give-your-agent-the-setup-prompt","depth":2},{"value":"Step 2: Point the agent at the built-in guide","id":"step-2-point-the-agent-at-the-built-in-guide","depth":2},{"value":"Step 3: Verify connectivity","id":"step-3-verify-connectivity","depth":2},{"value":"Name-based lookup, and why it is safe","id":"name-based-lookup-and-why-it-is-safe","depth":2},{"value":"What you can ask","id":"what-you-can-ask","depth":2},{"value":"Browser profiles","id":"browser-profiles","depth":3},{"value":"Search by name, group, tag, or remark","id":"search-by-name-group-tag-or-remark","depth":3},{"value":"Cloud phones","id":"cloud-phones","depth":3},{"value":"Shared resources","id":"shared-resources","depth":3},{"value":"Discovery","id":"discovery","depth":3},{"value":"Next steps","id":"next-steps","depth":2}],"frontmatter":{"seo":{"title":"AI Agent Usage"}},"lastModified":"2026-09-02T11:22:17.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ai-agent-integrations/agent-usage","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}