orka-cli 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +225 -100
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Orka
2
2
 
3
- Multi-agent coding orchestration CLI. Orka mengorkestrasi AI agents untuk bekerja seperti tim engineering — Coordinator dekomposisi goal, Scout analisis codebase, Builder implementasi paralel, Reviewer jaga kualitassemua terkoordinasi otomatis tanpa konflik file.
3
+ **Multi-agent coding orchestration CLI.** Orka coordinates a swarm of AI agents that work like an engineering team — Coordinator breaks down goals, Scout analyzes the codebase, Builders implement in parallel, and Reviewer ensures qualityall automatically coordinated without file conflicts.
4
4
 
5
5
  ```
6
6
  $ orka run "build user authentication with OAuth2 and JWT"
@@ -18,64 +18,86 @@ $ orka run "build user authentication with OAuth2 and JWT"
18
18
  │ ⚡ BUILD │ API routes & middleware │ bld-2 │ 4 files │
19
19
  │ ⏳ QUEUE │ Login & signup UI │ — │ 5 files │
20
20
  └──────────┴──────────────────────────┴────────┴──────────┘
21
- [P]ause [L]ogs [C]ost detail [Q]uit
22
21
  ```
23
22
 
24
- ## Fitur
23
+ ## Features
25
24
 
26
- - **Multi-agent paralel** — Coordinator + Scout + N Builders + Reviewer bekerja serentak
27
- - **Zero file conflict** — file ownership via atomic SQLite lock, tidak ada dua agent edit file yang sama
28
- - **Review gate** — setiap perubahan di-review Reviewer sebelum di-commit, max 3x retry sebelum eskalasi ke user
29
- - **Agent-agnostic** — Claude, Ollama (gratis/lokal), OpenAI, Gemini bisa dicampur per role
30
- - **Git integration** — auto-branch per task, auto-merge setelah approved, rebase in-flight branches
31
- - **Survive crash** — state di SQLite, `orka resume` lanjut dari titik terakhir
32
- - **Cost tracking** — token dan biaya per agent, real-time di TUI
25
+ - **Parallel multi-agent swarm** — Coordinator + Scout + N Builders + Reviewer work concurrently
26
+ - **Zero file conflicts** — atomic SQLite file ownership locks prevent two agents from editing the same file
27
+ - **AI self-healing loop** — TesterAgent runs your test suite after each build; if tests fail, Builder retries with the test output as feedback
28
+ - **Human gate** — optionally require human approval before any task is marked done, with a full diff preview
29
+ - **Web dashboard** — built-in HTTP server with real-time WebSocket updates; monitor and control sessions from any browser
30
+ - **Remote access** — built-in Cloudflare Tunnel support (`--tunnel`) for iPad/remote access without VPN
31
+ - **Provider-agnostic** — Claude, OpenAI, Gemini, Ollama (local/free), OpenRouter mix and match per role
32
+ - **Git integration** — auto-branch per session, auto-commit after approval, safe rollback
33
+ - **Crash recovery** — full state persisted in SQLite; `orka resume` picks up exactly where it left off
34
+ - **Cost tracking** — real-time token usage and estimated cost per agent
35
+ - **Plugin system** — extend with custom roles, providers, and hooks
36
+ - **MCP server** — expose Orka as an MCP tool for use inside Claude, Cursor, and other AI editors
33
37
 
34
- ## Instalasi
38
+ ## Installation
35
39
 
36
40
  ```bash
37
41
  npm install -g orka-cli
38
42
  ```
39
43
 
40
- Atau run tanpa install:
44
+ **Requirements:** Node.js v20+, at least one LLM provider (API key or local Ollama)
45
+
46
+ ## Quickstart
47
+
41
48
  ```bash
42
- npx orka-cli init
49
+ # 1. Initialize config in your project
50
+ cd your-project
51
+ orka init
52
+
53
+ # 2. Add your API key
54
+ orka login --provider claude
55
+
56
+ # 3. Run your first session
57
+ orka run "add input validation to all API endpoints"
43
58
  ```
