Prerequisites

  • OpenClaw v1.0.0+ installed
  • API key configured in ~/.openclaw/config.yaml
  • Basic CLI knowledge
  • For web automation: curl or Python requests available

Batch File Processing

# Rename files using AI-generated names based on content
for f in ~/reports/*.txt; do
  newname=$(openclaw run "Generate a concise filename (no extension) for this document" --file "$f" --format plain)
  mv "$f" "~/reports/${newname}.txt"
done

# Summarize all markdown files in a directory
for f in ./docs/*.md; do
  openclaw run "Summarize in 2 sentences" --file "$f" >> summaries.txt
done

Email Drafting

# Draft a professional reply from notes
openclaw run "Draft a polite professional email replying to this message. Tone: friendly but concise." \
  --file meeting-notes.txt \
  --output draft-reply.txt

# Generate personalized outreach
openclaw run "Write a personalized cold outreach email to a B2B SaaS company about our AI integration service" \
  --format plain > outreach.txt

Data Extraction

# Extract structured data from unstructured text
openclaw run "Extract all names, emails, and company names as JSON" \
  --file contacts.txt \
  --format json \
  --output contacts.json

# Parse invoices
openclaw run "Extract invoice number, date, total amount, and line items as JSON" \
  --file invoice.pdf \
  --format json

Report Generation

# Weekly status report from log files
cat logs/*.log | openclaw run \
  "Generate a weekly operations summary with: key events, errors found, and recommendations" \
  --output weekly-report.md

# Generate changelog from git log
git log --oneline --since="7 days ago" | openclaw run \
  "Convert these git commits into a user-friendly changelog in markdown" \
  --output CHANGELOG.md

Scheduled Automation

# Add to crontab for daily execution
# crontab -e
0 8 * * * /usr/local/bin/openclaw run "Fetch top 5 AI news headlines and email me a digest" \
  >> /var/log/openclaw-daily.log 2>&1

See the Scheduling guide for full cron and systemd timer examples.

API and Web Automation

# Fetch JSON from an API and process it
curl -s "https://api.github.com/repos/openclaw-ai/openclaw/issues" | \
  openclaw run "List open bugs sorted by priority, as a numbered checklist"

# Monitor a website for changes
WEBSITE=$(curl -s https://example.com/changelog)
openclaw run "Compare this content with yesterday's version and highlight new changes" \
  --context "$WEBSITE" \
  --baseline ./cached/changelog-yesterday.html

# Auto-classify support tickets from a webhook payload
curl -s -X POST https://api.example.com/tickets | \
  openclaw run "Classify each ticket as: bug / feature-request / question / billing. Output JSON."

Content Creation Automation

# Generate a LinkedIn post from a blog article
openclaw run "Write a compelling LinkedIn post (under 300 words) announcing this blog article" \
  --file ./blog/new-release.md \
  --output linkedin-draft.txt

# Create a thread from a long-form article
openclaw run "Convert this article into a 10-tweet thread. Each tweet under 280 chars. Start with a hook." \
  --file article.md \
  --output twitter-thread.txt

# Write release notes from git log
git log v1.0.0..v1.1.0 --oneline | \
  openclaw run "Write polished release notes for v1.1.0 from these commits. Group by: Features, Fixes, Breaking Changes."

OpenClaw vs Traditional Automation Tools

FeatureShell ScriptsPython ScriptsOpenClaw
Natural language task description✗✗✓
No boilerplate code needed✗✗✓
Handles unstructured data (PDFs, text)LimitedWith libsNative
Chaining steps✓✓✓
Local LLM support✗Via SDK only✓
Works offline (Ollama)N/AN/A✓

Try It Yourself

Automate your first real task with OpenClaw in under 5 minutes:

1 — Auto-generate a commit message

# Stage your changes, then let OpenClaw write the commit message
git add -A
DIFF=$(git diff --cached)
openclaw run "Write a conventional commit message for this git diff. Use format: type(scope): description. Include a body if the changes are complex." <<< "$DIFF"

Expected output: A properly formatted commit message like feat(auth): add JWT refresh token rotation with an optional body explaining what changed and why.

2 — Convert a CSV to a Markdown table

# Convert any CSV to Markdown for use in README or docs
openclaw run "Convert this CSV to a clean Markdown table. Align columns properly and add a header row."   --file data.csv   --output table.md

cat table.md

3 — Scan for outdated dependencies and generate an upgrade plan

# For Python projects
pip list --outdated > outdated.txt
openclaw run "Analyse these outdated Python packages. For each one, tell me: 1) current vs latest version, 2) is this a security update? 3) is it safe to upgrade? 4) any breaking changes I should know about."   --file outdated.txt   --output upgrade-plan.md

cat upgrade-plan.md
⚠️
When automating git operations or package upgrades, always review OpenClaw's plan before executing. Use --dry-run to see what would happen without making any changes.

What's Next