On this page

On this page

CLI commands

Templates

openclaw templates

A Template is a portable setup for a new OpenClaw agent. It can include agent instructions, workspace files, skills, plugins, MCP servers, and automations. Add is a one-way action: it creates an ordinary agent and installs its requirements. It does not create an installed Template to manage. Adding the same Template again creates another agent.

After Add, manage the agent with agent commands, its automations with cron commands, and shared dependencies with their ordinary plugin or MCP controls. There are no Template status, update, remove, or export commands. To use a newer release, Add it as another agent. Agents enrolled by the earlier installed-Template lifecycle can be released to ordinary agents.

Templates are available by default, with no Labs or replacement settings switch. Open Customize → Templates to browse and review them. The historical gateway.controlUi.experimental.templates setting remains an advanced opt-out: an explicit false stays off on upgrade; unset or true permits discovery and Add. Set it to true or remove an existing false to enable Templates again. Authoring and inspecting local Template packages are independent of this setting.

templates add accepts a ClawHub Template reference (@publisher/slug), a canonical local package directory, or CLAW.md with YAML frontmatter. The reference uses the publisher's ClawHub handle, as skill references do, including for a Template whose package name is the unscoped slug. Other source-reading commands remain local-only. Packages must declare package.json.openclaw.template as a safe package-relative path whose filename is CLAW.md, such as CLAW.md or nested/CLAW.md. Local project commands require CLAW.md at the package root. The obsolete openclaw.claw selector and JSON Template manifests are rejected, including in downloaded archives. CLAW.md and package.json must contain valid UTF-8. If inspection reports an encoding error, re-encode the source file as UTF-8 and retry; Add refuses it before creating an agent or workspace. Publishing and searching Templates through ClawHub use the separate registry surface. The Control UI can browse official and community Templates from Customize → Templates at /templates without a Labs opt-in.

Add an unpublished local project to a running Gateway

bash
openclaw templates add ./incident-triage --json

When a local Gateway owns the state directory, Add forwards the canonical local project directory to that Gateway's existing installation owner. No publication or Gateway restart is required. The path must be accessible on the Gateway host; this is not a browser upload or a remote file transfer. Online Add requires operator-admin authority and a canonical project accepted by templates validate. Online Add selects the workspace on the Gateway and rejects --workspace. Offline Add retains its existing local-source behavior.

The Gateway builds a snapshot containing only declared project files, reviews its exact artifact integrity, and retains that artifact before installation. A project changed between preview and apply must be reviewed again. Local content is not published to or scanned by ClawHub; dependencies still use their existing registry verification and consent checks. Online plugin installation requires --accept-capabilities; dependency trust warnings additionally require --acknowledge-clawhub-risk. Review dependencies before passing these flags.

API clients can preview with templates.add.plan and apply with templates.add.apply, using source: { kind: "local", path: "/absolute/project" }. Pass the returned planIntegrity and any required dependency acknowledgements to apply. Paths refer to directories on the Gateway host, not the caller's machine.

Import a Template archive in the Control UI

With Templates enabled, open Customize → Templates, click + Import (the Import icon in the header on mobile), and select a .tgz built with openclaw templates build. The file is read from your browser's computer, not from a path on the Gateway. Uploads are limited to 1 MiB compressed, 8 MiB extracted, and 4,096 archive entries. Unsafe paths, links, malformed archives, and invalid projects are rejected before installation.

The native file picker opens on your computer. After selecting an archive, review its proposed agent, workspace files, skills, plugins, MCP servers, automations, and required dependency consent in the shared Template card, then confirm Import. Use Back to return from an item, or Cancel to choose another archive. Choosing a file does not install it. The exact archive bytes bind the review to installation through the existing live Add owner; no publication or restart is needed. The origin and ClawHub scan status of a local file are unverified. Current operator-admin authority is required. Canceling, leaving the page, or changing the connection drops the browser's pending archive. After a successful import, the Control UI opens the new agent's chat. If the UI can't open it, choose Retry opening chat to try again without reinstalling. After an uncertain installation result, inspect the agent before uploading again.

