#Can i create agent from template

1 messages · Page 1 of 1 (latest)

old sinew
#

openclaw add agent with template of prepared md files

amber currentBOT
harsh snowBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

frigid rootBOT
#

Yes, but the command is openclaw agents add, not openclaw add agent.

There is no built-in --template flag right now. The usual pattern is:

  1. Prepare a workspace folder with your markdown files
    (AGENTS.md, SOUL.md, TOOLS.md, IDENTITY.md, USER.md, optional HEARTBEAT.md / MEMORY.md)
  2. Copy that template folder to a new agent workspace
  3. Add the agent pointing at that workspace

Example:

cp -R ~/.openclaw/templates/my-agent ~/.openclaw/workspace-sales
openclaw agents add sales --workspace ~/.openclaw/workspace-sales --non-interactive

A nice detail: OpenClaw only creates bootstrap files if they are missing, so your prepared files should be kept as-is.

high zodiac
#

yes show

frigid rootBOT
#

Yep, this is the clean pattern I’d use:

Template folder

~/.openclaw/templates/base-agent/
  AGENTS.md
  SOUL.md
  TOOLS.md
  IDENTITY.md
  USER.md
  HEARTBEAT.md      # optional
  MEMORY.md         # optional
  avatars/          # optional

Create a new agent from it

#
cp -R ~/.openclaw/templates/base-agent ~/.openclaw/workspace-sales
openclaw agents add sales --workspace ~/.openclaw/workspace-sales --non-interactive

If IDENTITY.md has the name/emoji/theme you want

openclaw agents set-identity --workspace ~/.openclaw/workspace-sales --from-identity

A few practical notes:

  • Use one copied workspace per agent, not one shared workspace
  • Your template can be partial. OpenClaw fills in missing bootstrap files only
  • I’d usually leave out BOOTSTRAP.md unless you really want a first-run ritual/checklist

If you want to do this a lot, make a tiny shell script:

#

If you want, I can also show a git-based template repo version, which is even nicer for managing many agents.

rich vapor
frigid rootBOT
#

Nice, thanks for sharing, that’s basically the pattern people want here: generate a workspace, prefill the .md files, then register the agent.

One caveat though: I’d trust the CLI for agent registration more than hand-patching openclaw.json, because config shape changes over time. Current docs/CLI path is:

openclaw agents add <name> --workspace <dir> --non-interactive

So the safest script shape is:

  1. create/copy the workspace template
  2. write your prepared AGENTS.md / SOUL.md / etc
  3. call openclaw agents add ...
  4. optionally call openclaw agents set-identity --from-identity

That avoids drift if config internals change.

rich vapor
#

Yes, good idea