# Hermes Agent Integration

**Hermes Agent** is another flexible agent framework. Integrating the MoreLogin skill into Hermes allows it to seamlessly manage browser profiles and interact with cloud phones.

## Installation & Setup

### 1. Download the Skill

Since Hermes might not use the same workspace structure as OpenClaw, you can pull the official MoreLogin skill repository directly into your Hermes tools/plugins directory:

```bash
git clone https://github.com/MoreLoginBrowser/morelogin-local-api-skill.git
cd morelogin-local-api-skill
npm install
```

### 2. Configure Hermes Tools Registry

To register the MoreLogin CLI as a tool for Hermes, define it in your agent's configuration or tool registry. For example, you can expose the underlying `node bin/morelogin.js` command.

```yaml
# Example Hermes Tool Definition
tools:
  - name: morelogin_manager
    description: "Manage MoreLogin browser profiles and cloud phones."
    command: "node /path/to/morelogin-local-api-skill/bin/morelogin.js"
    env:
      LOCAL_API_URL: "http://localhost:40000"
```

## CLI Usage & Commands

Hermes will invoke the skill using Node.js directly. You can also test these commands in your terminal to ensure the skill is installed correctly.

### Browser Profiles

```bash
# List profiles
node bin/morelogin.js browser list --page 1 --page-size 20

# Start a profile (Returns debugPort for CDP connection)
node bin/morelogin.js browser start --env-id abc123def

# View running status
node bin/morelogin.js browser status --env-id abc123def

# Close profile
node bin/morelogin.js browser close --env-id abc123def
```

### Cloud Phones

```bash
# List cloud phones
node bin/morelogin.js cloudphone list --page 1 --page-size 20

# Start/Stop
node bin/morelogin.js cloudphone start --id <cloudPhoneId>
node bin/morelogin.js cloudphone stop --id <cloudPhoneId>

# Get details (Includes ADB connection info)
node bin/morelogin.js cloudphone info --id <cloudPhoneId>

# Execute cloud phone command via ADB
node bin/morelogin.js cloudphone exec --id <cloudPhoneId> --command "ls /sdcard"
```

### Proxy Management

```bash
# Query proxy list
node bin/morelogin.js proxy list --page 1 --page-size 20

# Add proxy
node bin/morelogin.js proxy add --payload '{"proxyIp":"1.2.3.4","proxyPort":8000,"proxyType":0}'
```

## How Hermes Reasons

When instructing your Hermes Agent, you can use natural language:

> *"Start my MoreLogin profile 'abc123def', wait for the debug port, and connect via CDP to take a screenshot."*


Hermes will:

1. Execute `node bin/morelogin.js browser start --env-id abc123def`.
2. Parse the JSON response to extract the `debugPort`.
3. Use a headless automation library (if configured in Hermes) to connect to `http://127.0.0.1:<debugPort>`.