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.
Files changed (2) hide show
  1. package/README.md +105 -121
  2. 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
- One file per agent. Run headlessly, chain them together, automate with triggers, or chat in the desktop UI.
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
- ## Why Rune?
20
+ ## Prerequisites
21
21
 
22
- Building a Claude Code harness usually means wiring up process management, I/O parsing, state handling, and a UI from scratch.
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
- Rune replaces all of that with a single file.
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. No SDK, no boilerplate, no config.
45
+ That's it. You just built an agent harness.
34
46
 
35
47
  ---
36
48
 
37
- ## Quick Start
49
+ ## Core Concepts
38
50
 
39
- ### Prerequisites
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
- - **Portable** — It's just JSON. Commit to git, share with teammates, move between machines.
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
- Chain agents together. Each agent's output feeds into the next:
72
+ Run agents from the terminal. No GUI needed:
95
73
 
96
74
  ```bash
97
- rune pipe architect.rune coder.rune reviewer.rune "Add OAuth2 login flow"
98
- ```
99
-
100
- architect designs → coder implements → reviewer checks.
75
+ rune run reviewer.rune "Review the latest commit"
101
76
 
102
- With `--auto`, the last agent can write files and run commands:
77
+ # Pipe input from other commands
78
+ git diff | rune run reviewer.rune "Review this diff"
103
79
 
104
- ```bash
105
- rune pipe architect.rune coder.rune "Build a REST API with Express" --auto
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
- ## Autonomous Mode
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 a server.js with Express, run npm init and npm install" --auto
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 a server.js...
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
- ## Automated Triggers
105
+ Chain agents. Each agent's output feeds into the next:
133
106
 
134
- Run agents automatically on events:
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
- ## Desktop UI
151
+ ## Example: Agent-Powered API Server
172
152
 
173
- Double-click a `.rune` file or run `rune open` for an interactive chat interface.
153
+ A full walkthrough from zero to a running server built by agents.
174
154
 
175
- - **Real-time activity** — See every tool call, result, and permission request via [Claude Code hooks](https://docs.anthropic.com/en/docs/claude-code/hooks).
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
- <p align="center">
180
- <img src="demo.gif" width="100%" alt="Rune demo" />
181
- </p>
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
- ## Use Cases
166
+ ### 2. Agents collaborate to build a server
186
167
 
187
- | Scenario | Example |
188
- |----------|---------|
189
- | **Code review** | `rune run reviewer.rune "Review the latest commit"` |
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
- ## CLI Reference
174
+ ### 3. Start the server
200
175
 
201
- | Command | Description |
202
- |---------|-------------|
203
- | `rune new <name> [--role "..."]` | Create agent |
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
- **Watch events:** `git-commit`, `git-push`, `file-change` (with `--glob`), `cron` (with `--interval`)
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
- ## Architecture
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
- Desktop UI Mode (rune open / double-click):
223
- Chat UI (React) ↔ Electron ↔ MCP Channel ↔ Claude Code CLI
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
- ## Development
200
+ ## Desktop UI
201
+
202
+ Rune includes an optional desktop app for interactive chat.
230
203
 
231
204
  ```bash
232
- git clone https://github.com/gilhyun/Rune.git
233
- cd Rune
234
- npm install
235
- npm start
205
+ rune open reviewer.rune
236
206
  ```
237
207
 
238
- ### Project Structure
208
+ Or double-click any `.rune` file in Finder.
239
209
 
240
- ```
241
- bin/rune.js CLI (new, run, pipe, watch, open, list)
242
- lib/index.js Node.js API
243
- channel/rune-channel.ts MCP channel + hooks endpoint
244
- src/main.ts Electron main process
245
- renderer/src/ React chat UI + terminal
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrune",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
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": {