For API clients, the same templates.add.plan and templates.add.apply methods accept source: { kind: "upload", archiveBase64: "..." }. Reuse the exact payload and the returned planIntegrity, with the normal dependency acknowledgements, for apply. No permanent upload registry is created.

Template Add logs record a correlation ID, operation stage, outcome, and duration without archive bytes or Template contents. Use the correlation ID when investigating an unsuccessful import.

Create with an agent

Ask the agent, “create a new template from this agent.” The bundled create-template skill prepares a request-specific private draft and opens review in that same conversation. No sidebar setup or special command is required. The agent proposes portable behavior with an input, job, output, and authority boundary; it does not publish, return a review link, or create or fork a session. Review requires Templates availability, an active administrator Control UI connection, and a workspace on the Gateway host. If review is unavailable, the proposal stays private.

The agent tells you when it starts, then checks its instructions, avatar, skills, plugins, and active scheduled automations together. Paused routines stay on the source agent. You'll see short messages as it chooses which skills and plugins to include and which routines belong in the Template. It writes the instructions a new owner needs, then opens the private review card. Nothing is published unless you choose Publish.

You can also describe a Template that is not this agent, for example “create a new template that uses a video plugin and, each morning at 3am, makes a short video about the pull requests merged in a repository I choose.” The same skill drafts it in the same conversation and opens the same review card. It writes the instructions and automations from your description, so an automation does not have to exist on this agent, and it leaves out this agent's avatar, routines, and any skill or plugin you did not name. A plugin or skill you name is declared only with an exact published ClawHub release; if the agent cannot find one, it says so and leaves the dependency out. Details the Template needs from whoever adds it, such as a repository or their time zone, are asked by its first-run BOOTSTRAP.md, which updates the declared automation and enables it after they agree.

The optional Create Template action in the agent's left-sidebar row menu still invokes the same skill in that agent's existing main chat. Pinned agents keep this action in a focused row menu.

The draft appears as a compact card in chat. Select Preview to inspect the exact archive files and declared skill, plugin, MCP, and automation requirements in the same review dialog used for imports. Open an item to inspect it, or use View all to inspect the archive files. Review is read-only. To change a name, description, file, or requirement, ask the agent to revise its private proposal in the same conversation, then inspect the fresh review. The agent's display name, ClawHub package slug, and authenticated publisher are separate identities. The package includes only newly authored proposal contents; it does not copy the source workspace, memories, or raw conversations. Known private paths and credential-like text are rejected. Review the remaining text for personal facts and private context.

The agent's avatar is the one exception to authored text. A proposal may name a single image in the agent's workspace, and review then shows that image on the card in place of the generic artwork. The image file itself is not copied. OpenClaw decodes it and writes a new PNG, at most 512 pixels on its longer side and 512 KiB, so metadata stored in the original file is not published. That PNG is the package's assets/icon.png, which ClawHub uses as the Template's listing icon, and the manifest maps it to avatars/avatar.png as the avatar of each agent created from the Template. It appears among the archive files without a text preview.

The image must be a PNG, JPEG, GIF, WebP, or self-contained SVG file of at most 2 MiB whose contents match its extension. Links and paths outside the workspace are refused. If the image is missing or unusable, review fails with the reason instead of falling back to the generic artwork. To publish without an avatar, ask the agent to remove it from the proposal. Changing the image after review requires a fresh review before Publish.

If you are signed out of ClawHub, select Sign in on the private draft card. When the code appears, select Copy & open ClawHub, paste the code, and approve. The same conversation shows the unpublished draft when it is ready. Cancelling or letting sign-in expire leaves the draft private.

Preview lets you inspect the reviewed artifact without uploading it. Select Publish on the card or in the preview dialog to upload that exact artifact. Neither signing in nor an agent turn authorizes publication.

The card stays in the conversation and shows Pending while ClawHub checks the submission. Select View submission to follow its progress on ClawHub. While pending, the open card checks again 30 seconds after each response. Checks stop after ClawHub confirms publication or failure. On success, the card shows Published and offers Copy link for the public listing. Others can then discover the Template and Add it as an ordinary agent.

Add through the setup helper

