---
title: 'Hermes Agent + Grok 4.5: Build an Automated X Content Machine'
summary: >-
  A full setup guide for a 24/7 content pipeline: Grok 4.5 monitors X's live
  firehose, drafts posts in your voice from a SOUL.md, routes them through
  Telegram for one-tap approval, and publishes with xurl — with model routing,
  cron scheduling, media handling, and cost breakdowns.
author: YanXbt
authorUrl: 'https://x.com/IBuzovskyi'
category: Automation
difficulty: Intermediate
readingTime: 12
date: '2026-07-10'
tags:
  - grok
  - telegram
  - x-search
  - xurl
  - cron
  - content-automation
  - soul-md
  - mixture-of-agents
integrations:
  - Hermes Agent
  - Grok
  - Telegram
  - xurl
  - X API
  - VPS
  - Nous Portal
---

## Why Grok 4.5 for this

Every other frontier model — Claude, GPT, Gemini, DeepSeek — searches the *web*. None of them read X natively. Grok 4.5 connects to the live X firehose through your Grok subscription: posts, engagement, trending topics, and conversations in real time. Not cached, not scraped — live.

For a content pipeline built around X, that live intake step is what makes Grok irreplaceable. It isn't the best model on every benchmark, but the native X access is the one capability no competitor can match.

## The pipeline

Four tools, one profile, running 24/7:

- **Grok 4.5** — finds news on X
- **SOUL.md** — controls your voice and content rules
- **Telegram** — the approval gateway
- **xurl** — publishes to X (the official X API CLI)

You set the voice. The agent finds the news. You approve the draft. The agent publishes.

## Before you start: choose your platform

Every step after this works identically on all three.

- **Nous Portal Cloud** (easiest, zero ops) — go to `portal.nousresearch.com/cloud`, pick a server size, deploy. Live in ~60 seconds. Skips server provisioning, Docker, OS updates, and SSH. Use the Portal web terminal for the commands below.
- **VPS** (cheapest long-term, full control) — rent a Linux box (e.g. Hetzner CX22, ~$7/mo), SSH in, and install:

  \`\`\`bash
  curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
  \`\`\`

  Then run `hermes setup` and follow the wizard.
- **Local machine** (max privacy) — install the Desktop app or use the same curl command. Note: the agent stops when you close the lid, so pair with a VPS or Cloud for true 24/7 operation.

## Step 1 — Create the content profile

\`\`\`bash
hermes profile create content-machine
content-machine config set model.default xai/grok-4.5
\`\`\`

(Or in the Desktop app / Dashboard: Profiles → Create → "content-machine", then set Model → `xai/grok-4.5`.)

## Step 2 — Connect Grok 4.5

The simplest path is **Grok OAuth**, free with X Premium+ and billed against your subscription tokens (no API key):

\`\`\`bash
content-machine setup   # select xAI → authenticate
\`\`\`

Alternatives: Nous Portal (`content-machine setup --portal`), the xAI API (`XAI_API_KEY` from `console.x.ai`), or an existing OpenRouter key.

> Tip: once your Telegram gateway (Step 5) is running, you can skip manual setup and just tell the agent: *"connect Grok 4.5 via OAuth to this profile."*

## Step 3 — Connect the X API (reading + publishing)

**Option A — X MCP server (recommended, simpler).** X now hosts an official MCP server at `api.x.com/mcp`. Prerequisites: an X Developer App with OAuth 2.0 enabled, redirect URI `http://localhost:8080/callback`, your `CLIENT_ID`/`CLIENT_SECRET`, and Node.js. Add it to your profile's `mcp.json`:

