---
name: realtimex-moderator-sdk
description: "Use the RealTimeX API through the generated CLI for workspace, thread, terminal-agent sessions, channel (Telegram, Zalo, Discord), skills, plugins and send messages, setup personality, heartbeat tasks operations."
author: ""
license: "Apache-2.0"
argument-hint: "<command> [args] | install cli"
allowed-tools: "Read Bash"
metadata:
  openclaw:
    requires:
      bins:
        - realtimex-pp-cli
---

# Realtimex — Printing Press CLI

## Prerequisites: Install the CLI

This skill drives the `realtimex-pp-cli` binary. Verify the CLI is installed and exactly matches this skill's SDK version before invoking any command from this skill. If it is missing or the version does not match, reinstall the pinned version first:

1. Install or reinstall the pinned version via npm:
   ```bash
   npm install -g @realtimex/pp-cli@2.0.12
   ```
2. Verify the exact version:
   ```bash
   realtimex-pp-cli --version
   ```
   The output must be `realtimex-pp-cli 2.0.12`.

If `--version` reports "command not found" after install, the npm global bin directory is not on `$PATH`. If it reports any version other than `2.0.12`, reinstall with the pinned npm command above. Do not proceed with skill commands until exact-version verification succeeds.

* Always run first:

  ```bash
  realtimex-pp-cli prepare --workspace-slug "$RTX_WORKSPACE_SLUG" --thread-slug "$RTX_THREAD_SLUG" --agent
  ```

## Command Reference

**approve-channel-pairing-code** — Manage approve channel pairing code

- `realtimex-pp-cli approve-channel-pairing-code <code>` — Approve one pending channel pairing code by visible 6-digit code or database id.

**clear-workspace-default-agent** — Manage clear workspace default agent

- `realtimex-pp-cli clear-workspace-default-agent <workspaceSlug>` — Clear the default CLI agent from a workspace.

**create-channel** — Manage create channel

- `realtimex-pp-cli create-channel <workspaceSlug>` — Create a chat channel in one exact workspace. Defaults to Telegram when plugin_type, channelType, and type are omitted.

**create-thread** — Manage create thread

- `realtimex-pp-cli create-thread <workspaceSlug>` — Create a thread in one workspace. The name is optional but recommended.

**create-workspace** — Manage create workspace

- `realtimex-pp-cli create-workspace` — Create a workspace. Requires a human-readable workspace name.

**delete-channel** — Manage delete channel

- `realtimex-pp-cli delete-channel <channelId>` — Delete one chat channel by exact channel id.

**delete-thread** — Manage delete thread

- `realtimex-pp-cli delete-thread <workspaceSlug> <threadSlug>` — Delete one thread by exact workspace slug and exact thread slug.

**delete-workspace** — Manage delete workspace

- `realtimex-pp-cli delete-workspace <workspaceSlug>` — Delete one workspace by exact workspace slug.

**disable-plugin** — Manage disable plugin

- `realtimex-pp-cli disable-plugin <pluginId>` — Disable one installed plugin globally and unload it from runtime.

**disable-workspace-agent-skill** — Manage disable workspace agent skill

- `realtimex-pp-cli disable-workspace-agent-skill <workspaceSlug> <skillId>` — Disable one agent skill in a workspace. Use a skill id, name, or displayName from list-workspace-agent-skills.

**enable-plugin** — Manage enable plugin

- `realtimex-pp-cli enable-plugin <pluginId>` — Enable one installed plugin globally and load it into runtime. Use a plugin id, name, or displayName from list-plugins.

**enable-workspace-agent-skill** — Manage enable workspace agent skill

- `realtimex-pp-cli enable-workspace-agent-skill <workspaceSlug> <skillId>` — Enable one agent skill in a workspace. Use a skill id, name, or displayName from list-workspace-agent-skills.

**get-thread** — Manage get thread

- `realtimex-pp-cli get-thread <workspaceSlug> <threadSlug>` — Get one thread by exact workspace slug and exact thread slug.

