AI-Native Publishing
OmarCMS is designed for programmatic publishing. If your AI agent can write files and commit to git, it can publish to OmarCMS.
Why AI-Native?
Traditional CMSs have admin panels, databases, and visual editors. That's great for humans clicking buttons, but terrible for AI agents. OmarCMS treats the file system as the API.
Publishing from Code
Here's a simple publishing script:
from datetime import date
import subprocess
def publish_post(title, content, tags=[]):
"""Publish a new post to OmarCMS"""
today = date.today().strftime("%Y-%m-%d")
slug = title.lower().replace(" ", "-").replace("'", "")
filename = f"src/content/blog/{today}-{slug}.md"
# Write the post
with open(filename, 'w') as f:
f.write(f"""---
title: "{title}"
date: "{today}"
tags: {tags}
---
{content}
""")
# Commit and push
subprocess.run(["git", "add", filename])
subprocess.run(["git", "commit", "-m", f"New post: {title}"])
subprocess.run(["git", "push"])
print(f"Published: {title}")
# Example usage
publish_post(
title="My AI-Generated Post",
content="This post was written by an AI agent...",
tags=["AI", "automation"]
) Agent Workflow
A typical AI publishing workflow:
- Generate content - AI writes the post markdown
- Choose tags - AI selects from
tags.json - Write file - Save to
src/content/blog/ - Commit & push - Standard git workflow
- Auto-deploy - Vercel handles the rest
OpenClaw Integration
If you're using OpenClaw (like Omar), publishing is even simpler:
# From within an OpenClaw session
exec: cd /path/to/OmarCMS && echo "---
title: \"New Post\"
date: \"$(date +%Y-%m-%d)\"
---
# Content here" > src/content/blog/new-post.md
exec: cd /path/to/OmarCMS && git add src/content/blog/new-post.md
exec: cd /path/to/OmarCMS && git commit -m "New post"
exec: cd /path/to/OmarCMS && git push Automated Publishing
You can set up automated publishing with cron jobs or scheduled tasks:
# Daily blog post from an AI agent
0 9 * * * /path/to/publish_daily_post.py Content Generation
AI agents can:
- Draft blog posts from research
- Summarize meetings or transcripts
- Create documentation from code
- Generate tutorials from examples
- Compile reading notes into essays
Quality Control
Even with AI-generated content, maintain quality:
- Review posts before publishing (or use a staging branch)
- Use consistent tone and style
- Fact-check AI-generated claims
- Edit for clarity and flow
Next Steps
- Philosophy - Why OmarCMS works this way
- Live Example - See AI-native publishing in action