\`\`\`json
{
  "mcpServers": {
    "xapi": {
      "command": "npx",
      "args": ["-y", "@xdevplatform/xurl", "mcp", "https://api.x.com/mcp"],
      "env": {
        "CLIENT_ID": "YOUR_X_APP_CLIENT_ID",
        "CLIENT_SECRET": "YOUR_X_APP_CLIENT_SECRET"
      }
    }
  }
}
\`\`\`

Set `startup_timeout` to 300s — the first run opens a browser for OAuth. On a headless VPS/Cloud, export the credentials and run `xurl auth oauth2 --headless`, which prints an auth URL you open on any device and paste the code back. Verify by asking the agent: *"search X for the latest posts about Hermes Agent."*

**Option B — xurl CLI skill (more control).** `xurl` ships bundled as a Hermes skill for direct access to every X API v2 endpoint:

\`\`\`bash
curl -fsSL https://raw.githubusercontent.com/xdevplatform/xurl/main/install.sh | bash
xurl auth apps add my-app --client-id ******** --client-secret ********
xurl auth oauth2 --app my-app YOUR_X_USERNAME
xurl auth default my-app YOUR_X_USERNAME
xurl auth status && xurl whoami
\`\`\`

> The #1 mistake: omitting `--app my-app` from the `oauth2` command — the token saves to the empty default profile and every call fails. **Docker pitfall:** tool subprocesses use `/opt/data/home` as `HOME`, so prefix auth commands with `HOME=/opt/data/home`.

Both options use OAuth 2.0 with auto-refresh and keep credentials local, never in agent context. X API is pay-per-use (no subscription): roughly `$0.015`/post without a link, `$0.20`/post *with* a link, and `$0.001` per owned read.

## Step 4 — Write the SOUL.md (and train your voice)

Writing rules alone isn't enough — the agent needs to *see* your style. Train it first:

1. **Feed it 10–15 of your best posts:** *"analyze my writing style — hook structure, sentence length, vocabulary, formatting, tone, what I avoid — and write a style guide."*
2. **Feed it competitor posts you admire:** *"identify what makes their style different from mine; find elements I should adopt and avoid."*
3. **Iterate in conversation:** *"write a sample post about [topic]"* — then correct it (*"too formal, shorter sentences, no questions as openers"*). After 5–6 rounds it writes like you.
4. **Save the refined style:** *"write a complete SOUL.md for a content profile."*

A starting template (customize after voice training):

\`\`\`markdown
You are a content monitor and writer for @[YOUR_HANDLE] on X.
Niche: [YOUR NICHE].

YOUR JOB:
1. Search X for breaking news and trending topics in [YOUR NICHE].
2. Evaluate: score 1-5 on relevance, timeliness (last 6h?), engagement
   potential. Only proceed with scores 4+.
3. Draft a post in our voice.
4. Send draft to Telegram for approval using clarify tool with choices.
5. If approved: publish via xurl.
6. After publishing: post any links as a reply to your own post.

CONTENT RULES:
- Never publish without Telegram approval.
- Links go in a reply, never in the post body.
- Every technical claim must be verifiable. No speculation as fact.
- Maximum 3 posts per day. Minimum 2 hours between posts.

SOURCES TO MONITOR:
- X search: "[keyword 1]", "[keyword 2]", "[keyword 3]"
- Filter: minimum 100 likes OR 1,000+ views in last 2 hours
- Ignore: accounts with < 1,000 followers. Prioritize original takes.
\`\`\`

## Step 5 — Set up the Telegram gateway

Telegram is your control interface — cron results and approvals both land here, so the gateway must be running.

1. In Telegram, message **@BotFather**, send `/newbot`, name it, and copy the **bot token**.
2. Message **@userinfobot** to get your numeric **user ID**.
3. Connect it (or set `TELEGRAM_BOT_TOKEN` / `TELEGRAM_ALLOWED_USERS` in `.env`):

   \`\`\`bash
   content-machine setup gateway   # select Telegram, paste token + user ID
   content-machine gateway install # persistent service, survives reboots
   \`\`\`
4. Message your bot `/sethome` to mark that chat as the home channel for cron results.
5. Verify: send "hello" — if Hermes responds, the gateway is live.

> **Pro tip:** once the gateway runs, do *every* remaining step by chatting with the agent — *"set up the X MCP server for posting"*, *"create a cron job that scans X every 2 hours"*. It opens auth URLs, writes configs, and schedules crons from your phone.

## Step 6 — Set up the cron pipeline

A `wakeAgent` gate makes empty scans cost `$0` — you only pay when the agent wakes to draft. Narrow your searches to your exact niche (search terms + monitored accounts) and define newsworthiness thresholds in SOUL.md:

- **Viral velocity:** 1,000+ views in 2h, or 500+ likes in 6h, or 100+ bookmarks.
- **Relevance:** matches a tracked topic, from a 1,000+ follower account, original (not a repost), inside the scan window.
- **Dedup:** skip topics you covered in the last 48h.

Four crons cover the workflow:

1. **News scanner** — runs on your chosen frequency, applies filters, scores 1–5, drafts 4+ scorers, and delivers to Telegram with `[✅ Approve] [🔄 Regenerate] [🔀 Different Topic]`. Replies `silent` when nothing passes.
2. **Account monitor** (every 2h) — checks specific accounts (e.g. `@NousResearch`, `@teknium1`) and drafts a reaction or quote tweet when they post.
3. **Best-time optimizer** (daily 7am) — reads your 7-day analytics via xurl and reports today's best posting window.
4. **Weekly report** (Sunday 8pm) — ranks the week's posts by engagement, flags what worked and flopped, and notes which drafts you rejected.

> Test each cron manually first with `hermes cron run [job-id]`, watch the draft quality, and iterate 2–3 times before letting it run on schedule.

## Step 6.5 — Use the right model for writing (not Grok)

Grok is the best model for *searching* X, but not for *writing* posts. Split the two:

- **Option A — auxiliary model (simplest):** keep Grok as the profile model, route drafting to a writer.

  \`\`\`yaml
  auxiliary:
    content_generation:
      provider: openrouter
      model: anthropic/claude-sonnet-4.6
  \`\`\`
- **Option B — sub-agent:** Grok searches, then delegates drafting to a Sonnet sub-agent with the source facts + your SOUL.md voice rules.
- **Option C — Mixture of Agents (best quality, ~2–3x tokens):** Grok and GPT-5.5 act as reference models; Sonnet aggregates the final post. Use for high-stakes content, skip for routine posts.

Recommended: routine posts → A or B, important posts → C, news reactions → A.

## Step 6.6 — Media in posts

Posts with media get 2–3x more engagement. The most common flow: the agent sends a draft, you send an image to the bot and reply `APPROVE WITH MEDIA`; the agent uploads it and posts text + media together.

\`\`\`bash
xurl upload-media ~/images/cover.png          # returns a media_id
xurl post "your text" --media-id MEDIA_ID       # up to 4 images, or 1 video
\`\`\`

## Step 7 — The approval flow

Cron sessions are fresh and ephemeral, so the interactive approval happens in your **gateway** session. A cron fires → Grok searches → drafts → delivers to Telegram. You reply, and the gateway agent acts:

- **APPROVE / yes / go** → `xurl post`, wait 5s, then `xurl reply [post_id]` with the link.
- **REDO** → regenerate with a different angle, same source.
- **SKIP** → discard, don't publish.
- **EDIT [text]** → replace the draft with your text, then publish.

A delivered draft shows the source, view/engagement stats, a relevance score, the draft text, and the link to post as the first reply. In direct bot conversations, the `clarify` tool renders inline keyboard buttons so you just tap. Configure the wait with `agent.clarify_timeout` (default 600s).

## Step 8 — Safety rails

- **Never auto-publish** — SOUL.md hard rule; one bad take can cost your reputation.
- **Rate limit** — max 3 posts/day, 2h minimum between posts.
- **Verify claims** — the agent must confirm facts via web search; "I saw it on X" is not verification.
- **xurl security** — tokens live in `~/.xurl` locally; the agent calls xurl but never reads the credential file. OAuth auto-refreshes, no passwords in chat context.

## Cost breakdown

- **Nous Portal Cloud:** ~$21–38/mo (2–3 posts/day, one account).
- **Own VPS:** ~$8–25/mo + X subscription.
- **Biggest variable:** links. `$0.015`/post without a link vs `$0.20` with one (replies with links also cost `$0.20`). Cost-saving rule: post content without links, put the link in a second reply only when needed.
- **Scanning tokens:** ~12 cron runs/day with wakeAgent skipping empties → ~$5–15/mo in Grok tokens.

## Beyond single posts

Once the pipeline runs, extend it: quote-tweet trending posts, auto-draft replies to comments on your posts, thread follow-ups when a post crosses 100+ bookmarks, competitor monitoring with counter-post suggestions, and a memory-backed content calendar that fills gaps in your weekly plan.

## The full stack

One Hermes profile (`content-machine`) → Grok 4.5 for X search → xurl for publishing → SOUL.md for voice and rules → Telegram for approvals → cron jobs (scanner, timing optimizer, weekly report) → wakeAgent gates for zero cost on quiet hours → a VPS or Cloud keeping it running 24/7. Your X presence runs while you build.

*Technical details verified against Hermes Agent v0.18.0 and xurl v1.1.0+.*
