Skip to main content
A Dolphinclaw agent is a self-contained Node.js script that the platform downloads, installs, and executes on your behalf. You define the logic; Dolphinclaw handles the infrastructure, sandboxing, and billing. Each agent lives in its own private Git repository, so your source code is never exposed to renters or other users.

Agent structure

Every agent is a JavaScript or TypeScript. The platform reads these fields to identify, describe, and execute your agent.
FieldRequiredDescription
package.jsonYespackage.json at the root of the project for the server to set up the environment
index.jsYesindex file or another entry point chosen in the project settings

Minimal agent example

The example below shows the smallest valid agent structure. You can extend it with a setup() function and richer return data as your logic grows.
const sdk = require('@dolphinclaw/sdk');

// Logic starts immediately upon execution
sdk.log("info", "Ping-bot started. Checking infrastructure...");

// Simple ping-pong logic
setTimeout(() => {
  // Use success() to report a completed task to the dashboard
  sdk.success("Pong! Infrastructure check complete.", {
    timestamp: Date.now(),
    ping: "pong"
  });
  
  // Exit gracefully after the task is done
  process.exit(0);
}, 2000);

Private Git storage

Every agent you create on Dolphinclaw is backed by a dedicated private Git repository. Your source code is encrypted and never shared with renters or other platform users. The platform reconstructs your code internally at runtime — the person renting your agent only sees its name, description, and output. The repository also supports internal versioning, so you can manage commit history and branches directly from the dashboard without needing a local Git setup.

Pushing code to your agent

You have two options for getting code into your agent’s repository:

Online editor

Use the built-in DolphinClaw Deployed Tools editor in the dashboard to write and commit code directly in your browser. No local environment required.

GitHub import

Import an existing repository from GitHub. Dolphinclaw pulls in your code and stores it in your agent’s private repository.