Template repository for deploying a CodeMill OpenClaw AI Agent on an Apple Silicon Mac Mini. Each client receives their own private clone of this repo.
Run this single command on the target machine to install all dependencies and set up the agent:
curl -fsSL https://raw.githubusercontent.com/CodeMill-Solutions/codemill-agent-template/main/scripts/bootstrap.sh | bash -s -- <client-repo-url>Replace <client-repo-url> with the SSH or HTTPS URL of the client's private repo (e.g. git@github.com:CodeMill-Solutions/codemill-agent-acme.git).
After the script completes, fill in ~/codemill-agent/.env and restart the service:
bash ~/codemill-agent/scripts/service.sh restart- Installs Homebrew (if not present)
- Installs Node.js LTS via Homebrew
- Installs pnpm (via npm) and OpenClaw
- Prompts for a GitHub PAT to clone the private client repo
- Clones the client repo to
~/codemill-agent - Calls
scripts/setup.shto finish configuration
- Runs
pnpm install - Copies
.env.example→.env(if.envdoesn't exist yet) - Installs
mcporter.jsonto~/.openclaw/workspace/config/ - Registers and starts the launchd service
- Installs the self-improving-agent skill (via ClawHub or git clone)
- Creates
~/.openclaw/workspace/.learnings/and copies the learning templates - Installs and enables the OpenClaw self-improvement hooks
- Installs any client-specific skills from
skills/→~/.openclaw/skills/ - Installs any client-specific plugins from
plugins/→~/.openclaw/plugins/ - Prints a summary of remaining manual steps
bash ~/codemill-agent/scripts/service.sh start
bash ~/codemill-agent/scripts/service.sh stop
bash ~/codemill-agent/scripts/service.sh restart
bash ~/codemill-agent/scripts/service.sh logs
bash ~/codemill-agent/scripts/service.sh statuscodemill-agent-template/
├── scripts/
│ ├── bootstrap.sh # Entry point — run via curl on a bare Mac Mini
│ ├── setup.sh # Post-clone setup (called by bootstrap.sh)
│ └── service.sh # launchd service management
├── launchd/
│ └── com.codemill.agent.plist # launchd service definition
├── docs/
│ ├── onboarding-klant.md # Client-facing guide (Dutch)
│ └── new-client-checklist.md # Internal ops checklist (Dutch)
├── skills/
│ └── .gitkeep # Add client-specific skill subdirectories here
├── plugins/
│ └── .gitkeep # Add client-specific plugin subdirectories here
├── .learnings/
│ └── .gitkeep # Tracks directory; *.md files are gitignored (local-only)
├── mcporter.json # MCP server configuration (MCPorter format)
├── agent.config.json # OpenClaw agent config (Azure OpenAI)
├── .env.example # Template for required environment variables
├── .gitignore # Excludes .env, learnings, and other sensitive files
├── AGENTS.md # AI coding conventions for this repo
└── README.md # This file
Copy .env.example to .env and fill in all values. See the inline comments in .env.example for details on each variable.
Required keys:
AZURE_OPENAI_API_KEY/AZURE_OPENAI_ENDPOINT/AZURE_OPENAI_DEPLOYMENT_NAMEYUKI_API_KEY/YUKI_DOMAIN_IDBRAVE_API_KEYGMAIL_CLIENT_ID/GMAIL_CLIENT_SECRET/GMAIL_REFRESH_TOKENGOOGLE_SERVICE_ACCOUNT_KEY_PATH/GOOGLE_WORKSPACE_DOMAIN/GOOGLE_WORKSPACE_ADMIN_EMAIL
Never commit .env — it is listed in .gitignore.
Pre-configured servers:
| Server | Package |
|---|---|
| Yuki (accounting) | @codemill-solutions/yuki-mcp |
| Brave Search | @modelcontextprotocol/server-brave-search |
| Gmail | @modelcontextprotocol/server-gmail |
| Google Workspace | @modelcontextprotocol/server-google-workspace |
All API keys are read from environment variables — no secrets are stored in this file.
The agent is equipped with the self-improving-agent skill, which gives it a structured memory layer for learnings, errors, and feature requests.
| Path | Purpose |
|---|---|
~/.openclaw/skills/self-improving-agent/ |
Skill source, installed by setup.sh |
~/.openclaw/workspace/.learnings/LEARNINGS.md |
Reusable patterns and past decisions |
~/.openclaw/workspace/.learnings/ERRORS.md |
Logged mistakes and their corrections |
~/.openclaw/workspace/.learnings/FEATURE_REQUESTS.md |
Ideas for improving the agent setup |
Learnings are always local. The .learnings/*.md files are gitignored and will never be committed or pushed to the client repo. Only the .learnings/.gitkeep file (which tracks the directory itself) is version-controlled.
Add client-specific skills as subdirectories under skills/, and plugins under plugins/. setup.sh automatically detects and installs every subdirectory it finds:
skills/
└── my-custom-skill/ → installed to ~/.openclaw/skills/my-custom-skill/
plugins/
└── my-custom-plugin/ → installed to ~/.openclaw/plugins/my-custom-plugin/
- Both directories are committed to the client repo — they are part of its configuration.
- Re-running
setup.shalways overwrites the installed version with the repo version (repo is source of truth). - If either directory is absent or empty, the step is silently skipped.
- Create a new private GitHub repo under
CodeMill-Solutions(e.g.codemill-agent-acme) - Use this template as the starting point
- Follow
docs/new-client-checklist.mdfor the full internal setup process
- macOS 14 Sonoma or later (Apple Silicon)
- Internet access during bootstrap
- SSH key or HTTPS credentials for cloning the client repo