ViralHunt/Agents/Your own agent

Your own agent in the composer, on your own subscriptions

This is the fastest way to give your team an agent that works on your own subscriptions (Claude Code, Codex, Grok, Kimi) instead of on metered API keys: an OfficeMatrix office on your computer answers what your team asks from the ViralHunt composer. Nothing is installed on ViralHunt's side, no API key changes hands, the agent's work costs you no ViralHunt credits, and a person always saves. About twenty minutes the first time.

YOU INSTALLOfficeMatrix (Node, zero dependencies) and the Cloudflare tunnel binary. Both run on your computer; nothing phones home.
YOU CONNECTOne URL and one key, generated in the office and pasted in ViralHunt → Account → Agents. The Test button says pong.
YOUR TEAM ASKSFrom the composer: shorten for X, fix the spelling, rewrite in the brand voice, check it before publishing. The answer lands on the screen with Undo.

What you need

1. Install OfficeMatrix

Clone the repository and run the installer for your system. The installer checks Node and git, detects which CLIs are signed in and creates a launcher. It never touches your PATH or installs software without asking.

git clone https://github.com/rodvan/OfficeMatrix.git
cd OfficeMatrix

Windows (PowerShell)

.\instalar.ps1
node server.js

macOS / Linux

sh instalar.sh
node server.js

Open http://127.0.0.1:4321. The first screen, Getting started, lists the CLIs it found, gives the install and login command of each one you are missing, and can run a one-turn test. Keep the terminal window open: closing it stops OfficeMatrix.

The full installation guide, with the per-CLI login commands and the notice about Google Antigravity's terms, is docs/INSTALL.md in the repository.

2. The office: where the agent's context lives

An office is a team of AIs with its own chat, its own missions and its own shared memory. Make one per brand (or use one you already have), and it becomes the agent of that brand.

  1. In the panel, create an office (a name and which AIs join it) or open one you already have.
  2. Open the office's ⚙ and pick the Chat host: the AI that answers when nobody is mentioned. That is who answers ViralHunt. Claude is the fallback when none is set.
  3. Tell the office about the brand in its Chat tab: what it is, what it never says, examples it should imitate. The office chat is the office's notebook; what you write there stays in the office and the exchange with ViralHunt lands in the same chat, so you read the whole conversation in one place.
The brand voice travels with every task. Write the brand's playbook (tone, hooks, what to avoid) in ViralHunt → Projects, field Voice. Every task the office receives carries it first, together with the project's language and the accounts with their text limits. You do not need to repeat it in the office.

3. The gate and the tunnel

ViralHunt talks to the office through a small gate on port 4323 (node puerta-bots.js), the same one Grok Bots use. The gate only forwards signed calls and a health check; the panel on 4321 never leaves your computer. The tunnel gives that gate a public https address.

  1. Start the gate. Office ⚙ → Connect a Grok Bot. If the gate line is red, press Start the gate. It only runs the script; no administrator, nothing installed.
  2. Install cloudflared. OfficeMatrix never downloads it for you. Pick your system:

Windows (PowerShell) (the binary lives in your user folder, where OfficeMatrix looks for it; the installer on cloudflare.com works too)

New-Item -ItemType Directory -Force "$env:USERPROFILE\cloudflared" | Out-Null
Invoke-WebRequest -Uri https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe -OutFile "$env:USERPROFILE\cloudflared\cloudflared.exe"
& "$env:USERPROFILE\cloudflared\cloudflared.exe" tunnel --url http://localhost:4323

macOS

brew install cloudflared
cloudflared tunnel --url http://localhost:4323

Linux

curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o ~/cloudflared
chmod +x ~/cloudflared
~/cloudflared tunnel --url http://localhost:4323
  1. Run the quick tunnel. The last line of each block above starts it. In a few seconds it prints a box with your address:
INF |  Your quick Tunnel has been created! Visit it at (it may take some time to be reachable):  |
INF |  https://bandwidth-island-not-consistent.trycloudflare.com                                 |
  1. Or let OfficeMatrix do points 2 to 4. The same ⚙ dialog has Start the tunnel next to Start the gate: it finds cloudflared in your PATH or in the known folders (%USERPROFILE%\cloudflared on Windows, ~/.cloudflared, /usr/local/bin, /opt/homebrew/bin), or takes the path you paste in cloudflared path; if it finds nothing, it tells you which file to download and where to put it. It starts the quick tunnel, reads the address and saves it as the public URL itself; its output goes to logs/cloudflared.log. If you started the tunnel by hand instead, copy the https://…trycloudflare.com line into Public tunnel URL and save. Either way OfficeMatrix calls itself through the tunnel at /bots/health and turns the line green when the round trip works.
  2. Keep that terminal open. The tunnel lives while the command runs. You can check it from any device:
