Examples
Plugins (read the built-in plugin source)
| Repo | Pattern |
|---|---|
@vibecontrols/vibe-plugin-session-tmux | SessionProvider implementation (23 methods) |
@vibecontrols/vibe-plugin-tunnel-cloudflare | Subprocess-driven provider with state persistence |
@vibecontrols/vibe-plugin-tunnel-vibetunnels | frp-based provider |
@vibecontrols/vibe-plugin-ai | Multi-provider orchestration + REST routes |
@vibecontrols/vibe-plugin-agent-backup | Pluggable backend pattern |
@vibecontrols/vibe-plugin-plan | Stream interception + portal integration |
Source: github.com/algoshred — search for vibe-plugin-*.
Idempotent webhook receiver
import {createHmac} from "crypto";
import express from "express";
const seen = new Set<string>();
const app = express();
app.use(express.raw({type: "application/json"}));
app.post("/vibe-webhook", (req, res) => {
const deliveryId = req.headers["x-vibecontrols-delivery-id"] as string;
if (seen.has(deliveryId)) return res.sendStatus(200);
const sig = req.headers["x-vibecontrols-signature"] as string;
const parts = Object.fromEntries(sig.split(",").map(p => p.trim().split("=")));
const expected = createHmac("sha256", process.env.SECRET!)
.update(`${parts.t}.${req.body.toString()}`)
.digest("hex");
if (expected !== parts.v1) return res.sendStatus(401);
seen.add(deliveryId);
// ... process payload
res.sendStatus(200);
});
app.listen(8080);
Drive sessions from a script (via REST)
import {readFile} from "fs/promises";
import {homedir} from "os";
const config = JSON.parse(
await readFile(`${homedir()}/.boff/vibecontrols/agents/<id>/config.json`, "utf8")
);
const KEY = config.agentApiKey;
const BASE = "http://localhost:3005/api/profiles/default";
async function callAgent(path: string, opts: RequestInit = {}) {
const res = await fetch(`${BASE}${path}`, {
...opts,
headers: {...opts.headers, "x-agent-api-key": KEY},
});
return res.json();
}
// List tmux sessions
const sessions = await callAgent("/tmux");
// Send a command to a session
await callAgent(`/tmux/${sessions[0].id}/send`, {
method: "POST",
headers: {"content-type": "application/json"},
body: JSON.stringify({command: "ls -la"}),
});
Auto-create a vibe when a repo is cloned
import {execFile} from "child_process";
import {promisify} from "util";
const exec = promisify(execFile);
async function onRepoCloned(repoPath: string, repoUrl: string) {
const name = repoPath.split("/").pop()!;
await exec("vibecontrols", [
"vibes", "create",
"--name", name,
"--path", repoPath,
"--type", "REPOSITORY",
"--git-remote", repoUrl,
]);
}