MoreLogin Local API Skill
Manage browser profiles and cloud phones via MoreLogin official Local API, supporting full lifecycle control, automation connections (CDP/ADB), and resource management (proxy/group/tag/app/file).
Official Sources
- - Local API documentation: https://guide.morelogin.com/api-reference/local-api
- Base URL: INLINECODE0
- Requirements: MoreLogin Desktop
v2.15.0+, logged-in local account
Trigger Scenarios
Prefer this Skill when:
- - User mentions
MoreLogin, envId, uniqueId, INLINECODE5 - Creating/starting/closing browser profiles
- Refreshing fingerprints, clearing cache, or deleting profiles
- Cloud phone power on/off, ADB, app management, file upload
- API management of proxy, groups, tags
Pre-flight Checklist
Before any operation:
- 1. Confirm MoreLogin desktop app is running and logged in.
- Confirm API is reachable:
http://127.0.0.1:40000. - Confirm requests originate from localhost (Local API does not support remote access).
- For cloud phone command execution, confirm ADB is available (
adb installed).
Execution Principles
- - Treat
local-api.yaml + API-CONTRACT.md as the canonical parameter source before constructing payloads. - Do not infer field names from memory; verify required keys/types first (especially
id vs ids, object vs array bodies). - Use
POST by default (except tag query GET /api/envtag/all). - Uniform request header:
Content-Type: application/json. - Check
code first: 0 means success, non-zero use msg for error handling. - Prefer
envId for resource lookup; fall back to uniqueId when missing (browser profiles). - For batch endpoints (
/batch), always pass arrays and record changed objects.
API Capability Mapping
Browser Profile
| Endpoint | Purpose |
|---|
| INLINECODE21 | Quick create profile |
| INLINECODE22 |
Advanced create (full fingerprint params) |
|
POST /api/env/fingerprint/refresh | Refresh device fingerprint |
|
POST /api/env/start | Start profile and return debug info |
|
POST /api/env/close | Close running profile |
|
POST /api/env/status | Get run status and debug info |
|
POST /api/env/page | Paginated profile list |
|
POST /api/env/detail | Get single profile detail |
|
POST /api/env/removeLocalCache | Clear local cache (cookies/localStorage etc.) |
|
POST /api/env/removeToRecycleBin/batch | Batch delete to recycle bin |
Cloud Phone
| Endpoint | Purpose |
|---|
| INLINECODE31 | Create cloud phone |
| INLINECODE32 |
Power on |
|
POST /api/cloudphone/powerOff | Power off |
|
POST /api/cloudphone/page | Paginated list |
|
POST /api/cloudphone/info | Get detail (including ADB info) |
|
POST /api/cloudphone/edit/batch | Batch edit config |
|
POST /api/cloudphone/delete/batch | Batch delete |
|
POST /api/cloudphone/newMachine | One-click new device |
|
POST /api/cloudphone/updateAdb | Enable/disable ADB |
Cloud Phone File & App
| Endpoint | Purpose |
|---|
| INLINECODE40 | Upload file to cloud phone |
| INLINECODE41 |
Query upload status |
|
POST /api/cloudphone/setKeyBox | Set Keybox |
|
POST /api/cloudphone/app/install | Install app |
|
POST /api/cloudphone/app/page | Query app market list |
|
POST /api/cloudphone/app/installedList | Query installed apps |
|
POST /api/cloudphone/app/start | Start app |
|
POST /api/cloudphone/app/restart | Restart app |
|
POST /api/cloudphone/app/stop | Stop app |
|
POST /api/cloudphone/app/uninstall | Uninstall app |
Proxy / Group / Tag
| Endpoint | Purpose |
|---|
| INLINECODE50 | Query proxy list |
| INLINECODE51 |
Add proxy |
|
POST /api/proxyInfo/update | Update proxy |
|
POST /api/proxyInfo/delete | Delete proxy |
|
POST /api/envgroup/page | Query groups |
|
POST /api/envgroup/create | Create group |
|
POST /api/envgroup/edit | Edit group |
|
POST /api/envgroup/delete | Delete group |
|
GET /api/envtag/all | Get all tags |
|
POST /api/envtag/create | Create tag |
|
POST /api/envtag/edit | Edit tag |
|
POST /api/envtag/delete | Delete tag |
Standard Workflows
Workflow A: Browser Profile Automation
- 1. Get
envId from create/quick or page. - Call
start to launch the profile. - Call
status to verify run state and debugPort. - Use CDP (Puppeteer/Playwright) for automation.
- Call
close when done.
Workflow B: Cloud Phone Automation
- 1. Call
page or create to obtain cloud phone id. - Call
powerOn to start. - Call
info to get ADB connection params. - Call
updateAdb when needed to enable ADB. - Run supported cloud phone management endpoints only (no direct command execution).
- Call
powerOff when done.
Quick Examples (Official API)
CODEBLOCK0
CLI Usage (This Project)
Prefer project-wrapped commands; fall back to curl when needed:
Entry equivalence note: openclaw morelogin ... and node bin/morelogin.js ... are fully equivalent (same arguments, same behavior, same exit code). Use either one based on your runtime environment.
CODEBLOCK1 json
{
"code": 0,
"msg": null,
"data": {},
"requestId": "..."
}
``
Handling rules:
- code == 0: Proceed, extract data.
- code != 0: Output msg, mark failed step, suggest next fix.
- For start/powerOn operations, call status/info again before subsequent steps to confirm.
## Security & Limits
- Local API listens on localhost only; no remote access.
- Can be called only when MoreLogin account is logged in.
- Do not expose account, proxy passwords, ADB keys, or other sensitive data in logs or code.
- Double-check target ID lists before batch delete, cache clear, or app uninstall.
## Security Notice
This skill no longer provides local ADB/SSH connection methods (adb-connect, adb-disconnect, adb-devices).
Command execution safeguards:
- Restricted to local automation context (localhost workflows and local API).
- Remote cloud phone exec is disabled by default and must be explicitly enabled.
- exec command content is validated against a safe allowlist and blocks shell metacharacters.
- Generic api passthrough is endpoint-allowlisted by default.
## When Not to Use This Skill
- MoreLogin is not installed, not running, or not logged in.
- Requirements are for regular browser automation (no MoreLogin environment isolation).
- Requirements depend on remote access to Local API over the network.
## Related Files
- bin/morelogin.js
- lib/api.js
- local-api.yaml
- API-CONTRACT.md
- README-OFFICIAL-API.md`
MoreLogin 本地 API 技能
通过 MoreLogin 官方本地 API 管理浏览器配置文件和云手机,支持全生命周期控制、自动化连接(CDP/ADB)和资源管理(代理/分组/标签/应用/文件)。
官方来源
- - 本地 API 文档:https://guide.morelogin.com/api-reference/local-api
- 基础 URL:http://127.0.0.1:40000
- 要求:MoreLogin 桌面版 v2.15.0+,已登录本地账户
触发场景
优先使用此技能的场景:
- - 用户提及 MoreLogin、envId、uniqueId、cloudphone
- 创建/启动/关闭浏览器配置文件
- 刷新指纹、清除缓存或删除配置文件
- 云手机开机/关机、ADB、应用管理、文件上传
- 代理、分组、标签的 API 管理
操作前检查清单
执行任何操作前:
- 1. 确认 MoreLogin 桌面应用正在运行并已登录。
- 确认 API 可访问:http://127.0.0.1:40000。
- 确认请求来自本地主机(本地 API 不支持远程访问)。
- 对于云手机命令执行,确认 ADB 可用(已安装 adb)。
执行原则
- - 在构建请求体之前,将 local-api.yaml + API-CONTRACT.md 视为标准参数来源。
- 不要凭记忆推断字段名称;先验证必需的键/类型(特别是 id 与 ids、对象与数组体)。
- 默认使用 POST(标签查询 GET /api/envtag/all 除外)。
- 统一请求头:Content-Type: application/json。
- 首先检查 code:0 表示成功,非零值使用 msg 进行错误处理。
- 优先使用 envId 查找资源;缺失时回退到 uniqueId(浏览器配置文件)。
- 对于批量端点(/batch),始终传递数组并记录变更的对象。
API 能力映射
浏览器配置文件
| 端点 | 用途 |
|---|
| POST /api/env/create/quick | 快速创建配置文件 |
| POST /api/env/create/advanced |
高级创建(完整指纹参数) |
| POST /api/env/fingerprint/refresh | 刷新设备指纹 |
| POST /api/env/start | 启动配置文件并返回调试信息 |
| POST /api/env/close | 关闭运行中的配置文件 |
| POST /api/env/status | 获取运行状态和调试信息 |
| POST /api/env/page | 分页配置文件列表 |
| POST /api/env/detail | 获取单个配置文件详情 |
| POST /api/env/removeLocalCache | 清除本地缓存(cookies/localStorage 等) |
| POST /api/env/removeToRecycleBin/batch | 批量删除到回收站 |
云手机
| 端点 | 用途 |
|---|
| POST /api/cloudphone/create | 创建云手机 |
| POST /api/cloudphone/powerOn |
开机 |
| POST /api/cloudphone/powerOff | 关机 |
| POST /api/cloudphone/page | 分页列表 |
| POST /api/cloudphone/info | 获取详情(包括 ADB 信息) |
| POST /api/cloudphone/edit/batch | 批量编辑配置 |
| POST /api/cloudphone/delete/batch | 批量删除 |
| POST /api/cloudphone/newMachine | 一键新设备 |
| POST /api/cloudphone/updateAdb | 启用/禁用 ADB |
云手机文件与应用
| 端点 | 用途 |
|---|
| POST /api/cloudphone/uploadFile | 上传文件到云手机 |
| POST /api/cloudphone/uploadUrl |
查询上传状态 |
| POST /api/cloudphone/setKeyBox | 设置 Keybox |
| POST /api/cloudphone/app/install | 安装应用 |
| POST /api/cloudphone/app/page | 查询应用市场列表 |
| POST /api/cloudphone/app/installedList | 查询已安装应用 |
| POST /api/cloudphone/app/start | 启动应用 |
| POST /api/cloudphone/app/restart | 重启应用 |
| POST /api/cloudphone/app/stop | 停止应用 |
| POST /api/cloudphone/app/uninstall | 卸载应用 |
代理 / 分组 / 标签
| 端点 | 用途 |
|---|
| POST /api/proxyInfo/page | 查询代理列表 |
| POST /api/proxyInfo/add |
添加代理 |
| POST /api/proxyInfo/update | 更新代理 |
| POST /api/proxyInfo/delete | 删除代理 |
| POST /api/envgroup/page | 查询分组 |
| POST /api/envgroup/create | 创建分组 |
| POST /api/envgroup/edit | 编辑分组 |
| POST /api/envgroup/delete | 删除分组 |
| GET /api/envtag/all | 获取所有标签 |
| POST /api/envtag/create | 创建标签 |
| POST /api/envtag/edit | 编辑标签 |
| POST /api/envtag/delete | 删除标签 |
标准工作流程
工作流程 A:浏览器配置文件自动化
- 1. 从 create/quick 或 page 获取 envId。
- 调用 start 启动配置文件。
- 调用 status 验证运行状态和 debugPort。
- 使用 CDP(Puppeteer/Playwright)进行自动化操作。
- 完成后调用 close。
工作流程 B:云手机自动化
- 1. 调用 page 或 create 获取云手机 id。
- 调用 powerOn 启动。
- 调用 info 获取 ADB 连接参数。
- 需要时调用 updateAdb 启用 ADB。
- 仅运行支持的云手机管理端点(不直接执行命令)。
- 完成后调用 powerOff。
快速示例(官方 API)
bash
1) 快速创建浏览器配置文件
curl -X POST http://127.0.0.1:40000/api/env/create/quick \
-H Content-Type: application/json \
-d {browserTypeId:1,operatorSystemId:1,quantity:1}
2) 启动配置文件
curl -X POST http://127.0.0.1:40000/api/env/start \
-H Content-Type: application/json \
-d {envId:
}
3) 云手机开机
curl -X POST http://127.0.0.1:40000/api/cloudphone/powerOn \
-H Content-Type: application/json \
-d {id:}
4) 查询云手机详情(包括 ADB 信息)
curl -X POST http://127.0.0.1:40000/api/cloudphone/info \
-H Content-Type: application/json \
-d {id:}
CLI 使用(本项目)
优先使用项目封装的命令;必要时回退到 curl:
入口等价说明:openclaw morelogin ... 和 node bin/morelogin.js ... 完全等价(相同参数、相同行为、相同退出码)。根据运行环境选择使用。
bash
浏览器配置文件
openclaw morelogin browser list
openclaw morelogin browser start --env-id
openclaw morelogin browser status --env-id
openclaw morelogin browser close --env-id
云手机
openclaw morelogin cloudphone list
openclaw morelogin cloudphone start --id
openclaw morelogin cloudphone info --id
响应与错误处理
按以下结构解析响应:
json
{
code: 0,
msg: null,
data: {},
requestId: ...
}
处理规则:
- - code == 0:继续执行,提取 data。
- code != 0:输出 msg,标记失败步骤,建议下一步修复。
- 对于 start/powerOn 操作,在后续步骤前再次调用 status/info 确认。
安全与限制
- - 本地 API 仅在 localhost 监听;不支持远程访问。
- 仅在 MoreLogin 账户已登录时才能调用。