An agent can delegate a published ClawHub Template installation to the openclaw setup helper. The helper first uses template_review with an exact source: { packageName, version }, then proposes template_install using the returned target.agentId and planIntegrity. Required Template risk, plugin capability, and skill warning acknowledgements must match that review. Template contents are untrusted data, not instructions for the requesting agent. The host carries its result into later helper turns; users do not need to paste the review JSON.

The host uses the requesting session's existing setup-change approval policy; an agent-supplied approved: true does not authorize installation. Trust warnings require exact human approval even under Full Access. Review and installation retain the original administrator connection, cancellation, and revocation checks and use the same installer as Customize → Templates. Templates must already be enabled in Settings → Labs. The helper does not enable Labs, install local paths, publish Templates, or gain shell access.

The result names the actual agent and workspace and reports complete or partial installation, readiness requirements, and dependency and automation receipts. An absent receipt is not confirmation; a created automation may still be paused. If an agent was retained after a partial installation, inspect that agent and continue its existing setup rather than adding another copy.

Author locally

openclaw templates draft <workspace> --json initializes an empty private proposal in that workspace and returns its unique draftId and path. It does not copy source files, start a model turn, contact ClawHub, or publish. Each invocation creates a distinct proposal; retain the returned ID instead of searching for a latest draft. The bundled skill runs this command during inventory when a chat request did not arrive with a UI-created draft; otherwise it reuses the supplied draft.

Create a minimal project, validate its inputs, preview it without mutation, and build an immutable package artifact:

bash
openclaw templates create ./incident-triageopenclaw templates validate ./incident-triageopenclaw templates dev ./incident-triageopenclaw templates build ./incident-triage --out ./incident-triage-1.0.0.tgz

A package contains package.json, CLAW.md, and any files selected by its manifest. validate, dev and build require a project whose CLAW.md sits beside package.json, with openclaw.template set to "CLAW.md"; move a nested CLAW.md to the package root before validating or building. inspect and add also read a package whose selector names a nested CLAW.md. create writes only package.json and CLAW.md and refuses to merge into a nonempty directory. Project validation rejects package scripts and lifecycle hooks. dev builds the same package artifact and checks its Add requirements locally without installing packages, contacting ClawHub, starting an agent turn, enabling automations, or changing OpenClaw state. Requirements needing online preflight appear as blockers. build creates a deterministic .tgz and refuses to overwrite an existing file.

validate and build accept a project-directory symlink and resolve the canonical project root. Manifest confinement and managed source-file checks remain unchanged.

For create, omit --name and --agent-id to use default identities. Explicitly empty values are invalid and fail before project files are written.

A minimal package.json identifies the package and its manifest:

json
{  "name": "@acme/incident-triage-template",  "version": "1.0.0",  "type": "module",  "openclaw": { "template": "CLAW.md" }}

CLAW.md starts with YAML frontmatter. Its Markdown body becomes the new agent's SOUL.md:

md
---schemaVersion: 1agent:  id: incident-triage  name: Incident triagecategories: [operations, research]workspace:  bootstrapFiles: {}skills: []plugins: []mcpServers: {}automations: []--- # Incident triage Review incoming incidents, identify severity and ownership, and leavea concise handoff with evidence.

categories is optional. Declare one to three distinct lowercase slugs for catalog discovery; the receiving registry decides which category names it accepts. Categories do not change the agent's runtime behavior.

CLAW.md is the sole configuration entry point. Put native agent settings under agent, and dependencies in skills and plugins. Each entry selects either a bundled package-relative folder with path, or an exact ClawHub release with ref and version; do not combine those forms. The retired packages, profiles, and metadata.openclaw.config declarations are rejected with migration guidance. Remove the profile directory after moving its supported settings into agent; retain schemaVersion: 1.

A package may add named bootstrap files and other workspace files from package-relative sources. These go into the new agent's dedicated workspace:

yaml
workspace:  bootstrapFiles:    AGENTS.md:      source: workspace/AGENTS.md  files:    - source: workspace/reference/policy.md      path: reference/policy.md

An optional package-root BOOTSTRAP.md supplies first-run instructions. The package may also declare exact ClawHub skill and plugin requirements, MCP servers, and scheduled automations:

yaml
skills:  - path: skills/incident-checklist  - ref: incident-triage    version: 1.0.0plugins:  - ref: "@acme/audit-plugin"    version: 2.0.0mcpServers:  statuspage:    command: npx    args: ["--yes", "@acme/[email protected]"]    env:      STATUSPAGE_TOKEN: "${STATUSPAGE_TOKEN}"automations:  - id: daily-summary    name: Daily incident summary    schedule: { cron: "0 9 * * *", timezone: UTC }    session: main    message: Summarize active incidents.

A bundled skill folder must contain a valid root SKILL.md. Add installs that folder under the new agent's ordinary workspace skills/ directory, using its native skill identity. Supporting files are included automatically, including binary assets. Declare only folders you intend to share; undeclared skill folders are not installed or counted as dependencies. Bundled contents show their name and package-relative path; they have no invented registry version or standalone ClawHub verification claim.

validate and build also stop at 4,096 folders and unselected files in the project, outside .git and node_modules; selected files do not count toward it.

Bundled skill and plugin folders use the same bounded selection: regular files only, at most 1 MiB per file, 20 MiB across bundled dependencies, 4,096 entries per folder, 4,096 selected bundled files in total, and 16 directory levels. .git and node_modules directories are excluded regardless of case. Links, nonregular files, unsafe portable paths, overlapping bundled directories, and conflicting skill identities or workspace destinations are rejected. Build and Add preserve executable files and reject changes to source bytes, executable flags, or folder membership after review. Other permission bits are normalized when packaging and installing bundled folders.

Use automations for scheduled work. The retired cronJobs key is rejected; move its declarations to automations and remove cronJobs.

Add preserves each automation's required session: main runs in the new agent's main conversation, while isolated runs in a separate session. Declared automations start with no channel delivery; Add accepts but does not apply delivery. To post a summary to a channel, configure delivery in the automation's settings after Add. Previously added jobs keep their saved session target; change those in the automation's settings if needed.

Environment values remain unresolved references; never package credentials. Shared plugins and MCP servers must match existing declarations exactly or Add reports the conflict without replacing them. An MCP server's timeout and connectTimeout are in seconds; Add stores and compares them as requestTimeoutMs and connectionTimeoutMs in milliseconds. Plugin and skill trust warnings require explicit consent. Automations are assigned to the new agent. If a declared plugin still needs setup, a referenced environment variable is missing, or an OAuth MCP server is not authorized, Add creates the declared automations disabled. Their schedules, prompts, and imported scratch stay intact. Connect the requirement through its ordinary plugin or MCP controls, then enable the jobs through the agent's automation controls; Add does not create substitute routines or automatically enable disabled jobs later.

A package may declare agent.heartbeat in CLAW.md or include HEARTBEAT.md. Add converts those inputs into ordinary interval automations and private job scratch instead of installing heartbeat configuration. Legacy tasks: entries become separate automations, and the remaining checklist stays in the monitor's scratch. An every: 0m declaration stays disabled. Because it becomes job scratch, HEARTBEAT.md must be valid UTF-8 and at most 256 KiB; validate, inspect, build and Add report a larger or non-UTF-8 file as a Template diagnostic. The Add review shows each converted job with its interval and owner delivery; existing cron schedules keep their meaning. Gateway review responses represent interval schedules as { everyMs }, where everyMs is a positive integer, and owner delivery as owner, alongside the existing { cron, timezone } schedules and the none delivery of declared automations.

Add creates a job disabled until its imported scratch is saved and verified. If scratch import conflicts with another edit, or its write cannot be confirmed, Add reports a partial result and keeps the new agent and jobs for inspection. Check their scratch and enabled state before retrying; Add does not overwrite concurrent edits to make the import succeed.

Native settings under agent include groupChat, sandbox, tools, memory, heartbeat, and humanDelay. The native tools.profile field selects a built-in tool policy; its grants are bounded and frozen when Add creates the agent. Host policy still constrains every grant. A Template cannot configure a provider, credentials, or named delegate agents.

Authors may optionally set agent.model to a preferred, fully qualified model:

yaml
agent:  id: incident-triage  model: anthropic/claude-sonnet-4-5

