@parallel-cli/parallel 0.3.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nil Amara
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,316 @@
1
+ # Parallel
2
+
3
+ Real-time multi-agent coding in your terminal.
4
+
5
+ Parallel lets you run several AI coding agents on the same repository at the same time. Each agent sees the live shared state of the session, can coordinate with the others, and can edit files without silent overwrites.
6
+
7
+ > You stay in control. Parallel gives you the hub, the live context, the safety rails, and one dedicated terminal per agent.
8
+
9
+ [![npm version](https://img.shields.io/npm/v/@parallel-cli/parallel?color=blue)](https://www.npmjs.com/package/@parallel-cli/parallel)
10
+ ![node version](https://img.shields.io/node/v/@parallel-cli/parallel)
11
+ ![license](https://img.shields.io/npm/l/@parallel-cli/parallel)
12
+ ![platform](https://img.shields.io/badge/platform-linux%20%7C%20macos-lightgrey)
13
+
14
+ ## Features
15
+
16
+ - Run multiple coding agents in parallel from one terminal hub.
17
+ - Open a dedicated terminal per agent with native scrollback and live steering.
18
+ - Share live context between agents: status, notes, file claims, file activity, and recent diffs.
19
+ - Prevent silent overwrites with adaptive merge-on-write for file edits.
20
+ - Spawn agents normally, in plan-first mode, from GitHub issues, or from headless CI scripts.
21
+ - Pause, resume, stop, focus, restore, and steer agents while they are running.
22
+ - Review live diffs, notes, costs, session state, skills, and specialists from built-in views.
23
+ - Use any OpenAI-compatible provider, including DeepSeek, OpenAI-compatible gateways, OpenRouter, Ollama, vLLM, LM Studio, and local servers.
24
+ - Track token usage and estimated cost per agent and per session.
25
+ - Keep project and global skills/specialists as local markdown files.
26
+
27
+ ## Install
28
+
29
+ Requirements:
30
+
31
+ - Node.js 18 or newer
32
+ - Linux or macOS
33
+ - An API key for an OpenAI-compatible provider
34
+
35
+ Install from npm:
36
+
37
+ ```bash
38
+ npm install -g @parallel-cli/parallel
39
+ ```
40
+
41
+ Run it inside a project:
42
+
43
+ ```bash
44
+ parallel
45
+ ```
46
+
47
+ Short alias:
48
+
49
+ ```bash
50
+ prl
51
+ ```
52
+
53
+ ## Quick Start
54
+
55
+ On first launch, Parallel opens a setup wizard for:
56
+
57
+ 1. Language
58
+ 2. Working folder
59
+ 3. New or restored session
60
+ 4. Provider
61
+ 5. Model
62
+
63
+ After setup, type a task and press Enter:
64
+
65
+ ```text
66
+ > refactor the API client and update the tests
67
+ ```
68
+
69
+ Typing another task starts another agent immediately, even while the first one is still working:
70
+
71
+ ```text
72
+ > add coverage for the auth middleware
73
+ ```
74
+
75
+ Send a real-time instruction to one agent:
76
+
77
+ ```text
78
+ @a1 also handle empty response bodies
79
+ ```
80
+
81
+ Broadcast to every agent:
82
+
83
+ ```text
84
+ @all stop changing public interfaces until the test agent finishes
85
+ ```
86
+
87
+ ## Multi-Terminal Sessions
88
+
89
+ The main TUI is the session hub. Each new agent can open a dedicated terminal connected through `.parallel/session.sock`.
90
+
91
+ ```bash
92
+ parallel
93
+ parallel attach a1 --root .
94
+ ```
95
+
96
+ Attached terminals show:
97
+
98
+ - the agent log in native terminal scrollback
99
+ - state, model, tokens, cost, elapsed time, and current action
100
+ - what the other agents are doing
101
+ - a prompt for steering that specific agent
102
+ - approval and question prompts for that agent
103
+
104
+ From an attached terminal:
105
+
106
+ ```text
107
+ /spawn write regression tests for the parser
108
+ ```
109
+
110
+ This launches a new agent in the same session. Use `/quit` to detach from an agent terminal.
111
+
112
+ Toggle automatic agent terminals in the hub:
113
+
114
+ ```text
115
+ /attach on
116
+ /attach off
117
+ ```
118
+
119
+ ## Headless Mode
120
+
121
+ For CI and scripts, run without the TUI:
122
+
123
+ ```bash
124
+ parallel --headless "fix lint failures" "update tests" --json
125
+ ```
126
+
127
+ Headless mode:
128
+
129
+ - runs one agent per task
130
+ - uses the current folder as the project root
131
+ - auto-approves shell commands
132
+ - auto-answers agent questions with the recommended option
133
+ - saves the session
134
+ - exits non-zero if any agent does not finish successfully
135
+
136
+ ## Commands
137
+
138
+ ### Create Agents
139
+
140
+ | Command | Description |
141
+ | --- | --- |
142
+ | `/spawn [Name:] <task> [--model=m] [#skill]` | Launch an agent. Plain text input does the same. |
143
+ | `/plan [Name:] <task> [--model=m]` | Launch a plan-first agent that asks before editing files. |
144
+ | `/issue <n>` | Spawn an agent from a GitHub issue using the `gh` CLI. |
145
+ | `/specialist <name> <task>` | Spawn with a specialist persona. |
146
+ | `/specialist new <name> [global]` | Create a specialist template. |
147
+ | `/skill new <name> [global]` | Create a skill template. |
148
+
149
+ ### Steer Agents
150
+
151
+ | Command | Description |
152
+ | --- | --- |
153
+ | `@agent <message>` | Send a live instruction to one agent. |
154
+ | `@all <message>` | Broadcast an instruction to all agents. |
155
+ | `/send <agent\|all> <message>` | Command form of live steering. |
156
+ | `/attach <agent\|on\|off>` | Open an agent terminal or toggle automatic terminals. |
157
+ | `/focus <agent\|off>` | Route plain input to one agent instead of spawning new agents. |
158
+ | `/pause <agent\|all>` | Pause at the next action boundary. |
159
+ | `/resume <agent\|all>` | Resume paused agents. |
160
+ | `/stop <agent\|all>` | Stop running agents. |
161
+ | `/clear` | Remove finished agents from the current display. |
162
+
163
+ ### Git Safety
164
+
165
+ | Command | Description |
166
+ | --- | --- |
167
+ | `/undo [agent]` | Revert the last file change made by an agent, with conflict detection. |
168
+ | `/commit [agent\|all] [message]` | Commit files touched by an agent or by all agents. |
169
+ | `/autocommit <on\|off>` | Commit each agent's changes automatically when it finishes. |
170
+
171
+ ### Views
172
+
173
+ | Command | Description |
174
+ | --- | --- |
175
+ | `/agents` | Agent grid. |
176
+ | `/board` | Shared blackboard, file activity, claims, and notes. |
177
+ | `/notes` | Full notes history. |
178
+ | `/diff` | Live diff history. |
179
+ | `/cost` | Token and cost breakdown. |
180
+ | `/skills` | Available skills. |
181
+ | `/specialists` | Available specialists. |
182
+ | `/help` | Full command reference. |
183
+
184
+ ### Sessions And Settings
185
+
186
+ | Command | Description |
187
+ | --- | --- |
188
+ | `/save [name]` | Save the current session. |
189
+ | `/sessions` | List saved sessions. |
190
+ | `/session <n\|latest>` | Restore a saved session. |
191
+ | `/restore <agent>` | Relaunch a restored agent with its conversation history. |
192
+ | `/model [[provider:]model]` | Show or switch the session model. |
193
+ | `/key <api-key>` | Store the API key for the active provider. |
194
+ | `/approvals <ask\|auto>` | Require or skip shell command approvals for the session. |
195
+ | `/sound <on\|off>` | Toggle terminal bell notifications. |
196
+ | `/settings` | Edit global language, providers, keys, defaults, and approvals. |
197
+ | `/settings-session` | Edit session-only model, approvals, and sound. |
198
+ | `/doctor` | Check provider, key, and model configuration. |
199
+ | `/quit` | Save the session and exit. |
200
+
201
+ When there is exactly one agent, commands such as `/undo`, `/focus`, `/pause`, `/resume`, `/stop`, and `/commit` can omit the agent name.
202
+
203
+ ## Providers
204
+
205
+ Parallel uses OpenAI-compatible chat completions with tool calling. The built-in DeepSeek preset works out of the box once an API key is configured.
206
+
207
+ Environment variables:
208
+
209
+ | Variable | Purpose |
210
+ | --- | --- |
211
+ | `DEEPSEEK_API_KEY` | API key for the built-in DeepSeek provider. |
212
+ | `PARALLEL_API_KEY` | Generic fallback API key. |
213
+ | `PARALLEL_BASE_URL` | Override the provider base URL. |
214
+ | `PARALLEL_MODEL` | Override the session model. |
215
+ | `PARALLEL_NO_ALT_SCREEN=1` | Disable the alternate terminal screen. |
216
+
217
+ Local providers are supported if they expose an OpenAI-compatible endpoint, for example:
218
+
219
+ - Ollama
220
+ - vLLM
221
+ - LM Studio
222
+ - llama.cpp server
223
+ - OpenRouter or other compatible gateways
224
+
225
+ Configuration is stored in `~/.parallel/config.json`. Project state, sessions, skills, specialists, and memory are stored under `.parallel/` in the selected project.
226
+
227
+ ## Skills And Specialists
228
+
229
+ Skills are markdown instruction files that agents can load with the `load_skill` tool or that you can force-load with `#skill-name` in a task.
230
+
231
+ Locations:
232
+
233
+ - Global skills: `~/.parallel/skills/`
234
+ - Project skills: `.parallel/skills/`
235
+
236
+ Specialists are markdown personas with optional pinned models.
237
+
238
+ Locations:
239
+
240
+ - Global specialists: `~/.parallel/specialists/`
241
+ - Project specialists: `.parallel/specialists/`
242
+
243
+ Example task with a forced skill:
244
+
245
+ ```text
246
+ > add Redis-backed caching for expensive lookups #redis
247
+ ```
248
+
249
+ ## How Parallel Avoids Lost Work
250
+
251
+ Parallel does not lock files. Instead, each agent tracks the last version it read.
252
+
253
+ When an agent writes a file:
254
+
255
+ 1. Parallel checks whether the file changed since that agent last read it.
256
+ 2. If the file is unchanged, the write proceeds.
257
+ 3. If another agent changed it, the write is rejected once.
258
+ 4. The agent receives the other change as context, re-reads the file, merges both intentions, and retries.
259
+
260
+ This keeps agents moving without allowing silent overwrites.
261
+
262
+ ## Architecture
263
+
264
+ At runtime, Parallel is built around four pieces:
265
+
266
+ - **Controller**: manages agents, approvals, questions, sessions, terminals, commits, and restores.
267
+ - **Blackboard**: stores live shared state: agents, logs, notes, claims, file activity, and diffs.
268
+ - **Agent loop**: injects live context, calls the model, executes tools, reacts to new information, and marks completion.
269
+ - **Ink UI**: renders the hub, agent panels, settings, views, prompts, and attached terminal UI.
270
+
271
+ Agent tools include:
272
+
273
+ - `list_files`
274
+ - `read_file`
275
+ - `write_file`
276
+ - `edit_file`
277
+ - `search`
278
+ - `run_command`
279
+ - `post_note`
280
+ - `update_status`
281
+ - `ask_user`
282
+ - `load_skill`
283
+ - `claim_files`
284
+ - `wait_for_agent`
285
+ - `remember`
286
+ - `task_complete`
287
+
288
+ ## Package
289
+
290
+ ```bash
291
+ npm install -g @parallel-cli/parallel
292
+ ```
293
+
294
+ Published package:
295
+
296
+ - npm: https://www.npmjs.com/package/@parallel-cli/parallel
297
+ - GitHub: https://github.com/Nil06/parallel-cli
298
+
299
+ ## Development
300
+
301
+ ```bash
302
+ npm install
303
+ npm run build
304
+ npm test
305
+ ```
306
+
307
+ Use a local global link while developing:
308
+
309
+ ```bash
310
+ npm link
311
+ parallel --help
312
+ ```
313
+
314
+ ## License
315
+
316
+ MIT