44
59
 
45
- **Prasyarat:** Node.js v20+, minimal satu LLM provider (API key atau Ollama)
60
+ ## Web Dashboard (Mission Control)
46
61
 
47
- ## Quickstart
62
+ Run Orka as a persistent server and control everything from your browser — no terminal needed after startup.
48
63
 
49
64
  ```bash
50
- # Bootstrap config awal
51
- orka init --profile ollama
65
+ # Start the server (point --static to the GUI build)
66
+ orka serve --project /path/to/your-project --static /path/to/gui/dist
52
67
 
53
- # Mode core (default): goal -> scout -> coordinator -> builder/reviewer
54
- orka run "buat CRUD endpoint untuk /api/products"
68
+ # With Cloudflare Tunnel for iPad/remote access
69
+ orka serve --project /path/to/your-project --static /path/to/gui/dist --tunnel
70
+ # → 🌐 Tunnel URL: https://xxxxx.trycloudflare.com
71
+ ```
55
72
 
56
- # Mode manual: pakai target file eksplisit untuk single-task run
57
- orka run "buat CRUD endpoint untuk /api/products" --files src/api/products.ts
73
+ From the dashboard you can:
74
+ - **Start new sessions** type a goal and click Run
75
+ - **Monitor agents** — real-time swarm canvas with task status
76
+ - **Review diffs** — click any `AWAITING APPROVAL` task to see the full git diff
77
+ - **Approve or reject** — with optional feedback sent back to the Builder
58
78
 
59
- # Rollback ke base commit session terakhir
60
- orka rollback
79
+ Alternatively, run server + session together in one command:
61
80
 
62
- # Lihat status implementasi yang sudah tersedia
63
- orka status
81
+ ```bash
82
+ orka run "your goal" --serve --serve-static /path/to/gui/dist [--tunnel]
64
83
  ```
65
84
 
66
- ## Konfigurasi
85
+ ## Configuration
67
86
 
68
- `orka init` akan generate `orka.config.yaml` di root project. Edit manual jika perlu:
87
+ `orka init` generates `orka.config.yaml` in your project root:
69
88
 
70
89
  ```yaml
71
90
  providers:
72
91
  claude:
73
- apiKey: ${ANTHROPIC_API_KEY} # dari environment variable
92
+ apiKey: ${ANTHROPIC_API_KEY} # reads from environment variable
74
93
  ollama:
75
94
  baseUrl: http://localhost:11434
76
95
 
77
96
  swarm:
78
- builders: 2 # jumlah Builder agent paralel
97
+ builders: 2 # number of parallel Builder agents
98
+ review: true # enable Reviewer agent
99
+ maxReviewRetries: 3
100
+ humanGate: false # set true to require human approval before done
79
101
 
80
102
  roles:
81
103
  coordinator: { provider: claude, model: claude-sonnet-4-20250514 }
@@ -84,14 +106,20 @@ roles:
84
106
  reviewer: { provider: claude, model: claude-sonnet-4-20250514 }
85
107
 
86
108
  git:
87
- auto_branch: true
88
- auto_merge: true
89
- commit_prefix: "[orka]"
90
- push: false # tidak pernah push tanpa izin user
91
- conflict_resolution: prompt # prompt | auto | manual
109
+ autoBranch: true
110
+ autoMerge: true
111
+ commitPrefix: "[orka]"
112
+ push: false # never pushes without explicit confirmation
113
+ conflictResolution: prompt # prompt | auto | manual
114
+
115
+ tester:
116
+ enabled: false # set true to enable self-healing test loop
117
+ command: "npm test"
118
+ timeout: 60000
119
+ maxRetries: 3
92
120
  ```
93
121
 
94
- ### Setup Hemat (semua Ollama, gratis)
122
+ ### Budget Setup (fully local, free)
95
123
 
96
124
  ```yaml
97
125
  roles:
@@ -101,7 +129,7 @@ roles:
101
129
  reviewer: { provider: ollama, model: llama3 }
102
130
  ```