**get-workspace** — Manage get workspace

- `realtimex-pp-cli get-workspace <workspaceSlug>` — Get one workspace by exact workspace slug.

**list-agent-skills** — Manage list agent skills

- `realtimex-pp-cli list-agent-skills` — List published agent skills. Use list-workspace-agent-skills to see enabled/disabled state for one workspace.

**list-channels** — Manage list channels

- `realtimex-pp-cli list-channels` — List configured chat channels. Use returned channel ids with update-channel.

**list-llm-models** — Manage list llm models

- `realtimex-pp-cli list-llm-models <provider>` — List models for one provider id.

**list-llm-providers** — Manage list llm providers

- `realtimex-pp-cli list-llm-providers` — List supported LLM providers. Use provider ids from this response when configuring workspace or thread LLM settings.

**list-plugins** — Manage list plugins

- `realtimex-pp-cli list-plugins` — List installed plugins with enabled state and runtime load status.

**list-terminal-agents** — Manage list terminal agents

- `realtimex-pp-cli list-terminal-agents` — List terminal CLI agents that can be used with open-terminal-session.

**list-terminal-sessions** — Manage list terminal sessions

- `realtimex-pp-cli list-terminal-sessions` — List terminal runtime sessions known to the desktop app. Optionally filter by workspaceSlug and threadSlug.

**list-threads** — Manage list threads

- `realtimex-pp-cli list-threads <workspaceSlug>` — List threads for one exact workspace slug.

**list-workspace-agent-skills** — Manage list workspace agent skills

- `realtimex-pp-cli list-workspace-agent-skills <workspaceSlug>` — List published agent skills with enabled/disabled state for one exact workspace slug.

**list-workspaces** — Manage list workspaces

- `realtimex-pp-cli list-workspaces` — List all workspaces visible to the current API caller. Use this before choosing a workspace slug.

**open-terminal-session** — Manage open terminal session

- `realtimex-pp-cli open-terminal-session` — Open a new desktop terminal session for one terminal CLI agent. Use list-terminal-agents or prepare.

**prepare** — Manage prepare

- `realtimex-pp-cli prepare` — Return compact workspace, thread, current workspace/thread from explicit workspaceSlug and threadSlug query parameters

**reload-agent-skills** — Manage reload agent skills

- `realtimex-pp-cli reload-agent-skills` — Force reload all enabled agent skills into one workspace working directory.

**reload-plugin** — Manage reload plugin

- `realtimex-pp-cli reload-plugin <pluginId>` — Reload one enabled plugin in runtime. Disabled plugins must be enabled before reload.

**rename-thread** — Manage rename thread

- `realtimex-pp-cli rename-thread <workspaceSlug> <threadSlug>` — Rename one thread by exact workspace slug and exact thread slug. Only the name is changed.

**rename-workspace** — Manage rename workspace

- `realtimex-pp-cli rename-workspace <workspaceSlug>` — Rename one workspace by exact workspace slug. Only the name is changed.

**resume-latest-terminal-session** — Manage resume latest terminal session

- `realtimex-pp-cli resume-latest-terminal-session` — Resume the latest terminal runtime session for one exact thread.

**resume-terminal-session** — Manage resume terminal session

- `realtimex-pp-cli resume-terminal-session <sessionId>` — Resume a terminal runtime session by attaching a CLI controller.

**send-message** — Manage send message

- `realtimex-pp-cli send-message <workspaceSlug> <threadSlug>` — Send one message to an exact thread using the same routing as channel replies.

**set-heartbeat-active-hours** — Manage set heartbeat active hours

- `realtimex-pp-cli set-heartbeat-active-hours` — Set workspace or global ambient-agent active hours using HH:mm start and end values.

**set-heartbeat-auto-pilot** — Manage set heartbeat auto pilot

- `realtimex-pp-cli set-heartbeat-auto-pilot` — Turn workspace or global ambient-agent heartbeat auto pilot on or off.