At Add time, the receiving Gateway checks its ordinary model picker. If that exact model is available and permitted, the new agent uses it. Otherwise Add continues using the Gateway's default model; it does not install a provider, request credentials, or change the Gateway default. Omitting model keeps the existing default-inheritance behavior. Use provider/model, not a host-local alias or account pin. This is a one-time creation preference, not an ongoing Template-managed model selection; users can change the agent's model normally.

yaml
agent:  id: incident-triage  tools:    profile: coding    allow: [read, write]    fs: { workspaceOnly: true }  sandbox: { mode: all, workspaceAccess: ro }  memory: { search: { enabled: false } }

Exec mode (tools.exec) and cross-provider messaging (tools.message) are operator decisions, so a Template cannot set them either; after Add, set them on the new agent with openclaw config set agents.entries.<id>.tools.exec ....

Set enabled: false on an automation to install it disabled; omitting the field keeps the enabled default. Jobs belong to the new agent. First-run instructions in BOOTSTRAP.md should find that agent's declared job, including disabled jobs, and update its timezone, tools, or timeout through ordinary automation controls. Enable that same job after setup and the user's activation choice; avoid creating a duplicate job for the same recipe.

Package and workspace paths must stay inside the package root. Manifests are limited to 1 MiB, package metadata to 256 KiB, and workspace files have per-file and aggregate limits. Selected files become package content, so review them for secrets before building or publishing.

Welcome description and conversation starters

A Template may set optional agent.description and agent.recommendedPrompts metadata for the installed agent’s main/new-chat welcome page:

yaml
agent:  id: project-briefing  description: Follows your repositories and briefs you on meaningful changes.  recommendedPrompts:    - Set up a repository    - Brief me on recent changes    - Show my tracked projects

When no recent chats are available, a nonempty list replaces the default welcome prompts. An unset or empty list keeps the defaults. Recent chats, incognito, phone layout, and model setup keep their existing display rules. The Template page, Add flow, and bootstrap instructions are unchanged.

Prompts use the shared metadata limits: at most three nonempty strings, each at most 128 Unicode code points after whitespace normalization. Declare them in CLAW.md, not in profiles/openclaw.yml.

Compatibility: this field requires a build with agent welcome prompt support. OpenClaw 2026.11.4 and older reject it because Template agent schemas are strict. Keep schemaVersion: 1; omit recommendedPrompts when supporting those versions. See agent welcome settings.

Inspect and Add

Inspect a source before using it:

bash
openclaw templates inspect ./incident-triage

Add it to create a new ordinary agent:

bash
openclaw templates add ./incident-triage

Add a published ClawHub Template directly, or preview the same flow first:

bash
openclaw templates add @openclaw/api-integration-engineer --dry-run --jsonopenclaw templates add @openclaw/api-integration-engineer

With a running Gateway, Add sends the ClawHub name to that Gateway for an exact version review and installation. The Gateway chooses the new workspace; --workspace is rejected instead of being ignored. Local paths still take precedence over registry names and require the Gateway to be stopped.

Offline Add uses the same installer and local scheduler after acquiring exclusive state ownership. Explicitly disabled automations remain disabled.

A registry name resolves the latest published release to an exact version and immutable artifact digest before planning. OpenClaw uses its existing registry trust checks, verifies the downloaded artifact, and safely extracts it under bounded package limits. The extracted source is temporary and is cleaned up after planning or Add; it is not an installed Template lifecycle. An existing local path takes precedence over a registry name; use ./name to make a local source explicit.

Registry previews require network access but do not create an agent, workspace, installed dependency, or retained Template source. Review the exact version, digest, requirements, and trust warnings in --dry-run --json output. A warned Template release requires --acknowledge-clawhub-risk when adding it. Template approval never approves its skill or plugin dependencies: their existing trust acknowledgments and --accept-capabilities checks still apply independently.

Each Add chooses an unused agent ID. The CLI reports that ID so you can open or configure the agent afterward. The first assistant response is a normal personality/SOUL greeting, not a saved canned greeting or a message sent on your behalf. Later setup failure retains the exposed agent and conversation; completion does not replace an existing draft.

Offline CLI Add checks model and sign-in availability before its optional greeting. If no usable model is available, it skips the greeting and prints a short note to stderr, including with --json. Dependency installation, automations, and first-run instruction files still finish normally; a successful Add exits 0. Configure a model in Settings → Models, then open the new agent's chat. When a model is available, Add still runs the greeting. A failed model turn or failed setup step still reports partial and exits 1; it is not treated as a skipped greeting.