103
131
 
104
- ### Setup Quality (cloud untuk Coordinator & Reviewer)
132
+ ### Quality Setup (cloud for planning and review)
105
133
 
106
134
  ```yaml
107
135
  roles:
@@ -111,97 +139,194 @@ roles:
111
139
  reviewer: { provider: claude, model: claude-sonnet-4-20250514 }
112
140
  ```
113
141
 
142
+ ## Human Gate (Approval Workflow)
143
+
144
+ Enable `humanGate: true` in your config to require human review before any task is finalized.
145
+
146
+ **Pipeline with human gate:**
147
+ ```
148
+ Builder → TesterAgent → ReviewerAgent → awaiting_approval → [you approve] → done
149
+ ↘ [you reject] → Builder retries
150
+ ```
151
+
152
+ When a task reaches `awaiting_approval`:
153
+ - The web dashboard shows a purple **APPROVE** badge
154
+ - Click the task to open a diff preview modal
155
+ - Click **Approve** to finalize, or **Reject** with optional feedback
156
+ - On rejection, the Builder retries with your feedback as context
157
+
158
+ ## Self-Healing Test Loop
159
+
160
+ Enable `tester.enabled: true` to have Orka automatically run your test suite after each build:
161
+
162
+ ```yaml
163
+ tester:
164
+ enabled: true
165
+ command: "npm test"
166
+ timeout: 60000
167
+ maxRetries: 3
168
+ ```
169
+
170
+ **Pipeline:**
171
+ ```
172
+ Builder writes code → TesterAgent runs tests → pass: send to Reviewer
173
+ → fail: Builder retries with test output
174
+ ```
175
+
114
176
  ## Rules System
115
177
 
116
- Buat `orka.rules.md` di root project untuk mengatur perilaku semua agent:
178
+ Create `orka.rules.md` in your project root to guide all agents:
117
179
 
118
180
  ```markdown
119
181
  ## Code Style
120
- - Gunakan Bahasa Indonesia untuk error messages
121
- - Naming: camelCase untuk functions, PascalCase untuk types
182
+ - Use TypeScript strict mode
183
+ - Prefer named exports over default exports
184
+ - All functions must have explicit return types
122
185
 
123
186
  ## Architecture
124
- - Semua API routes di src/app/api/
125
- - Pakai Zod untuk validation, bukan manual type checking
187
+ - API routes go in src/app/api/
188
+ - Use Zod for validation, not manual type checking
189
+ - No direct database calls outside of repository files
126
190
  ```
127
191
 
128
- Global rules (berlaku semua project): `~/.orka/rules.md`
192
+ Global rules (applied to all projects): `~/.orka/rules.md`
129
193
 
130
- ## Commands
194
+ ## All Commands
131
195
 
