openrune 0.4.0 → 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 +97 -122
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<strong>The simplest agent harness for Claude Code</strong><br/>
|
|
9
|
-
|
|
9
|
+
No SDK. No boilerplate. Just one file per agent.
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
@@ -17,62 +17,37 @@
|
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
##
|
|
21
|
-
|
|
22
|
-
Building a Claude Code harness usually means wiring up process management, I/O parsing, state handling, and a UI from scratch.
|
|
23
|
-
|
|
24
|
-
Rune replaces all of that with a single file.
|
|
20
|
+
## Install
|
|
25
21
|
|
|
26
22
|
```bash
|
|
23
|
+
npm install -g @anthropic-ai/claude-code # prerequisite
|
|
27
24
|
npm install -g openrune
|
|
28
|
-
|
|
29
|
-
rune new reviewer --role "Code reviewer, security focused"
|
|
30
|
-
rune run reviewer.rune "Review the latest commit"
|
|
31
25
|
```
|
|
32
26
|
|
|
33
|
-
That's it. No SDK, no boilerplate, no config.
|
|
34
|
-
|
|
35
27
|
---
|
|
36
28
|
|
|
37
|
-
##
|
|
29
|
+
## 30-Second Harness
|
|
38
30
|
|
|
39
|
-
|
|
31
|
+
```bash
|
|
32
|
+
rune new reviewer --role "Code reviewer, security focused"
|
|
33
|
+
rune run reviewer.rune "Review the latest commit"
|
|
34
|
+
```
|
|
40
35
|
|
|
41
|
-
|
|
42
|
-
- **Claude Code CLI** — `npm install -g @anthropic-ai/claude-code`
|
|
36
|
+
That's it. You just built an agent harness.
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
---
|
|
45
39
|
|
|
46
|
-
|
|
47
|
-
npm install -g openrune
|
|
48
|
-
```
|
|
40
|
+
## Core Concepts
|
|
49
41
|
|
|
50
|
-
###
|
|
42
|
+
### One file = one agent
|
|
51
43
|
|
|
52
44
|
```bash
|
|
53
|
-
# Create agents
|
|
54
45
|
rune new architect --role "Software architect"
|
|
55
46
|
rune new coder --role "Backend developer"
|
|
56
47
|
rune new reviewer --role "Code reviewer"
|
|
57
|
-
|
|
58
|
-
# Run headlessly
|
|
59
|
-
rune run reviewer.rune "Review the latest commit"
|
|
60
|
-
|
|
61
|
-
# Pipe input
|
|
62
|
-
git diff | rune run reviewer.rune "Review this diff"
|
|
63
|
-
|
|
64
|
-
# Agent pipeline — architect designs, coder builds (with file creation)
|
|
65
|
-
rune pipe architect.rune coder.rune "Build a REST API with Express" --auto
|
|
66
|
-
|
|
67
|
-
# Open desktop UI
|
|
68
|
-
rune open reviewer.rune
|
|
69
48
|
```
|
|
70
49
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
## How It Works
|
|
74
|
-
|
|
75
|
-
Each `.rune` file is an independent AI agent:
|
|
50
|
+
Each `.rune` file is just JSON — portable, shareable, version-controllable:
|
|
76
51
|
|
|
77
52
|
```json
|
|
78
53
|
{
|
|
@@ -83,41 +58,30 @@ Each `.rune` file is an independent AI agent:
|
|
|
83
58
|
}
|
|
84
59
|
```
|
|
85
60
|
|
|
86
|
-
|
|
87
|
-
- **Persistent** — Role, memory, and chat history live in the file. The agent picks up where it left off.
|
|
88
|
-
- **Independent** — Multiple agents in the same folder, each with their own context.
|
|
89
|
-
|
|
90
|
-
---
|
|
61
|
+
### Headless execution
|
|
91
62
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
Chain agents together. Each agent's output feeds into the next:
|
|
63
|
+
Run agents from the terminal. No GUI needed:
|
|
95
64
|
|
|
96
65
|
```bash
|
|
97
|
-
rune
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
architect designs → coder implements → reviewer checks.
|
|
66
|
+
rune run reviewer.rune "Review the latest commit"
|
|
101
67
|
|
|
102
|
-
|
|
68
|
+
# Pipe input from other commands
|
|
69
|
+
git diff | rune run reviewer.rune "Review this diff"
|
|
103
70
|
|
|
104
|
-
|
|
105
|
-
rune
|
|
71
|
+
# JSON output for scripting
|
|
72
|
+
rune run reviewer.rune "Check for security issues" --output json
|
|
106
73
|
```
|
|
107
74
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
## Autonomous Mode
|
|
75
|
+
### Autonomous mode
|
|
111
76
|
|
|
112
|
-
`--auto
|
|
77
|
+
With `--auto`, agents write files, run commands, and fix errors on their own:
|
|
113
78
|
|
|
114
79
|
```bash
|
|
115
|
-
rune run coder.rune "Create
|
|
80
|
+
rune run coder.rune "Create an Express server with a /health endpoint. Run npm init and npm install." --auto
|
|
116
81
|
```
|
|
117
82
|
|
|
118
|
-
You see every action in real-time:
|
|
119
83
|
```
|
|
120
|
-
🔮 [auto] coder is working on: Create
|
|
84
|
+
🔮 [auto] coder is working on: Create an Express server...
|
|
121
85
|
|
|
122
86
|
▶ Write: /path/to/server.js
|
|
123
87
|
▶ Bash: npm init -y
|
|
@@ -127,11 +91,23 @@ You see every action in real-time:
|
|
|
127
91
|
✓ coder finished
|
|
128
92
|
```
|
|
129
93
|
|
|
130
|
-
|
|
94
|
+
### Agent pipeline
|
|
95
|
+
|
|
96
|
+
Chain agents. Each agent's output feeds into the next:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
rune pipe architect.rune coder.rune "Build a REST API with Express"
|
|
100
|
+
```
|
|
131
101
|
|
|
132
|
-
|
|
102
|
+
With `--auto`, the last agent executes the plan:
|
|
133
103
|
|
|
134
|
-
|
|
104
|
+
```bash
|
|
105
|
+
rune pipe architect.rune coder.rune "Build a REST API with Express" --auto
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
architect designs → coder implements (writes files, installs deps).
|
|
109
|
+
|
|
110
|
+
### Automated triggers
|
|
135
111
|
|
|
136
112
|
```bash
|
|
137
113
|
# On every git commit
|
|
@@ -144,16 +120,13 @@ rune watch linter.rune --on file-change --glob "src/**/*.ts" --prompt "Check for
|
|
|
144
120
|
rune watch monitor.rune --on cron --interval 5m --prompt "Check server health"
|
|
145
121
|
```
|
|
146
122
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
## Node.js API
|
|
123
|
+
### Node.js API
|
|
150
124
|
|
|
151
125
|
Use agents in your own code:
|
|
152
126
|
|
|
153
127
|
```js
|
|
154
128
|
const rune = require('openrune')
|
|
155
129
|
|
|
156
|
-
// Single agent
|
|
157
130
|
const reviewer = rune.load('reviewer.rune')
|
|
158
131
|
const result = await reviewer.send('Review the latest commit')
|
|
159
132
|
|
|
@@ -164,86 +137,88 @@ const { finalOutput } = await rune.pipe(
|
|
|
164
137
|
)
|
|
165
138
|
```
|
|
166
139
|
|
|
167
|
-
Works in Express servers, scripts, CI/CD — anywhere Node.js runs.
|
|
168
|
-
|
|
169
140
|
---
|
|
170
141
|
|
|
171
|
-
##
|
|
142
|
+
## Example: Agent-Powered API Server
|
|
172
143
|
|
|
173
|
-
|
|
144
|
+
A full walkthrough — from zero to a running server built by agents.
|
|
174
145
|
|
|
175
|
-
|
|
176
|
-
- **Built-in terminal** — Claude Code output and your own commands, side by side.
|
|
177
|
-
- **Right-click to create** — macOS Quick Action for creating agents from Finder.
|
|
146
|
+
### 1. Install and create agents
|
|
178
147
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
148
|
+
```bash
|
|
149
|
+
npm install -g openrune
|
|
150
|
+
mkdir my-project && cd my-project
|
|
182
151
|
|
|
183
|
-
|
|
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."
|
|
155
|
+
```
|
|
184
156
|
|
|
185
|
-
|
|
157
|
+
### 2. Agents collaborate to build a server
|
|
186
158
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
| **Auto review on commit** | `rune watch reviewer.rune --on git-commit --prompt "Review this"` |
|
|
191
|
-
| **Agent pipeline** | `rune pipe architect.rune coder.rune "Build a login page" --auto` |
|
|
192
|
-
| **CI/CD** | `rune run qa.rune "Run tests and report failures" --output json` |
|
|
193
|
-
| **Monitoring** | `rune watch ops.rune --on cron --interval 10m --prompt "Check health"` |
|
|
194
|
-
| **Team sharing** | Commit `.rune` files to git — teammates get the same agents |
|
|
195
|
-
| **Node.js server** | `const rune = require('openrune'); rune.load('agent.rune').send(...)` |
|
|
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
|
|
161
|
+
```
|
|
196
162
|
|
|
197
|
-
|
|
163
|
+
architect designs the architecture → coder writes `server.js`, runs `npm init`, installs dependencies.
|
|
198
164
|
|
|
199
|
-
|
|
165
|
+
### 3. Start the server
|
|
200
166
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
| `rune run <file> "prompt" [--auto] [--output json]` | Run headlessly |
|
|
205
|
-
| `rune pipe <a> <b> [...] "prompt" [--auto]` | Chain agents |
|
|
206
|
-
| `rune watch <file> --on <event> --prompt "..."` | Automated triggers |
|
|
207
|
-
| `rune open <file>` | Desktop UI |
|
|
208
|
-
| `rune list` | List agents in current directory |
|
|
209
|
-
| `rune install` | Set up file associations & Quick Action |
|
|
167
|
+
```bash
|
|
168
|
+
node server.js
|
|
169
|
+
```
|
|
210
170
|
|
|
211
|
-
|
|
171
|
+
### 4. Call the agent via API
|
|
212
172
|
|
|
213
|
-
|
|
173
|
+
```bash
|
|
174
|
+
curl -X POST http://localhost:3000/review \
|
|
175
|
+
-H "Content-Type: application/json" \
|
|
176
|
+
-d '{"prompt": "Review this project"}'
|
|
177
|
+
```
|
|
214
178
|
|
|
215
|
-
|
|
179
|
+
The reviewer agent analyzes your project and returns a full code review.
|
|
216
180
|
|
|
217
|
-
|
|
218
|
-
Harness Mode (rune run / pipe / watch):
|
|
219
|
-
CLI → Claude Code (-p) → stdout
|
|
220
|
-
No GUI, no MCP — direct execution with .rune context
|
|
181
|
+
### 5. Open the desktop UI
|
|
221
182
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
Real-time hooks for activity monitoring
|
|
183
|
+
```bash
|
|
184
|
+
rune open reviewer.rune
|
|
225
185
|
```
|
|
226
186
|
|
|
187
|
+
The conversation history from the API call is already there — context persists across CLI, API, and GUI.
|
|
188
|
+
|
|
227
189
|
---
|
|
228
190
|
|
|
229
|
-
##
|
|
191
|
+
## Desktop UI
|
|
192
|
+
|
|
193
|
+
Rune includes an optional desktop app for interactive chat.
|
|
230
194
|
|
|
231
195
|
```bash
|
|
232
|
-
|
|
233
|
-
cd Rune
|
|
234
|
-
npm install
|
|
235
|
-
npm start
|
|
196
|
+
rune open reviewer.rune
|
|
236
197
|
```
|
|
237
198
|
|
|
238
|
-
|
|
199
|
+
Or double-click any `.rune` file in Finder.
|
|
239
200
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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.
|
|
204
|
+
|
|
205
|
+
> If double-click doesn't work, run `rune install` once to register the file association.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## CLI Reference
|
|
210
|
+
|
|
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`)
|
|
247
222
|
|
|
248
223
|
---
|
|
249
224
|
|
package/package.json
CHANGED