During a CLI Add, the installer shows a card for each newly installed plugin and an automation-created notice as each routine is added. Disabled routines remain disabled while their setup prerequisites are missing. Actual installation failures appear in the plugin card or a concise automation-failed notice; continue setup in the same agent. Successful skill and MCP setup, absent optional files, and empty categories stay silent. There is no final setup receipt or second model recap. Declared package bootstrap still follows shared setup; MCP configuration alone does not prove a working connection. When offline Add keeps an agent after a later step fails, the agent gets the default AGENTS.md, IDENTITY.md and USER.md, and the package BOOTSTRAP.md is held back because its setup did not finish.

Add from the Control UI

Add in the Control UI has no review step and no preview. It opens the new agent's pending chat immediately, and the Gateway creates the agent:

  1. It creates the agent and its chat. If the Template's agent ID is taken, the new agent gets the next unused ID; an existing agent is never changed.
  2. It fetches the exact Template release shown in the catalog.
  3. It writes the Template's workspace files and its BOOTSTRAP.md.
  4. It copies the Template's CLAW.md unchanged to the workspace root, as an ordinary file the agent can read. The workspace root CLAW.md is reserved for that original manifest; a conflicting workspace-file declaration fails creation before any Template files are written and removes the new agent.
  5. It installs the declared skills, from ClawHub or bundled in the package.
  6. It installs plugins bundled in the package.
  7. It adds the declared MCP servers.
  8. It grants read, automations, plugins, and message additively for setup. Explicit Template denies and operator policy ceilings still apply.

After creation, the Gateway starts one hidden setup turn in that chat, with the agent's ordinary tools. The agent reads declarations from the persisted CLAW.md and responds in this order:

  1. A brief greeting in its own voice.
  2. Declared automations, created paused, bound to this conversation. Existing matching automations are left unchanged, including ones you already enabled.
  3. Added MCP servers and any sign-in needed in Settings → MCP.
  4. Plugin state and exact-package ClawHub cards for missing plugins. Official cards offer Install; community cards offer View details for normal plugin review. Unknown packages produce a not-found result, not a card.
  5. Creation failures, by name and reason. Successful skills are not listed.
  6. The author's opening from BOOTSTRAP.md, last in the same turn.

Neither creation nor this turn installs or enables a plugin referenced on ClawHub, or enables an automation. A missing or disabled referenced plugin never stops agent creation. You choose installation or enabling afterwards. This path creates declared automations (cronJobs in older manifests); it does not convert legacy agent.heartbeat settings into a heartbeat automation.

Intermediate text and card sends are non-final. A final reply alone does not finish setup: the Gateway checks that every declared automation exists under its declaration key and belongs to the new agent's conversation. It includes paused jobs and does not rewrite jobs you have already edited or enabled. If any are missing, Retry setup remains available in the same chat. Sending becomes available when setup finishes; a message typed earlier stays in the composer.

If that first turn fails or is interrupted, Retry setup runs only that turn with a fresh run ID in the existing chat. It does not re-create the agent, rewrite its files, fetch the Template again, or reinstall dependencies. The exception is a pending setup from an older Gateway that did not record the declared automation IDs: it reverifies the exact release once to recover them. The ordinary session retains the creation report until the turn completes; a retry cannot start a second setup while the first still owns the agent's setup lease. Retry explicitly targets the admitted agent. If setup completed while the client was disconnected, Retry reconciles that existing chat without adding another copy. The CLI Add flow and its no-tools opening are unchanged.

If the Gateway cannot fetch the Template or write its workspace files, it removes the new agent and chat, and the catalog shows the error on that Template's card. Add it again after fixing the cause. A skill, bundled plugin, or MCP server that cannot be set up does not stop Add: the agent is kept without it. A skill or bundled plugin that carries a trust warning is not installed. An MCP server whose name is already configured with different settings is left unchanged. Missing dependencies are reported as incomplete setup, with their reasons in the opening conversation. Continue in that chat instead of adding another copy; no installer is continuing those steps in the background. Configured MCP servers may still need sign-in or connection checks.

