node-red-contrib-ibmbob 0.1.5
Node-RED node to call IBM Bob Shell (bob) in headless mode and return the answer plus usage stats (cost / duration / tool calls).
node-red-contrib-ibmbob
A Node-RED node that calls IBM Bob Shell (bob, 2.0+) in headless mode and returns the answer plus usage stats (cost / duration / tool calls).
Node-RED のフローから IBM Bob Shell(bob)を呼び出し、回答と使用量 stats(コスト・所要時間・ツール呼び出し数)を返すノードです。
msg.payload(a prompt) → runbob run --format json→msg.payload= the answer,msg.stats= usage.msg.payload(プロンプト)→bob run --format jsonを実行 →msg.payloadに回答、msg.statsに使用量。
English
Requirements
bob(IBM Bob Shell 2.0+) installed on the machine running Node-RED, onPATH.- Authentication via an API key (
BOB_API_KEY), set in the node's API Key credential. - If the key is of type
general, also set Team ID (not needed for anInference-scoped key).
Install
Use Node-RED's Manage palette and search for node-red-contrib-ibmbob, or:
cd ~/.node-red
npm install node-red-contrib-ibmbob
Usage
- Input:
msg.payload(string) — the prompt sent to Bob. - Output:
msg.payload— the final answer (last_message)msg.stats—{ duration_ms, session_costs, tool_calls, ... }msg.bob— the full raw JSON frombob
A minimal flow: inject (set payload to a prompt) → ibmbob → debug.
Options
| Option | Description |
|---|---|
| API Key | BOB_API_KEY (required, stored as an encrypted credential) |
| Team ID | required only for a general-type key |
| Mode | agent (default) / ask |
| Timeout (ms) | default 120000. LLM calls can be slow — give it room |
| Max turns / Max cost | guardrails (--max-turns / --max-cost) |
| Disable MCP | adds --disable-mcp to skip MCP init for speed |
Notes
- The node runs
bobviachild_process.execFileand closes stdin immediately —bob runblocks waiting on stdin otherwise. If you build a similar integration yourself, remember to end stdin. - LLM calls are asynchronous; the node uses the Node-RED
send/donepattern and anexecFiletimeout. - Read-only by default. Enabling write-capable tools requires the corresponding Bob-side setting; keep it conservative in automation.
日本語
要件
- Node-RED を動かすマシンに
bob(IBM Bob Shell 2.0+) がインストール済みでPATHが通っていること。 - 認証は API キー(
BOB_API_KEY)。ノードの API Key(credentials)に設定します。 - キー種別が
generalの場合は Team ID も設定(Inferenceスコープのキーなら不要)。
インストール
Node-RED の パレット管理(Manage palette) で node-red-contrib-ibmbob を検索、または:
cd ~/.node-red
npm install node-red-contrib-ibmbob
使い方
- 入力:
msg.payload(文字列)= Bob に渡すプロンプト - 出力:
msg.payload— 最終回答(last_message)msg.stats—{ duration_ms, session_costs, tool_calls, ... }msg.bob—bobの生 JSON 全体
最小フロー: inject(payload にプロンプト)→ ibmbob → debug。
オプション
| 項目 | 説明 |
|---|---|
| API Key | BOB_API_KEY(必須・暗号化 credential 保存) |
| Team ID | general キーのときのみ必要 |
| Mode | agent(既定)/ ask |
| Timeout(ms) | 既定 120000。LLM 呼び出しは長引くので余裕を |
| Max turns / Max cost | 暴走・課金の予防線(--max-turns / --max-cost) |
| Disable MCP | --disable-mcp を付けて MCP 初期化を飛ばし高速化 |
補足
- ノードは
child_process.execFileでbobを実行し、stdin を即クローズします(bob runは stdin が開いたままだと入力待ちでハングするため)。同様の連携を自作する場合も stdin を閉じるのを忘れずに。 - LLM 呼び出しは非同期のため、Node-RED の
send/done作法とexecFileの timeout で実装しています。 - 既定は read-only 寄り。書き込み系ツールを使わせる場合は Bob 側の設定が必要ですが、自動化では控えめに倒すのが安全です。
License
MIT © 2026 Shoichiro Sakaigawa
Status
v0.1.0 — initial release (stdio / execFile). Verified end-to-end on a live Node-RED instance. If IBM Bob exposes a public HTTP API, an HTTP transport may be added later.