openrune 0.3.22 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -198
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<h1 align="center">Rune</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<strong>
|
|
9
|
-
|
|
8
|
+
<strong>The simplest agent harness for Claude Code</strong><br/>
|
|
9
|
+
No SDK. No boilerplate. Just one file per agent.
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
@@ -17,304 +17,208 @@
|
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Install
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- **Agent chaining** — Pipe agents together in a pipeline. Output → input, automatically.
|
|
27
|
-
- **Automated triggers** — Run agents on file changes, git commits, or a cron schedule.
|
|
28
|
-
- **Node.js API** — Use agents programmatically with `require('openrune')`.
|
|
29
|
-
- **Desktop UI** — Chat interface with real-time activity monitoring and built-in terminal.
|
|
22
|
+
```bash
|
|
23
|
+
npm install -g @anthropic-ai/claude-code # prerequisite
|
|
24
|
+
npm install -g openrune
|
|
25
|
+
```
|
|
30
26
|
|
|
31
27
|
---
|
|
32
28
|
|
|
33
|
-
##
|
|
34
|
-
|
|
35
|
-
Building a Claude Code harness usually means wiring up process management, I/O parsing, state handling, and a UI from scratch. Rune lets you skip all of that — just drop a file and go.
|
|
36
|
-
|
|
37
|
-
**No harness boilerplate** — No SDK wiring, no process management, no custom I/O parsing. One `.rune` file gives you a fully working agent you can run from CLI, scripts, or the desktop UI.
|
|
29
|
+
## 30-Second Harness
|
|
38
30
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
**Multiple agents per project** — A reviewer, a backend dev, a designer — each with its own role and history, working side by side in the same folder.
|
|
31
|
+
```bash
|
|
32
|
+
rune new reviewer --role "Code reviewer, security focused"
|
|
33
|
+
rune run reviewer.rune "Review the latest commit"
|
|
34
|
+
```
|
|
44
35
|
|
|
45
|
-
|
|
36
|
+
That's it. You just built an agent harness.
|
|
46
37
|
|
|
47
38
|
---
|
|
48
39
|
|
|
49
|
-
##
|
|
40
|
+
## Core Concepts
|
|
50
41
|
|
|
51
|
-
###
|
|
52
|
-
|
|
53
|
-
- **Node.js** 18+
|
|
54
|
-
- **Claude Code CLI** — `npm install -g @anthropic-ai/claude-code`
|
|
55
|
-
|
|
56
|
-
### 1. Install
|
|
42
|
+
### One file = one agent
|
|
57
43
|
|
|
58
44
|
```bash
|
|
59
|
-
|
|
45
|
+
rune new architect --role "Software architect"
|
|
46
|
+
rune new coder --role "Backend developer"
|
|
47
|
+
rune new reviewer --role "Code reviewer"
|
|
60
48
|
```
|
|
61
49
|
|
|
62
|
-
|
|
50
|
+
Each `.rune` file is just JSON — portable, shareable, version-controllable:
|
|
63
51
|
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"name": "reviewer",
|
|
55
|
+
"role": "Code reviewer, security focused",
|
|
56
|
+
"history": [],
|
|
57
|
+
"memory": []
|
|
58
|
+
}
|
|
67
59
|
```
|
|
68
60
|
|
|
69
|
-
###
|
|
61
|
+
### Headless execution
|
|
62
|
+
|
|
63
|
+
Run agents from the terminal. No GUI needed:
|
|
70
64
|
|
|
71
65
|
```bash
|
|
72
|
-
# Headless — run from CLI, get results in your terminal
|
|
73
66
|
rune run reviewer.rune "Review the latest commit"
|
|
74
67
|
|
|
75
68
|
# Pipe input from other commands
|
|
76
69
|
git diff | rune run reviewer.rune "Review this diff"
|
|
77
70
|
|
|
78
|
-
#
|
|
79
|
-
rune
|
|
71
|
+
# JSON output for scripting
|
|
72
|
+
rune run reviewer.rune "Check for security issues" --output json
|
|
80
73
|
```
|
|
81
74
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
## Use Cases
|
|
75
|
+
### Autonomous mode
|
|
85
76
|
|
|
86
|
-
|
|
77
|
+
With `--auto`, agents write files, run commands, and fix errors on their own:
|
|
87
78
|
|
|
88
|
-
**Automated code review** — Set up a trigger to review every commit automatically:
|
|
89
79
|
```bash
|
|
90
|
-
rune
|
|
80
|
+
rune run coder.rune "Create an Express server with a /health endpoint. Run npm init and npm install." --auto
|
|
91
81
|
```
|
|
92
82
|
|
|
93
|
-
**CI/CD integration** — Run agents headlessly in your pipeline:
|
|
94
|
-
```bash
|
|
95
|
-
rune run qa.rune "Run tests and report any failures" --output json
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
**Agent pipeline** — Chain specialized agents for complex tasks:
|
|
99
|
-
```bash
|
|
100
|
-
rune pipe architect.rune coder.rune reviewer.rune "Add OAuth2 login flow"
|
|
101
83
|
```
|
|
84
|
+
🔮 [auto] coder is working on: Create an Express server...
|
|
102
85
|
|
|
103
|
-
|
|
86
|
+
▶ Write: /path/to/server.js
|
|
87
|
+
▶ Bash: npm init -y
|
|
88
|
+
▶ Bash: npm install express
|
|
89
|
+
💬 Server created and dependencies installed.
|
|
104
90
|
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
rune watch ops.rune --on cron --interval 10m --prompt "Check if the API is healthy"
|
|
91
|
+
✓ coder finished
|
|
108
92
|
```
|
|
109
93
|
|
|
110
|
-
|
|
94
|
+
### Agent pipeline
|
|
111
95
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
### Headless execution
|
|
115
|
-
|
|
116
|
-
Run any `.rune` agent from the command line without opening the GUI:
|
|
96
|
+
Chain agents. Each agent's output feeds into the next:
|
|
117
97
|
|
|
118
98
|
```bash
|
|
119
|
-
rune
|
|
120
|
-
|
|
121
|
-
# Pipe input from other commands
|
|
122
|
-
git diff | rune run reviewer.rune "Review this diff"
|
|
123
|
-
|
|
124
|
-
# JSON output for scripting
|
|
125
|
-
rune run reviewer.rune "Review src/auth.ts" --output json
|
|
99
|
+
rune pipe architect.rune coder.rune "Build a REST API with Express"
|
|
126
100
|
```
|
|
127
101
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
Chain multiple agents into a pipeline. The output of each agent becomes the input for the next:
|
|
102
|
+
With `--auto`, the last agent executes the plan:
|
|
131
103
|
|
|
132
104
|
```bash
|
|
133
|
-
rune pipe
|
|
105
|
+
rune pipe architect.rune coder.rune "Build a REST API with Express" --auto
|
|
134
106
|
```
|
|
135
107
|
|
|
136
|
-
|
|
108
|
+
architect designs → coder implements (writes files, installs deps).
|
|
137
109
|
|
|
138
110
|
### Automated triggers
|
|
139
111
|
|
|
140
|
-
Set agents to run automatically on events:
|
|
141
|
-
|
|
142
112
|
```bash
|
|
143
|
-
#
|
|
113
|
+
# On every git commit
|
|
144
114
|
rune watch reviewer.rune --on git-commit --prompt "Review this commit"
|
|
145
115
|
|
|
146
|
-
#
|
|
116
|
+
# On file changes
|
|
147
117
|
rune watch linter.rune --on file-change --glob "src/**/*.ts" --prompt "Check for issues"
|
|
148
118
|
|
|
149
|
-
#
|
|
119
|
+
# On a schedule
|
|
150
120
|
rune watch monitor.rune --on cron --interval 5m --prompt "Check server health"
|
|
151
121
|
```
|
|
152
122
|
|
|
153
123
|
### Node.js API
|
|
154
124
|
|
|
155
|
-
Use
|
|
125
|
+
Use agents in your own code:
|
|
156
126
|
|
|
157
127
|
```js
|
|
158
128
|
const rune = require('openrune')
|
|
159
129
|
|
|
160
130
|
const reviewer = rune.load('reviewer.rune')
|
|
161
131
|
const result = await reviewer.send('Review the latest commit')
|
|
162
|
-
console.log(result)
|
|
163
132
|
|
|
164
|
-
//
|
|
133
|
+
// Pipeline
|
|
165
134
|
const { finalOutput } = await rune.pipe(
|
|
166
|
-
['
|
|
167
|
-
'
|
|
135
|
+
['architect.rune', 'coder.rune'],
|
|
136
|
+
'Build a REST API'
|
|
168
137
|
)
|
|
169
138
|
```
|
|
170
139
|
|
|
171
140
|
---
|
|
172
141
|
|
|
173
|
-
##
|
|
174
|
-
|
|
175
|
-
Rune also includes a desktop app for interactive use. Double-click a `.rune` file or run `rune open`.
|
|
176
|
-
|
|
177
|
-
- **Chat interface** — Markdown rendering, file attachment, stream cancellation.
|
|
178
|
-
- **Real-time activity** — See every tool call, result, and permission request as it happens via [Claude Code hooks](https://docs.anthropic.com/en/docs/claude-code/hooks).
|
|
179
|
-
- **Built-in terminal** — Raw Claude Code output and your own commands, side by side.
|
|
180
|
-
- **Right-click to create** — macOS Quick Action lets you create agents from Finder.
|
|
181
|
-
|
|
182
|
-
<p align="center">
|
|
183
|
-
<img src="demo.gif" width="100%" alt="Rune demo" />
|
|
184
|
-
</p>
|
|
142
|
+
## Example: Agent-Powered API Server
|
|
185
143
|
|
|
186
|
-
|
|
144
|
+
A full walkthrough — from zero to a running server built by agents.
|
|
187
145
|
|
|
188
|
-
|
|
146
|
+
### 1. Install and create agents
|
|
189
147
|
|
|
190
|
-
|
|
148
|
+
```bash
|
|
149
|
+
npm install -g openrune
|
|
150
|
+
mkdir my-project && cd my-project
|
|
191
151
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
"role": "Code reviewer, security focused",
|
|
196
|
-
"createdAt": "2025-01-01T00:00:00Z",
|
|
197
|
-
"history": [],
|
|
198
|
-
"memory": []
|
|
199
|
-
}
|
|
152
|
+
rune new architect --role "Software architect. Design system architecture concisely."
|
|
153
|
+
rune new coder --role "Backend developer. Implement code based on the given plan."
|
|
154
|
+
rune new reviewer --role "Code reviewer. Review for bugs and security issues."
|
|
200
155
|
```
|
|
201
156
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
## CLI Commands
|
|
207
|
-
|
|
208
|
-
| Command | Description |
|
|
209
|
-
|---------|-------------|
|
|
210
|
-
| `rune new <name>` | Create a `.rune` file in the current directory |
|
|
211
|
-
| `rune new <name> --role "..."` | Create with a custom role |
|
|
212
|
-
| `rune run <file.rune> "prompt"` | Run agent headlessly (no GUI) |
|
|
213
|
-
| `rune pipe <a.rune> <b.rune> "prompt"` | Chain agents in a pipeline |
|
|
214
|
-
| `rune watch <file.rune> --on <event>` | Set up automated triggers |
|
|
215
|
-
| `rune open <file.rune>` | Open a `.rune` file (desktop GUI) |
|
|
216
|
-
| `rune list` | List `.rune` files in the current directory |
|
|
217
|
-
| `rune install` | Build app, register file association, install Quick Action |
|
|
218
|
-
| `rune uninstall` | Remove Rune integration (keeps your `.rune` files) |
|
|
219
|
-
|
|
220
|
-
---
|
|
157
|
+
### 2. Agents collaborate to build a server
|
|
221
158
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
```
|
|
225
|
-
┌─────────────────────────┐
|
|
226
|
-
│ Desktop UI Mode │
|
|
227
|
-
│ User ↔ Chat UI (React) │
|
|
228
|
-
│ ↕ IPC │
|
|
229
|
-
│ Electron Main Process │
|
|
230
|
-
│ ↕ HTTP + SSE │
|
|
231
|
-
└────────────┬────────────┘
|
|
232
|
-
│
|
|
233
|
-
┌────────────┴────────────┐
|
|
234
|
-
│ MCP Channel │ Claude Code Hooks
|
|
235
|
-
│ (rune-channel) │ ↕ HTTP POST
|
|
236
|
-
│ ↕ MCP │←──── rune-channel /hook
|
|
237
|
-
└────────────┬────────────┘
|
|
238
|
-
│
|
|
239
|
-
┌────────────┴────────────┐
|
|
240
|
-
│ Claude Code CLI │
|
|
241
|
-
└─────────────────────────┘
|
|
242
|
-
|
|
243
|
-
Harness Mode (rune run / pipe / watch):
|
|
244
|
-
CLI → Claude Code CLI (-p) → stdout
|
|
245
|
-
No MCP channel, no Electron — direct execution
|
|
159
|
+
```bash
|
|
160
|
+
rune pipe architect.rune coder.rune "Design and build an Express server with POST /review endpoint that uses require('openrune') to load reviewer.rune and send the prompt. Run npm init -y and npm install express openrune." --auto
|
|
246
161
|
```
|
|
247
162
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
1. **Harness** — Direct CLI execution via `claude -p`. Agents run headlessly with context from the `.rune` file.
|
|
251
|
-
2. **Desktop UI** — Chat input → MCP channel → Claude Code, with hooks for real-time activity monitoring.
|
|
252
|
-
|
|
253
|
-
---
|
|
254
|
-
|
|
255
|
-
## Development
|
|
163
|
+
architect designs the architecture → coder writes `server.js`, runs `npm init`, installs dependencies.
|
|
256
164
|
|
|
257
|
-
###
|
|
165
|
+
### 3. Start the server
|
|
258
166
|
|
|
259
167
|
```bash
|
|
260
|
-
|
|
261
|
-
cd Rune
|
|
262
|
-
npm install
|
|
168
|
+
node server.js
|
|
263
169
|
```
|
|
264
170
|
|
|
265
|
-
###
|
|
171
|
+
### 4. Call the agent via API
|
|
266
172
|
|
|
267
173
|
```bash
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
# Build only
|
|
272
|
-
npm run build
|
|
174
|
+
curl -X POST http://localhost:3000/review \
|
|
175
|
+
-H "Content-Type: application/json" \
|
|
176
|
+
-d '{"prompt": "Review this project"}'
|
|
273
177
|
```
|
|
274
178
|
|
|
275
|
-
|
|
179
|
+
The reviewer agent analyzes your project and returns a full code review.
|
|
276
180
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
src/
|
|
282
|
-
main.ts # Electron main process
|
|
283
|
-
preload.ts # Preload bridge (IPC security)
|
|
284
|
-
channel/
|
|
285
|
-
rune-channel.ts # MCP channel + hooks HTTP endpoint
|
|
286
|
-
renderer/
|
|
287
|
-
src/
|
|
288
|
-
App.tsx # Root React component
|
|
289
|
-
features/
|
|
290
|
-
chat/ # Chat UI (input, messages, activity blocks)
|
|
291
|
-
terminal/ # Built-in terminal (xterm.js + node-pty)
|
|
292
|
-
hooks/ # IPC hooks
|
|
293
|
-
lib/ # Utilities
|
|
181
|
+
### 5. Open the desktop UI
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
rune open reviewer.rune
|
|
294
185
|
```
|
|
295
186
|
|
|
187
|
+
The conversation history from the API call is already there — context persists across CLI, API, and GUI.
|
|
188
|
+
|
|
296
189
|
---
|
|
297
190
|
|
|
298
|
-
##
|
|
191
|
+
## Desktop UI
|
|
299
192
|
|
|
300
|
-
|
|
193
|
+
Rune includes an optional desktop app for interactive chat.
|
|
301
194
|
|
|
302
|
-
|
|
195
|
+
```bash
|
|
196
|
+
rune open reviewer.rune
|
|
197
|
+
```
|
|
303
198
|
|
|
304
|
-
|
|
199
|
+
Or double-click any `.rune` file in Finder.
|
|
305
200
|
|
|
306
|
-
|
|
201
|
+
- **Real-time activity** — See tool calls, results, and permission requests as they happen.
|
|
202
|
+
- **Built-in terminal** — Claude Code output and your own commands, side by side.
|
|
203
|
+
- **Right-click to create** — macOS Quick Action for creating agents from Finder.
|
|
307
204
|
|
|
308
|
-
|
|
205
|
+
> If double-click doesn't work, run `rune install` once to register the file association.
|
|
309
206
|
|
|
310
|
-
|
|
311
|
-
cd /your/project/folder
|
|
312
|
-
RUNE_CHANNEL_PORT=<port> claude --permission-mode auto --enable-auto-mode
|
|
313
|
-
```
|
|
207
|
+
---
|
|
314
208
|
|
|
315
|
-
|
|
209
|
+
## CLI Reference
|
|
316
210
|
|
|
317
|
-
|
|
211
|
+
| Command | Description |
|
|
212
|
+
|---------|-------------|
|
|
213
|
+
| `rune new <name> [--role "..."]` | Create agent |
|
|
214
|
+
| `rune run <file> "prompt" [--auto] [--output json]` | Run headlessly |
|
|
215
|
+
| `rune pipe <a> <b> [...] "prompt" [--auto]` | Chain agents |
|
|
216
|
+
| `rune watch <file> --on <event> --prompt "..."` | Automated triggers |
|
|
217
|
+
| `rune open <file>` | Desktop UI |
|
|
218
|
+
| `rune list` | List agents in current directory |
|
|
219
|
+
| `rune install` | Set up file associations & Quick Action |
|
|
220
|
+
|
|
221
|
+
**Watch events:** `git-commit`, `git-push`, `file-change` (with `--glob`), `cron` (with `--interval`)
|
|
318
222
|
|
|
319
223
|
---
|
|
320
224
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openrune",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Rune — File-based AI Agent Harness for Claude Code",
|
|
5
5
|
"keywords": ["ai", "agent", "claude", "desktop", "electron", "mcp", "claude-code", "harness", "automation"],
|
|
6
6
|
"repository": {
|