OpenClaw Integration

NextPay Skill Definition

How to define the NextPay CLI as an OpenClaw skill

NextPay Skill Definition

OpenClaw agents discover tools through skill definitions — YAML files that describe a CLI tool, how to invoke it, and how to discover its capabilities.

Skill YAML

Create a file named nextpay.yaml in your OpenClaw skills directory:

name: nextpay
description: >
  Manage NextPay financial operations — directory contacts, payouts,
  invoices, team members, audit logs, and more.
binary: nextpay
capabilities_command: nextpay capabilities
auth:
  env:
    - NEXTPAY_API_KEY
    - NEXTPAY_ENV
output_format: json
examples:
  - name: List all contacts
    command: nextpay --env dev directory list --type person
  - name: Add a new contact
    command: >
      nextpay --env dev directory create --type person
      --fields '{"first_name":"Maria","last_name":"Santos","email":"maria@example.com"}'
  - name: List workspace members
    command: nextpay --env dev workspace members list
  - name: Check audit logs
    command: nextpay --env dev audit list --limit 10

How it works

  1. Discovery — When the agent starts, OpenClaw reads the skill YAML and runs nextpay capabilities to get a full JSON description of all available commands and arguments.

  2. Planning — When the agent decides it needs to perform a NextPay operation, it uses the capabilities data to construct the correct command with appropriate flags.

  3. Execution — OpenClaw runs the command in a sandboxed shell and captures the JSON output from stdout.

  4. Parsing — The agent parses the JSON response and uses the data to make decisions or continue the workflow.

Capabilities command

The capabilities_command field is the key integration point. It tells OpenClaw how to discover what the tool can do. The nextpay capabilities command returns a JSON document like:

{
  "commands": [
    {
      "name": "directory list",
      "description": "List directory entries with optional filtering",
      "args": [
        {"name": "--type", "values": ["person", "organization"]},
        {"name": "--limit", "default": "25"}
      ]
    }
  ]
}

This means the agent always has an up-to-date understanding of the CLI, even after updates.