196
+ ### Session Management
132
197
  ```bash
133
- orka init # generate config dari preset
134
- orka init --wizard # setup wizard interaktif
135
- orka init --profile ollama # local-first preset (tanpa Claude)
136
- orka run "goal" # auto-planning orchestration flow
137
- orka run "goal" --files src/app.ts # manual single-task run
138
- orka run "goal" --no-git # nonaktifkan session branch + auto-commit
139
- orka status # tampilkan status board session terakhir
140
- orka status --ink # status board interaktif via Ink
141
- orka status --watch # status board live refresh (text)
142
- orka board # tampilkan session board terakhir
143
- orka board --watch # board mode live refresh
144
- orka board --ink # board interaktif berbasis Ink
145
- orka board --ink --watch # board Ink + live refresh
146
- orka logs # activity log session terakhir
147
- orka logs --session session-123 # filter ke session tertentu
148
- orka logs --type task:completed # filter berdasarkan message type
149
- orka pause # pause semua agent
150
- orka resume # lanjut dari pause / crash
151
- orka rollback # rollback session branch terakhir ke base commit
152
- orka fix # resolve git conflict otomatis (LLM)
153
- orka fix --strategy ours # pakai versi branch saat ini
154
- orka fix --strategy theirs # pakai versi incoming branch
155
- orka cost # token & cost summary
156
- orka rules edit # edit orka.rules.md
157
- orka memory show # tampilkan memory
158
- orka memory add "catatan" # tambah entry
159
- orka memory clear # hapus semua memory
160
- orka plugin add my-plugin # pasang plugin ke registry lokal
161
- orka plugin list # lihat plugin aktif
198
+ orka run "goal" # start an orchestration session
199
+ orka run "goal" --files src/app.ts # single-task run targeting specific files
200
+ orka run "goal" --no-git # disable session branch and auto-commit
201
+ orka run "goal" --builders 4 # use 4 parallel Builder agents
202
+ orka run "goal" --provider claude # override all roles to one provider
203
+ orka run "goal" --dry-run # preview plan without calling any LLM
204
+ orka run "goal" --mock # use mock provider (no API calls, for testing)
205
+ orka run "goal" --serve # start HTTP server alongside the session
206
+ orka run "goal" --serve --tunnel # + expose via Cloudflare Tunnel
207
+ orka pause # pause all agents gracefully
208
+ orka resume # resume from pause or crash
209
+ orka rollback # rollback last session branch to base commit
162
210
  ```
163
211
 
164
- ## Git Flow
212
+ ### Monitoring
213
+ ```bash
214
+ orka status # show last session status board
215
+ orka status --watch # live-refresh status board
216
+ orka status --ink # interactive Ink TUI board
217
+ orka board # alias for status
218
+ orka logs # show event log for last session
219
+ orka logs --session session-123 # filter to a specific session
220
+ orka logs --type task:completed # filter by message type
221
+ orka cost # show token usage and cost summary
222
+ ```
165
223
 
166
- Orka tidak pernah mengubah branch aktif kamu secara langsung:
224
+ ### Web Server
225
+ ```bash
226
+ orka serve # start HTTP server + web dashboard
227
+ orka serve --port 8080 # custom port (default: 4242)
228
+ orka serve --project /path/to/project # set project directory
229
+ orka serve --static /path/to/gui/dist # serve web dashboard
230
+ orka serve --tunnel # expose via Cloudflare Tunnel
231
+ ```
167
232
 
233
+ ### Provider & Credentials
234
+ ```bash
235
+ orka login --provider claude # save Claude API key
236
+ orka login --provider openai # save OpenAI API key
237
+ orka login --provider gemini # save Gemini API key
238
+ orka login --provider ollama # configure Ollama base URL
239
+ orka logout --provider claude # remove saved credential
240
+ orka whoami # show credential status for all providers
241
+ orka models --provider claude # list available models from provider
168
242
  ```
169
- main (branch kamu)
170
-
171
- └── orka/session-<timestamp> ← session branch
172
- ├── orka/task-auth-schemas ← per-task branch (builder-1)
173
- ├── orka/task-auth-service ← per-task branch (builder-2)
174
- └── orka/task-api-routes ← per-task branch (builder-2)
243
+
244
+ ### Project Setup
245
+ ```bash
246
+ orka init # generate config from default preset
247
+ orka init --profile ollama # local-first preset (no cloud API needed)
248
+ orka init --wizard # interactive setup wizard
249
+ orka init --force # overwrite existing config
175
250
  ```
176
251
 
177
- Setelah semua task approved, Orka tanya: `Merge ke main? [Y/n]`
252
+ ### Git Conflict Resolution
253
+ ```bash
254
+ orka fix # resolve git conflicts using LLM
255
+ orka fix --strategy ours # keep current branch version
256
+ orka fix --strategy theirs # keep incoming branch version
257
+ ```
178
258
 
179
- **Safety rules:**
180
- - Tidak pernah force push
181
- - Tidak pernah push ke remote tanpa konfirmasi
182
- - Merge conflict pause + notifikasi, tidak auto-resolve diam-diam
259
+ ### Rules & Memory
260
+ ```bash
261
+ orka rules show # show active project and global rules
262
+ orka rules edit # open project rules in $EDITOR
263
+ orka memory show # show memory entries
264
+ orka memory add "always use pnpm" # add a memory entry
265
+ orka memory clear # clear all memory entries
266
+ ```
183
267
 