**set-heartbeat-default-agent** — Manage set heartbeat default agent

- `realtimex-pp-cli set-heartbeat-default-agent` — Set workspace or global ambient-agent main executor default terminal agent and optional model.

**set-heartbeat-enabled** — Manage set heartbeat enabled

- `realtimex-pp-cli set-heartbeat-enabled` — Turn workspace or global ambient-agent heartbeat on or off.

**set-heartbeat-interval** — Manage set heartbeat interval

- `realtimex-pp-cli set-heartbeat-interval` — Set workspace or global ambient-agent main executor interval.

**set-heartbeat-timezone** — Manage set heartbeat timezone

- `realtimex-pp-cli set-heartbeat-timezone` — Set workspace or global ambient-agent heartbeat timezone, for example Asia/Saigon or UTC.

**set-workspace-default-agent** — Manage set workspace default agent

- `realtimex-pp-cli set-workspace-default-agent <workspaceSlug>` — Set the default CLI agent for a workspace.

**setup-heartbeat-tasks** — Manage setup heartbeat tasks

- `realtimex-pp-cli setup-heartbeat-tasks` — Set up HEARTBEAT.md task instructions for a workspace or global ambient agent.

**setup-personality** — Manage setup personality

- `realtimex-pp-cli setup-personality` — Set up AGENTS.md and CLAUDE.md personality files for a workspace or global ambient agent.

**start-channel** — Manage start channel

- `realtimex-pp-cli start-channel <channelId>` — Start one chat channel by exact channel id.

**stop-channel** — Manage stop channel

- `realtimex-pp-cli stop-channel <channelId>` — Stop one chat channel by exact channel id.

**terminate-terminal-session** — Manage terminate terminal session

- `realtimex-pp-cli terminate-terminal-session <sessionId>` — Terminate a terminal runtime session by detaching any controller and closing the underlying PTY session.

**trigger-workspace-heartbeat** — Manage trigger workspace heartbeat

- `realtimex-pp-cli trigger-workspace-heartbeat <workspaceSlug>` — Trigger the main heartbeat executor for a workspace immediately. Scheduled tasks are ignored.

**trigger-workspace-heartbeat-tasks** — Manage trigger workspace heartbeat tasks

- `realtimex-pp-cli trigger-workspace-heartbeat-tasks <workspaceSlug>` — Trigger specified HEARTBEAT.md task names for a workspace immediately.

**update-channel** — Manage update channel

- `realtimex-pp-cli update-channel <channelId>` — Update one chat channel by exact channel id. Only channel writable fields are changed.


### Finding the right command

When you know what you want to do but not which command does it, ask the CLI directly:

```bash
realtimex-pp-cli which "<capability in your own words>"
```

`which` resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code `0` means at least one match; exit code `2` means no confident match — fall back to `--help` or use a narrower query.

## Auth Setup
Run `realtimex-pp-cli auth setup` to print the URL and steps for getting a key (add `--launch` to open the URL). Then set:

```bash
export REALTIMEX_APP_ID_AUTH="<your-key>"
```

Or persist it in `~/.config/realtimex-cli-pp-cli/config.toml`.

Run `realtimex-pp-cli doctor` to verify setup.

## Agent Mode

Add `--agent` to any command. Expands to: `--json --compact --no-input --no-color --yes`.

- **Pipeable** — JSON on stdout, errors on stderr
- **Filterable** — `--select` keeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:

  ```bash
  realtimex-pp-cli approve-channel-pairing-code mock-value --agent --select id,name,status
  ```
- **Previewable** — `--dry-run` shows the request without sending
- **Offline-friendly** — sync/search commands can use the local SQLite store when available
- **Non-interactive** — never prompts, every input is a flag
- **Explicit retries** — use `--idempotent` only when an already-existing create should count as success, and `--ignore-missing` only when a missing delete target should count as success

### Response envelope

