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