184
- ## Dokumentasi
268
+ ### Plugins
269
+ ```bash
270
+ orka plugin add my-plugin # install plugin from npm
271
+ orka plugin add ./local-plugin # install local plugin
272
+ orka plugin list # list installed plugins
273
+ orka plugin remove my-plugin # uninstall plugin
274
+ ```
275
+
276
+ ### MCP Server
277
+ ```bash
278
+ orka mcp-server # start as MCP server (stdio transport)
279
+ ```
185
280
 
186
- - [Design Spec](docs/superpowers/specs/2026-03-11-orka-design.md) — arsitektur lengkap
187
- - [BRD](docs/superpowers/specs/2026-03-11-brd.md) — business requirements
188
- - [PRD](docs/superpowers/specs/2026-03-11-prd.md) — product requirements & user stories
189
- - [ERD](docs/superpowers/specs/2026-03-11-erd.md) — database schema
190
- - [Contributing](CONTRIBUTING.md) — setup development, commit rules, branching strategy repo
281
+ ## Git Flow
191
282
 
192
- ## Roadmap
283
+ Orka never touches your active branch directly:
193
284
 
194
- | Versi | Fitur |
195
- |-------|-------|
196
- | **v1.0** | Core orchestration, 4 roles, Claude + Ollama, TUI, git integration, rules, resume |
197
- | **v1.1** | OpenAI + Gemini, smart context management, memory auto-learning, `--dry-run` |
198
- | **v1.2** | Plugin system (custom roles, providers, hooks) |
199
- | **v2.0** | Desktop app (Electron/Tauri) |
200
- | **v3.0** | Web dashboard + managed cloud service |
285
+ ```
286
+ main (your branch)
287
+
288
+ └── orka/session-<timestamp> ← session branch (auto-created)
289
+ ├── task-1: auth types ← builder-1 works here
290
+ ├── task-2: auth service ← builder-2 works here
291
+ └── task-3: API routes ← builder-2 works here
292
+ ```
293
+
294
+ After all tasks are approved, Orka auto-commits to the session branch. You decide when to merge.
295
+
296
+ **Safety guarantees:**
297
+ - Never force pushes
298
+ - Never pushes to remote without explicit confirmation (`push: false` by default)
299
+ - Merge conflicts → session pauses and notifies you, never silently auto-resolves
300
+
301
+ ## Supported Providers
302
+
303
+ | Provider | Models | Notes |
304
+ |----------|--------|-------|
305
+ | **Claude** | claude-sonnet-4, claude-haiku-4-5, ... | Best quality |
306
+ | **OpenAI** | gpt-4o, gpt-4o-mini, o1, ... | |
307
+ | **Gemini** | gemini-2.0-flash, gemini-1.5-pro, ... | |
308
+ | **Ollama** | llama3, deepseek-coder-v2, qwen2.5-coder, ... | Free, runs locally |
309
+ | **OpenRouter** | Any model via OpenRouter | |
310
+ | **Zai / GLM** | glm-4, ... | |
311
+
312
+ ## MCP Integration
313
+
314
+ Use Orka as an MCP tool inside Claude Desktop, Cursor, or any MCP-compatible editor:
315
+
316
+ ```json
317
+ {
318
+ "mcpServers": {
319
+ "orka": {
320
+ "command": "orka",
321
+ "args": ["mcp-server"]
322
+ }
323
+ }
324
+ }
325
+ ```
201
326
 
202
327
  ## Contributing
203
328
 
204
- Lihat [CONTRIBUTING.md](CONTRIBUTING.md).
329
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
205
330
 
206
331
  ## License
207
332
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orka-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Multi-agent orchestration CLI",
5
5
  "type": "module",
6
6
  "bin": {