Commands that read from the local store or the API wrap output in a provenance envelope:

```json
{
  "meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
  "results": <data>
}
```

Parse `.results` for data and `.meta.source` to know whether it's live or local. A human-readable `N results (live)` summary is printed to stderr only when stdout is a terminal AND no machine-format flag (`--json`, `--csv`, `--compact`, `--quiet`, `--plain`, `--select`) is set — piped/agent consumers and explicit-format runs get pure JSON on stdout.

## Agent Feedback

When you (or the agent) notice something off about this CLI, record it:

```
realtimex-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
realtimex-pp-cli feedback --stdin < notes.txt
realtimex-pp-cli feedback list --json --limit 10
```

Entries are stored locally at `~/.local/share/realtimex-pp-cli/feedback.jsonl`. They are never POSTed unless `REALTIMEX_FEEDBACK_ENDPOINT` is set AND either `--send` is passed or `REALTIMEX_FEEDBACK_AUTO_SEND=true`. Default behavior is local-only.

Write what *surprised* you, not a bug report. Short, specific, one line: that is the part that compounds.

## Output Delivery

Every command accepts `--deliver <sink>`. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:

| Sink | Effect |
|------|--------|
| `stdout` | Default; write to stdout only |
| `file:<path>` | Atomically write output to `<path>` (tmp + rename) |
| `webhook:<url>` | POST the output body to the URL (`application/json` or `application/x-ndjson` when `--compact`) |

Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.

## Named Profiles

A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.

```
realtimex-pp-cli profile save briefing --json
realtimex-pp-cli --profile briefing approve-channel-pairing-code mock-value
realtimex-pp-cli profile list --json
realtimex-pp-cli profile show briefing
realtimex-pp-cli profile delete briefing --yes
```

Explicit flags always win over profile values; profile values win over defaults. `agent-context` lists all available profiles under `available_profiles` so introspecting agents discover them at runtime.

## Exit Codes

| Code | Meaning |
|------|---------|
| 0 | Success |
| 2 | Usage error (wrong arguments) |
| 3 | Resource not found |
| 4 | Authentication required |
| 5 | API error (upstream issue) |
| 7 | Rate limited (wait and retry) |
| 10 | Config error |

## Argument Parsing

Parse `$ARGUMENTS`:

1. **Empty, `help`, or `--help`** → show `realtimex-pp-cli --help` output
2. **Starts with `install`** → ends with `mcp` → MCP installation; otherwise → see Prerequisites above
3. **Anything else** → Direct Use (execute as CLI command with `--agent`)

## MCP Server Installation

Install the MCP binary from this CLI's published public-library entry or pre-built release, then register it:

```bash
claude mcp add realtimex-pp-mcp -- realtimex-pp-mcp
```

Verify: `claude mcp list`

## Direct Use

1. Check whether the CLI is installed and version-matched:
   ```bash
   realtimex-pp-cli --version
   ```
   If the command is missing or the output is not exactly `realtimex-pp-cli 2.0.12`, reinstall the pinned version:
   ```bash
   npm install -g @realtimex/pp-cli@2.0.12
   ```
   Then run `realtimex-pp-cli --version` again and proceed only after exact-version verification succeeds.
2. Match the user query to the best command from the Unique Capabilities and Command Reference above.
3. Execute with the `--agent` flag:
   ```bash
   realtimex-pp-cli <command> [subcommand] [args] --agent
   ```
4. If ambiguous, drill into subcommand help: `realtimex-pp-cli <command> --help`.

## Constraints

This skill intentionally exposes a small action-first command set. Prefer these generated commands over older nested resource commands.