A Template release that ClawHub flagged for review still needs your confirmation. The catalog shows the ClawHub warning with Add anyway before any agent is kept.

--dry-run --json remains available for automation or local-source inspection. --agent-id selects an unused ID, or names an agent that a failed Gateway Add kept so Add continues its setup. --workspace selects a new path for local preview or offline Add. Ordinary Add binds its review internally and does not require a separate plan token. Trust warnings and plugin capabilities still require their separate explicit acknowledgements.

For add and dev, an explicitly empty --agent-id is invalid. Omit the option to use the default unused ID.

For a new cron automation, Gateway Add uses the time zone reported by the device that adds the Template. For example, a 9 AM schedule added from Los Angeles runs at 9 AM Los Angeles time, even if the Gateway is in London. If the client does not report a valid time zone, Add uses the zone declared in the Template. Viewing the Template or retrying setup from another device does not move an existing job. Interval automations are unchanged.

Gateway Add review responses describe schedules as either { cron, timezone } or { everyMs }, where everyMs is a positive integer in milliseconds. Delivery is owner for converted heartbeat jobs and none for declared automations.

CLI Add from a local source requires exclusive offline state ownership; it refuses to run while a Gateway owns that state. For published ClawHub Templates, both the CLI and Control UI can Add through a running Gateway; the Control UI uses the plan-free Add above. Offline Add uses the same session, local agent runtime, and scheduler owners without starting scheduled execution. --json suppresses conversational terminal output but keeps the ordinary conversation and per-result install notices.

Add reuses matching shared dependencies, installs missing requirements, and assigns the declared automations. An existing agent or workspace is never overwritten. If Add fails before exposing the agent, newly created resources are cleaned up where safe; preexisting resources remain untouched. If the result says the agent was retained, continue in that agent and inspect the specific error instead of adding another copy. When Gateway Add kept the agent before its setup finished, rerun openclaw templates add <source> --agent-id <id> once the error is resolved. The rerun continues in the same agent and conversation, and only for the Template version the first Add resolved.

Remove the agent

Deleting an agent added from a Template is the same as deleting any other agent:

bash
openclaw agents delete incident-triage

The ordinary agent deletion flow removes the agent's dedicated workspace, including its local instructions and skills, and automations assigned to that agent. It also removes files or automations the user added later to that agent. Shared plugins, MCP servers, and other host-level integrations remain installed; remove them separately through their ordinary controls when no longer needed. There is no Template ownership record or reverse-install operation.

Agents from the earlier lifecycle

Agents created by the earlier claws add or claws migrate commands still carry a Template consent record. OpenClaw refuses to run such an agent after its configuration changes, for example after openclaw config set agents.entries.<id>.tools.exec '{"mode":"full"}', and the error names the agent. Undo the change, or release the agent with the Gateway stopped:

bash
openclaw gateway stopopenclaw templates release <agent-id>openclaw gateway start

Release shows the agent's tool settings and asks for confirmation; pass --yes in scripts. It removes the Template consent and ownership records only. The agent, its workspace, sessions, plugins, MCP servers, and automations stay, and from then on it is an ordinary agent whose settings you manage with openclaw config and the agent commands. Release refuses to run while the Gateway is running.

Command reference

Command Purpose
templates draft <workspace> Initialize a private proposal without publishing.
templates create [path] Create a minimal local Template project.
templates validate [path] Validate project inputs and package contents.
templates dev [path] Build and preview locally without mutation.
templates build [path] --out <tgz> Build a deterministic package artifact.
templates inspect <source> Inspect a canonical package or CLAW.md.
templates add <source> Create a new agent and install its requirements.
templates release <agent-id> Make an earlier Template-managed agent ordinary.

Use --json for experimental machine-readable output. Validation errors, blocked requirements, and failed additions exit 1. Gateway-owned Add reports the native agentId, status, and readiness result. A partial result exits 1. A lost Gateway reply reports an unknown outcome; inspect the agent and its automations before retrying, since no local fallback or automatic replay is attempted.

Human-readable reports sanitize terminal control characters in Template fields and project paths. --json retains the original field values for machine processing.

See also

Was this useful?