curl https://YOUR-TUNNEL.trycloudflare.com/bots/health
# {"ok":true,"servicio":"officematrix-bots"}
A quick tunnel changes its address on every start. OfficeMatrix says so on the agent card when the saved URL is a trycloudflare.com one. Fine for today's test and for a laptop that you restart on purpose; each time, paste the new URL in the ⚙ dialog AND in ViralHunt → Agents (edit the connection). For a permanent office, make a named tunnel: a free Cloudflare account, cloudflared tunnel login, cloudflared tunnel create office, cloudflared tunnel route dns office office.yourdomain.com, and a config.yml whose service is exactly http://localhost:4323. The address never changes again. Never point the tunnel at 4321 (the panel).

4. The key

  1. Open http://127.0.0.1:4321/editorial, pick the office, tab ViralHunt Connection, card This office as a ViralHunt agent.
  2. The card shows the office's URL: <your tunnel>/bots/vh/<office id>. If it shows no URL, step 3 is not finished (no tunnel URL saved).
  3. Press Generate and save a key. Copy it now: it is shown once, then it lives only in oficinas/<id>/viralhunt.secreto.json and never travels to the chat, the logs or any API answer. (If you prefer, generate the key on ViralHunt's Agents page and paste it here with Save this key; same key on both sides is all that matters.)

The key starts with whsec_: every call ViralHunt makes is signed with it as a Standard Webhook (webhook-id, webhook-timestamp, webhook-signature), the same check a Grok Bot turn gets. A call with a wrong signature is a 401 and nothing runs.

5. Connect it in ViralHunt and test

  1. ViralHunt → Account → Agents → Connect an agent.
  2. Name: how the team will see it in the composer (for example "Office Cerebro Digital"). URL: the one from the card. Key: the one you copied. Capabilities: tick Text and Review; tick Image only if the office's CLI can make pictures.
  3. Connect, then Test. ViralHunt sends a signed ping; the office answers pong in the same HTTP response and the page shows the latency. The office's log says "ViralHunt pinged this office as an agent".

From this moment the office appears in the agent dropdown of every member of your organization. Only owners and admins see the Agents page; everybody uses the agent.

6. The first task, from the composer

  1. Open Publish, pick the project (the brand), write a post and select two or three accounts.
  2. Under the media there is Ask an agent. Pick the office, tap the chip Shorten for X and Bluesky (or write your own request) and send.
  3. Watch the office chat: the request appears as a message from "your name · ViralHunt", the host answers in a read-only turn, and its answer is posted back.
  4. In the composer the agent's note shows, and its changes are applied on the screen: the per-account copies, a corrected body, a first comment, notes, a picture. An Undo button puts everything back. Nothing is saved until you click Save or Publish.

The chips are the common requests: shorten for the short networks, fix spelling and grammar, rewrite in the brand voice, check it before publishing (the office reads the content rule and answers with warnings), translate, make a picture. Any sentence works too: "add the source as a first comment", "make three hooks and keep the best".

7. How it works, in one picture

ViralHunt the composer signed POST Tunnel trycloudflare.com Gate :4323 /bots/vh/<office> Office :4321 verifies, chat host answers one JSON answer to reply_to (one use, 15 min), applied on the screen with Undo

ViralHunt is the caller; the office never needs a ViralHunt token. The key is the only thing shared, and it is shared once.

What the office receives (abridged):

{
  "type": "task",
  "task": { "id": 41, "surface": "post", "prompt": "Shorten this for X and Bluesky", "requested_by": "Ana" },
  "context": {
    "post": { "body": "…the post as it is on the screen…", "first_comment": "", "author_notes": "", "media": [] },
    "project": { "name": "Cerebro Digital", "lang": "es", "voice": "…the brand playbook…" },
    "accounts": [ { "id": 62, "network": "twitter", "text_limit": 280, "selected": true } ],
    "limits": { "twitter": { "text": 280 }, "bluesky": { "text": 300 } }
  },
  "reply_schema": { "text": "string", "fields": { "overrides": { "<account id>": { "body": "string" } } }, "warnings": [] },
  "reply_to": "https://viralhunt.io/tool/api/hooks/r/…",
  "expires_at": "2026-10-28T19:45:00Z"
}

What it answers. Only what changes goes in fields; prose alone still reaches the person as text:

{
  "text": "Two short copies, one per network. The X one keeps the hook, the Bluesky one adds the source.",
  "fields": { "overrides": { "62": { "body": "…280 characters…" }, "63": { "body": "…300 characters…" } } },
  "warnings": []
}

8. What it does today, and what is next

Today the office answers what a person asks from the composer, on the post that is on the screen. That is already the expensive part of the day: the per-network copies, the spelling, the brand voice, the check before publishing.

Not yet, and honestly said: the office does not run on a schedule, does not search for content on its own and does not propose posts by itself. Recurring work, cron jobs, content discovery and content proposals are the next phase, and the design is settled: ViralHunt will send the office a scheduled task ("find three stories for this brand, verify each, leave them as drafts") and the office's answer will become drafts that wait in ViralHunt for a human to read, change and approve. The review loop that exists today for every post is what makes that safe.

If you need the standing job today (take a page's most viral posts, verify, rewrite, make the image, leave a few drafts a day), an agent with a personal token already does it through the skill and the MCP server (/viralhunt:job). Those API queries are metered by plan. The office path described on this page is not metered.

Also planned: the same "Ask an agent" box on the design editor and on the board cards, and publishing a post translated to another project at approval time.

9. When it does not work

What you seeWhat it means and what to do
The agent card in /editorial shows no URLNo tunnel URL is saved. Step 3, point 4: paste the https://…trycloudflare.com address in ⚙ → Connect a Grok Bot → Public tunnel URL and save.
"cloudflared is not recognized" / command not found, or Start the tunnel says it found no binaryThe binary is downloaded but not in your PATH nor in a known folder. Paste its full path in cloudflared path in the ⚙ dialog and press Start the tunnel again, or run it by its full path yourself (the Windows block above does exactly that).
Test says no answer, timeout, or 530 / 502 from CloudflareThe tunnel is down (its terminal closed, or the computer slept) or the gate is down (red line in ⚙). Start the gate, start the tunnel, and if the tunnel printed a NEW address, update it in ⚙ and in ViralHunt → Agents.
Test says 401The two sides hold different keys. Generate a key again in the office card and paste it in the ViralHunt connection (Edit), or the other way round. Only the last saved key counts.
Test says 404 "Office not found"The office id at the end of the URL does not match a folder in oficinas/. Copy the URL from the card again.
Test says 404 "Not found" (no mention of an office)The gate is running an older OfficeMatrix that has no /bots/vh/ route. Pull the repository and restart both node server.js and node puerta-bots.js: a running process keeps the old code until it is restarted.
Pong works, a task never comes back ("expired")The office accepted the task but its turn failed or ran over 3 minutes: the chat host's CLI is not signed in, or the model took too long. Open the office chat: the error is written there. Sign the CLI in, or pick another host in ⚙.
The answer shows as text but nothing changes on the screenThe CLI answered prose instead of the JSON object, or put the change outside fields. It still reaches you as text, so nothing is lost; ask again with a sharper request, or check the "problems" list under the answer for what was dropped.
The agent is missing from the composer dropdownThe organization is on the free plan, or the connection was removed. The box shows for every member once an owner or admin has connected an agent on a paid plan.

10. Not using OfficeMatrix? Three other ways in

Your own server

Any https endpoint that verifies the signature, answers 202 and POSTs one JSON to reply_to. The Agents page writes the brief for your agent with your URL and key filled in, and has a five-minute test with webhook.site and no code.

Grok Bot

A routine with a webhook trigger gives you its URL and a whsec_ key: paste both. On type: ping the routine POSTs pong to reply_to.

No public URL at all

Claude Code or Codex on a laptop with no tunnel comes in through the API with its own personal token from API Access: it polls GET /v1/agent-tasks.php and answers by API. Metered by plan like every API call.

The other direction

This page is ViralHunt calling your agent. The webhooks guide is the other direction: your brand's alerts POSTed to Discord, Slack, n8n or your agent when a discussion gains comments fast.

Reference. OfficeMatrix: github.com/rodvan/OfficeMatrix (Apache-2.0), guide docs/VIRALHUNT-AGENT.md. ViralHunt: the protocol, the answer codes and the brief are on the Agents page; the token path is agent-tasks in the API reference.

Start with the account

Create an account, connect the brand's social accounts, and bring your own agent: the Agents page writes the brief for it and the Test button says pong.

Create a free account See the plans