* Use only documented `realtimex-pp-cli` commands.
* Never call the RealTimeX API directly with `curl`, `fetch`, raw HTTP clients, or custom scripts.
* If the current CLI cannot do the requested task, say the feature is not available and will be added soon.
* Use `--agent` on every command.
* Treat `$RTX_WORKSPACE_SLUG` as the current workspace slug when it is set, and `$RTX_THREAD_SLUG` as the current thread slug when it is set.
* For requests that refer to "current workspace", "this workspace", "current thread", or "this thread", use those environment values directly when they are available.
* When you need the resolved current workspace/thread objects or related context, call:

  ```bash
  realtimex-pp-cli prepare --workspace-slug "$RTX_WORKSPACE_SLUG" --thread-slug "$RTX_THREAD_SLUG" --agent
  ```

* If `$RTX_WORKSPACE_SLUG` or `$RTX_THREAD_SLUG` is missing for a current-context request that requires it, ask for the missing workspace or thread before running the command.
* Always run first:

  ```bash
  realtimex-pp-cli prepare --workspace-slug "$RTX_WORKSPACE_SLUG" --thread-slug "$RTX_THREAD_SLUG" --agent
  ```

* Use exact workspace slugs, thread slugs, provider ids, model ids, agent `canonical`, and agent `modelId` values from `prepare`.
* Do not guess workspace, thread, model, provider, agent, message, target, or option values.
* If required context is missing or ambiguous, ask a concise clarification question before running a command.
* Never assume a workspace or thread that the user has not referenced.
* If the user does not name or contextually reference a workspace for a workspace/thread/message operation, ask which workspace to use before running a command.
* If the user names or contextually references a thread but does not name or contextually reference its workspace, ask which workspace contains that thread before running a command.
* When the user explicitly uses contextual references such as "current workspace", "this thread", "the thread just created", "that workspace", or similar references, resolve them from the available conversation context only when the reference is unambiguous.
* If multiple plausible matches exist, ask the user to choose.

For `send-message`:

* Require these values to be explicitly named or explicitly referenced in the current request:
  * workspace
  * thread
  * message
* If any of those values are missing or ambiguous, ask for the missing values before running the command.
* Do not provide LLM provider/model arguments to `send-message`; the server routes the message based on the thread/workspace configuration.

For workspace default-agent setup:

* Use `prepare.agents` only.
* Use exact agent `canonical` and optional agent `modelId` values from `prepare.agents`.
* Never use `prepare.models` for workspace default-agent setup.

For terminal agents and terminal sessions:

* Use `list-terminal-agents` when you only need available terminal agents. Use `prepare` when you also need workspace/thread/provider/model context.
* Use `open-terminal-session` to open a new desktop terminal session for a terminal agent. It auto-attaches the CLI controller through the desktop runtime launch request.
* Use exact `agentName`, `providerId`, and `modelId` values from `list-terminal-agents` or `prepare.agents`.
* When opening a terminal session for the current thread, pass both `--workspace-slug "$RTX_WORKSPACE_SLUG"` and `--thread-slug "$RTX_THREAD_SLUG"`.
* Use `list-terminal-sessions` to inspect grouped terminal sessions by `workspaceSlug` and `threadSlug`. Each session includes compact identity fields and `attached` status.
* Use `resume-terminal-session` or `resume-latest-terminal-session` to resume + attach an existing session. Use `terminate-terminal-session` to close + detach a session.

For agent skills:

* Use `list-workspace-agent-skills` before enabling, disabling, or reloading workspace skills.
* For `reload-agent-skills`, always pass a workspace slug.
* If the user asks to reload skills for the current workspace, pass `--workspace-slug "$RTX_WORKSPACE_SLUG"`.
* After `reload-agent-skills` succeeds, reload your own skill context before relying on updated skill instructions.

For personality and heartbeat setup:

* Use `setup-personality` to get the target directory for workspace or global personality files.
* Start from `templates/AGENTS.template.md` when creating `AGENTS.md`.
* Make `CLAUDE.md` a symlink to `AGENTS.md`.
* Use `setup-heartbeat-tasks` to get the target `HEARTBEAT.md` path.
* Start from `templates/HEARTBEAT.template.md` when creating `HEARTBEAT.md`.
* Keep heartbeat instructions separate from personality files.
