@nomad-e/bluma-cli 0.0.46 → 0.0.47
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 +556 -557
- package/dist/main.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,557 +1,556 @@
|
|
|
1
|
-
# BluMa CLI
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/bluma)
|
|
4
|
-
[](LICENSE)
|
|
5
|
-
[](https://shields.io/)
|
|
6
|
-
|
|
7
|
-
<p align="center">
|
|
8
|
-
<img src="https://pharmaseedevsa.blob.core.windows.net/pharmassee-dev-storage/bluma.png" alt="Screenshot BluMa CLI" width="1000"/>
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
|
-
BluMa CLI is an independent agent for automation and advanced software engineering. The project is a conversational assistant that interacts via terminal (CLI), built with React/Ink, supporting smart agents (LLM, OpenAI Azure), tool execution, persistent history, session management, and extensibility through external plugins/tools.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Table of Contents
|
|
16
|
-
- [Overview](#overview)
|
|
17
|
-
- [Key Features](#key-features)
|
|
18
|
-
- [Requirements](#requirements)
|
|
19
|
-
- [Architecture Diagram](#-architecture-diagram)
|
|
20
|
-
- [Installation](#installation)
|
|
21
|
-
- [Usage](#usage)
|
|
22
|
-
- [Examples](#-usage-examples)
|
|
23
|
-
- [Configuration and Environment Variables](#configuration-and-environment-variables)
|
|
24
|
-
- [Development and Build](#development-and-build)
|
|
25
|
-
- [Extensibility: Tools and Plugins](#extensibility-tools-and-plugins)
|
|
26
|
-
- [Tests](#tests)
|
|
27
|
-
- [Limitations / Next Steps](#️-limitations--next-steps)
|
|
28
|
-
- [Security Notes](#-security-notes)
|
|
29
|
-
- [Tech Stack Overview](#stack)
|
|
30
|
-
- [Contributing](#-contributing)
|
|
31
|
-
- [License](#license)
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## <a name="overview"></a>Overview
|
|
36
|
-
BluMa CLI is a modular conversational agent and task automation framework focused on advanced software engineering workflows. It runs entirely in the terminal using React (via Ink) for a rich interactive UI, and is architected around a **UI layer** (`main.ts` + `App.tsx`) and an **agent layer** (`Agent` orchestrator + `BluMaAgent` core). It enables LLM-powered automation, documentation, refactoring, running complex development tasks, and integrating with both native and external tools. The system features persistent sessions, contextual reasoning, smart feedback, and an interactive confirmation system for controlled execution.
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## <a name="key-features"></a>Key Features
|
|
41
|
-
- **Rich CLI interface** using React/Ink 5, with interactive prompts and custom components.
|
|
42
|
-
- **Session management:** automatic persistence of conversation and tool history via files.
|
|
43
|
-
- **Central agent (LLM):** orchestrated by Azure OpenAI (or compatible), enabling natural language-driven automation.
|
|
44
|
-
- **Tool invocation:** native and via MCP SDK for running commands, code manipulation, file management, and more.
|
|
45
|
-
- **Dynamic prompts:** builds live conversational context, behavioral rules, and technical history.
|
|
46
|
-
- **Smart feedback component** with technical suggestions and checks.
|
|
47
|
-
- **ConfirmPrompt & Workflow Decision:** confirmations for sensitive operations, edit/code previews, always-accepted tool whitelists.
|
|
48
|
-
- **Extensible:** easily add new tools or integrate external SDK/plugins.
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## <a name="requirements"></a>Requirements
|
|
53
|
-
- Node.js >= 18
|
|
54
|
-
- npm >= 9
|
|
55
|
-
- Account (with key) for Azure OpenAI (or equivalent variables for OpenAI-compatible endpoints)
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## <a name="installation"></a>Installation
|
|
60
|
-
|
|
61
|
-
### Recommended: Global Installation
|
|
62
|
-
|
|
63
|
-
> **Important:** It is recommended to install BluMa globally so the `bluma` command works in any terminal.
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
npm install -g @nomad-e/bluma-cli
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
If you get permission errors, EXAMPLES:
|
|
70
|
-
- **Linux:** Run as administrator using `sudo`:
|
|
71
|
-
```bash
|
|
72
|
-
sudo npm install -g @nomad-e/bluma-cli
|
|
73
|
-
```
|
|
74
|
-
- **Windows:** Open Command Prompt/Terminal as Administrator and repeat the command
|
|
75
|
-
|
|
76
|
-
> **macOS:** After global installation, **always run the `bluma` command without sudo**:
|
|
77
|
-
>
|
|
78
|
-
> ```bash
|
|
79
|
-
> bluma
|
|
80
|
-
> ```
|
|
81
|
-
> Running with sudo may cause permission problems, environment variable issues, and npm cache ownership problems.
|
|
82
|
-
> Only use sudo to install, never to run the CLI.
|
|
83
|
-
|
|
84
|
-
### Setting Up Environment Variables
|
|
85
|
-
For BluMa CLI to operate with OpenAI/Azure, GitHub, and Notion, set the following environment variables globally in your system.
|
|
86
|
-
|
|
87
|
-
**Required:**
|
|
88
|
-
- `AZURE_OPENAI_ENDPOINT`
|
|
89
|
-
- `AZURE_OPENAI_API_KEY`
|
|
90
|
-
- `AZURE_OPENAI_API_VERSION`
|
|
91
|
-
- `AZURE_OPENAI_DEPLOYMENT`
|
|
92
|
-
- `GITHUB_PERSONAL_ACCESS_TOKEN` (if you'll use GitHub)
|
|
93
|
-
- `NOTION_API_TOKEN` (if you'll use Notion)
|
|
94
|
-
|
|
95
|
-
#### How to set environment variables globally:
|
|
96
|
-
|
|
97
|
-
**Linux/macOS:**
|
|
98
|
-
Add to your `~/.bashrc`, `~/.zshrc`, or equivalent:
|
|
99
|
-
```sh
|
|
100
|
-
export AZURE_OPENAI_ENDPOINT="https://..."
|
|
101
|
-
export AZURE_OPENAI_API_KEY="your_key"
|
|
102
|
-
export AZURE_OPENAI_API_VERSION="2025-01-01-preview"
|
|
103
|
-
export AZURE_OPENAI_DEPLOYMENT="bluma-gpt"
|
|
104
|
-
export GITHUB_PERSONAL_ACCESS_TOKEN="..."
|
|
105
|
-
export NOTION_API_TOKEN="..."
|
|
106
|
-
```
|
|
107
|
-
Then run:
|
|
108
|
-
```sh
|
|
109
|
-
source ~/.bashrc # or whichever file you edited
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**Windows (CMD):**
|
|
113
|
-
```cmd
|
|
114
|
-
setx AZURE_OPENAI_ENDPOINT "https://..."
|
|
115
|
-
setx AZURE_OPENAI_API_KEY "your_key"
|
|
116
|
-
setx AZURE_OPENAI_API_VERSION "2025-01-01-preview"
|
|
117
|
-
setx AZURE_OPENAI_DEPLOYMENT "bluma-gpt"
|
|
118
|
-
setx GITHUB_PERSONAL_ACCESS_TOKEN "..."
|
|
119
|
-
setx NOTION_API_TOKEN "..."
|
|
120
|
-
```
|
|
121
|
-
(Only needs to be run once per variable. Restart the terminal after.)
|
|
122
|
-
|
|
123
|
-
**Windows (PowerShell):**
|
|
124
|
-
```powershell
|
|
125
|
-
[Environment]::SetEnvironmentVariable("AZURE_OPENAI_ENDPOINT", "https://...", "Machine")
|
|
126
|
-
[Environment]::SetEnvironmentVariable("AZURE_OPENAI_API_KEY", "your_key", "Machine")
|
|
127
|
-
[Environment]::SetEnvironmentVariable("AZURE_OPENAI_API_VERSION", "2025-01-01-preview", "Machine")
|
|
128
|
-
[Environment]::SetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT", "bluma-gpt", "Machine")
|
|
129
|
-
[Environment]::SetEnvironmentVariable("GITHUB_PERSONAL_ACCESS_TOKEN", "...", "Machine")
|
|
130
|
-
[Environment]::SetEnvironmentVariable("NOTION_API_TOKEN", "...", "Machine")
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### ℹ️ Global Installation of npm Packages in PowerShell (Windows)
|
|
134
|
-
When installing BluMa (or any npm package globally) in PowerShell, you might see:
|
|
135
|
-
```
|
|
136
|
-
Do you want to change the execution policy?
|
|
137
|
-
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):
|
|
138
|
-
```
|
|
139
|
-
👉 **Choose `Y` (Yes) or `A` (Yes to All)**. This will change the execution policy to **RemoteSigned** (only scripts from the internet need a digital signature).
|
|
140
|
-
|
|
141
|
-
- This is safe for devs: Windows only requires digital signatures for web scripts—local scripts, from npm, work normally.
|
|
142
|
-
- Read more: [About Execution Policies (Microsoft Docs)](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/about/about_execution_policies)
|
|
143
|
-
|
|
144
|
-
**To restore the default policy after installation, run:**
|
|
145
|
-
```powershell
|
|
146
|
-
Set-ExecutionPolicy Default
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
> **Tip:** Restart your terminal to ensure the variables are loaded globally.
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
## <a name="how-to-run"></a>How to Run
|
|
154
|
-
```bash
|
|
155
|
-
npm start
|
|
156
|
-
# Or directly using the built binary
|
|
157
|
-
npx bluma
|
|
158
|
-
```
|
|
159
|
-
==> The CLI will open an interactive terminal interface for dialogue, command execution, and engineering workflow automation.
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## <a name="project-structure"></a>Project Structure
|
|
164
|
-
```
|
|
165
|
-
bluma-engineer/
|
|
166
|
-
├── package.json # npm/project config
|
|
167
|
-
├── tsconfig.json # TypeScript config
|
|
168
|
-
├── scripts/build.js # Build script using esbuild
|
|
169
|
-
├── src/
|
|
170
|
-
│ ├── main.ts # Entry point (Ink renderer)
|
|
171
|
-
│ └── app/
|
|
172
|
-
│ ├── agent/ # Agent core (session mgmt, tools, MCP, prompt, feedback)
|
|
173
|
-
│ ├── ui/ # Ink/React CLI interface components
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
npm
|
|
187
|
-
npm
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
npm test
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
- [
|
|
219
|
-
- [
|
|
220
|
-
- [
|
|
221
|
-
- [
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
-
|
|
226
|
-
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
-
|
|
231
|
-
- "
|
|
232
|
-
- "[
|
|
233
|
-
- "[
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
-
|
|
238
|
-
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
- `
|
|
246
|
-
- `
|
|
247
|
-
- `
|
|
248
|
-
- `
|
|
249
|
-
- `
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
-
|
|
266
|
-
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
participant
|
|
297
|
-
participant
|
|
298
|
-
participant
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
Core
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
Agent
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
Core
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
Processing -->|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
ToolCall -->|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
Decision -->|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
Awaiting_Confirmation -->
|
|
376
|
-
|
|
377
|
-
Processing -->
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
CLI
|
|
389
|
-
CLI -->
|
|
390
|
-
CLI -->
|
|
391
|
-
CLI -->
|
|
392
|
-
CLI -->
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
Core -->
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
[
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
-
|
|
444
|
-
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
-
|
|
456
|
-
-
|
|
457
|
-
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
-
|
|
462
|
-
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
-
|
|
477
|
-
-
|
|
478
|
-
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
- **
|
|
490
|
-
- **
|
|
491
|
-
- **
|
|
492
|
-
- **
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
- **
|
|
499
|
-
- **
|
|
500
|
-
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
-
|
|
507
|
-
-
|
|
508
|
-
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
-
|
|
515
|
-
-
|
|
516
|
-
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
- **
|
|
523
|
-
- **
|
|
524
|
-
- **
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
-
|
|
532
|
-
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
-
|
|
542
|
-
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
-
|
|
549
|
-
-
|
|
550
|
-
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
-
|
|
555
|
-
-
|
|
556
|
-
-
|
|
557
|
-
- If using on shared systems, ensure `.bluma-cli` config is private.
|
|
1
|
+
# BluMa CLI
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/bluma)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://shields.io/)
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="https://pharmaseedevsa.blob.core.windows.net/pharmassee-dev-storage/bluma.png" alt="Screenshot BluMa CLI" width="1000"/>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
BluMa CLI is an independent agent for automation and advanced software engineering. The project is a conversational assistant that interacts via terminal (CLI), built with React/Ink, supporting smart agents (LLM, OpenAI Azure), tool execution, persistent history, session management, and extensibility through external plugins/tools.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Table of Contents
|
|
16
|
+
- [Overview](#overview)
|
|
17
|
+
- [Key Features](#key-features)
|
|
18
|
+
- [Requirements](#requirements)
|
|
19
|
+
- [Architecture Diagram](#-architecture-diagram)
|
|
20
|
+
- [Installation](#installation)
|
|
21
|
+
- [Usage](#usage)
|
|
22
|
+
- [Examples](#-usage-examples)
|
|
23
|
+
- [Configuration and Environment Variables](#configuration-and-environment-variables)
|
|
24
|
+
- [Development and Build](#development-and-build)
|
|
25
|
+
- [Extensibility: Tools and Plugins](#extensibility-tools-and-plugins)
|
|
26
|
+
- [Tests](#tests)
|
|
27
|
+
- [Limitations / Next Steps](#️-limitations--next-steps)
|
|
28
|
+
- [Security Notes](#-security-notes)
|
|
29
|
+
- [Tech Stack Overview](#stack)
|
|
30
|
+
- [Contributing](#-contributing)
|
|
31
|
+
- [License](#license)
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## <a name="overview"></a>Overview
|
|
36
|
+
BluMa CLI is a modular conversational agent and task automation framework focused on advanced software engineering workflows. It runs entirely in the terminal using React (via Ink) for a rich interactive UI, and is architected around a **UI layer** (`main.ts` + `App.tsx`) and an **agent layer** (`Agent` orchestrator + `BluMaAgent` core). It enables LLM-powered automation, documentation, refactoring, running complex development tasks, and integrating with both native and external tools. The system features persistent sessions, contextual reasoning, smart feedback, and an interactive confirmation system for controlled execution.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## <a name="key-features"></a>Key Features
|
|
41
|
+
- **Rich CLI interface** using React/Ink 5, with interactive prompts and custom components.
|
|
42
|
+
- **Session management:** automatic persistence of conversation and tool history via files.
|
|
43
|
+
- **Central agent (LLM):** orchestrated by Azure OpenAI (or compatible), enabling natural language-driven automation.
|
|
44
|
+
- **Tool invocation:** native and via MCP SDK for running commands, code manipulation, file management, and more.
|
|
45
|
+
- **Dynamic prompts:** builds live conversational context, behavioral rules, and technical history.
|
|
46
|
+
- **Smart feedback component** with technical suggestions and checks.
|
|
47
|
+
- **ConfirmPrompt & Workflow Decision:** confirmations for sensitive operations, edit/code previews, always-accepted tool whitelists.
|
|
48
|
+
- **Extensible:** easily add new tools or integrate external SDK/plugins.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## <a name="requirements"></a>Requirements
|
|
53
|
+
- Node.js >= 18
|
|
54
|
+
- npm >= 9
|
|
55
|
+
- Account (with key) for Azure OpenAI (or equivalent variables for OpenAI-compatible endpoints)
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## <a name="installation"></a>Installation
|
|
60
|
+
|
|
61
|
+
### Recommended: Global Installation
|
|
62
|
+
|
|
63
|
+
> **Important:** It is recommended to install BluMa globally so the `bluma` command works in any terminal.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npm install -g @nomad-e/bluma-cli
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
If you get permission errors, EXAMPLES:
|
|
70
|
+
- **Linux:** Run as administrator using `sudo`:
|
|
71
|
+
```bash
|
|
72
|
+
sudo npm install -g @nomad-e/bluma-cli
|
|
73
|
+
```
|
|
74
|
+
- **Windows:** Open Command Prompt/Terminal as Administrator and repeat the command
|
|
75
|
+
|
|
76
|
+
> **macOS:** After global installation, **always run the `bluma` command without sudo**:
|
|
77
|
+
>
|
|
78
|
+
> ```bash
|
|
79
|
+
> bluma
|
|
80
|
+
> ```
|
|
81
|
+
> Running with sudo may cause permission problems, environment variable issues, and npm cache ownership problems.
|
|
82
|
+
> Only use sudo to install, never to run the CLI.
|
|
83
|
+
|
|
84
|
+
### Setting Up Environment Variables
|
|
85
|
+
For BluMa CLI to operate with OpenAI/Azure, GitHub, and Notion, set the following environment variables globally in your system.
|
|
86
|
+
|
|
87
|
+
**Required:**
|
|
88
|
+
- `AZURE_OPENAI_ENDPOINT`
|
|
89
|
+
- `AZURE_OPENAI_API_KEY`
|
|
90
|
+
- `AZURE_OPENAI_API_VERSION`
|
|
91
|
+
- `AZURE_OPENAI_DEPLOYMENT`
|
|
92
|
+
- `GITHUB_PERSONAL_ACCESS_TOKEN` (if you'll use GitHub)
|
|
93
|
+
- `NOTION_API_TOKEN` (if you'll use Notion)
|
|
94
|
+
|
|
95
|
+
#### How to set environment variables globally:
|
|
96
|
+
|
|
97
|
+
**Linux/macOS:**
|
|
98
|
+
Add to your `~/.bashrc`, `~/.zshrc`, or equivalent:
|
|
99
|
+
```sh
|
|
100
|
+
export AZURE_OPENAI_ENDPOINT="https://..."
|
|
101
|
+
export AZURE_OPENAI_API_KEY="your_key"
|
|
102
|
+
export AZURE_OPENAI_API_VERSION="2025-01-01-preview"
|
|
103
|
+
export AZURE_OPENAI_DEPLOYMENT="bluma-gpt"
|
|
104
|
+
export GITHUB_PERSONAL_ACCESS_TOKEN="..."
|
|
105
|
+
export NOTION_API_TOKEN="..."
|
|
106
|
+
```
|
|
107
|
+
Then run:
|
|
108
|
+
```sh
|
|
109
|
+
source ~/.bashrc # or whichever file you edited
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Windows (CMD):**
|
|
113
|
+
```cmd
|
|
114
|
+
setx AZURE_OPENAI_ENDPOINT "https://..."
|
|
115
|
+
setx AZURE_OPENAI_API_KEY "your_key"
|
|
116
|
+
setx AZURE_OPENAI_API_VERSION "2025-01-01-preview"
|
|
117
|
+
setx AZURE_OPENAI_DEPLOYMENT "bluma-gpt"
|
|
118
|
+
setx GITHUB_PERSONAL_ACCESS_TOKEN "..."
|
|
119
|
+
setx NOTION_API_TOKEN "..."
|
|
120
|
+
```
|
|
121
|
+
(Only needs to be run once per variable. Restart the terminal after.)
|
|
122
|
+
|
|
123
|
+
**Windows (PowerShell):**
|
|
124
|
+
```powershell
|
|
125
|
+
[Environment]::SetEnvironmentVariable("AZURE_OPENAI_ENDPOINT", "https://...", "Machine")
|
|
126
|
+
[Environment]::SetEnvironmentVariable("AZURE_OPENAI_API_KEY", "your_key", "Machine")
|
|
127
|
+
[Environment]::SetEnvironmentVariable("AZURE_OPENAI_API_VERSION", "2025-01-01-preview", "Machine")
|
|
128
|
+
[Environment]::SetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT", "bluma-gpt", "Machine")
|
|
129
|
+
[Environment]::SetEnvironmentVariable("GITHUB_PERSONAL_ACCESS_TOKEN", "...", "Machine")
|
|
130
|
+
[Environment]::SetEnvironmentVariable("NOTION_API_TOKEN", "...", "Machine")
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### ℹ️ Global Installation of npm Packages in PowerShell (Windows)
|
|
134
|
+
When installing BluMa (or any npm package globally) in PowerShell, you might see:
|
|
135
|
+
```
|
|
136
|
+
Do you want to change the execution policy?
|
|
137
|
+
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):
|
|
138
|
+
```
|
|
139
|
+
👉 **Choose `Y` (Yes) or `A` (Yes to All)**. This will change the execution policy to **RemoteSigned** (only scripts from the internet need a digital signature).
|
|
140
|
+
|
|
141
|
+
- This is safe for devs: Windows only requires digital signatures for web scripts—local scripts, from npm, work normally.
|
|
142
|
+
- Read more: [About Execution Policies (Microsoft Docs)](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/about/about_execution_policies)
|
|
143
|
+
|
|
144
|
+
**To restore the default policy after installation, run:**
|
|
145
|
+
```powershell
|
|
146
|
+
Set-ExecutionPolicy Default
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
> **Tip:** Restart your terminal to ensure the variables are loaded globally.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## <a name="how-to-run"></a>How to Run
|
|
154
|
+
```bash
|
|
155
|
+
npm start
|
|
156
|
+
# Or directly using the built binary
|
|
157
|
+
npx bluma
|
|
158
|
+
```
|
|
159
|
+
==> The CLI will open an interactive terminal interface for dialogue, command execution, and engineering workflow automation.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## <a name="project-structure"></a>Project Structure
|
|
164
|
+
```
|
|
165
|
+
bluma-engineer/
|
|
166
|
+
├── package.json # npm/project config
|
|
167
|
+
├── tsconfig.json # TypeScript config
|
|
168
|
+
├── scripts/build.js # Build script using esbuild
|
|
169
|
+
├── src/
|
|
170
|
+
│ ├── main.ts # Entry point (Ink renderer)
|
|
171
|
+
│ └── app/
|
|
172
|
+
│ ├── agent/ # Agent core (session mgmt, tools, MCP, prompt, feedback)
|
|
173
|
+
│ ├── ui/ # Ink/React CLI interface components
|
|
174
|
+
```
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## <a name="development-and-build"></a>Development and Build
|
|
178
|
+
- Build is performed using [esbuild](https://esbuild.github.io/) (see scripts/build.js).
|
|
179
|
+
- TS source files are in `src/` and compiled to `dist/`.
|
|
180
|
+
- Use `npm run build` to compile and get the CLI binary ready.
|
|
181
|
+
- Config files are automatically copied to `dist/config`.
|
|
182
|
+
|
|
183
|
+
### Main scripts:
|
|
184
|
+
```bash
|
|
185
|
+
npm run build # Compiles project to dist/
|
|
186
|
+
npm start # Runs CLI (after build)
|
|
187
|
+
npm run dev # (If configured, hot-reload/TS watch)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## <a name="extensibility-tools-and-plugins"></a>Extensibility: Tools and Plugins
|
|
193
|
+
- Add native tools in `src/app/agent/tools/natives/`
|
|
194
|
+
- Use the MCP SDK for advanced plugins integrating with external APIs
|
|
195
|
+
- Create custom Ink components to expand the interface
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## <a name="tests"></a>Tests
|
|
200
|
+
- The repository ships with Jest 30 configured (babel-jest) and TypeScript support.
|
|
201
|
+
- Test files are located under `tests/` and follow `*.spec.ts` naming.
|
|
202
|
+
- Run tests:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
npm test
|
|
206
|
+
npm run test:watch
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Live Dev Overlays (Open Channel During Processing)
|
|
212
|
+
BluMa supports a live side-channel that stays active even while the agent is processing. This lets the dev send guidance or constraints in real-time — like pair programming.
|
|
213
|
+
|
|
214
|
+
Key points
|
|
215
|
+
- Permissive mode enabled: during processing, any free text you type is treated as a [hint] automatically.
|
|
216
|
+
- Structured prefixes are also supported at any time:
|
|
217
|
+
- [hint] Text for immediate guidance to the agent
|
|
218
|
+
- [constraint] Rules/limits (e.g., "não tocar em src/app/agent/**")
|
|
219
|
+
- [override] Parameter overrides as key=value pairs (e.g., "file_path=C:/... expected_replacements=2")
|
|
220
|
+
- [assume] Register explicit assumptions
|
|
221
|
+
- [cancel] Interrupt safely (already supported)
|
|
222
|
+
|
|
223
|
+
How it works
|
|
224
|
+
- Frontend: the input remains active in read-only (processing) mode and emits a dev_overlay event.
|
|
225
|
+
- Agent backend: consumes overlays with precedence (constraint > override > hint). Hints and assumptions are injected into the system context before the next decision; overrides/constraints adjust tool parameters just before execution.
|
|
226
|
+
- Logging & history: every overlay is logged and stored in session history for auditability.
|
|
227
|
+
|
|
228
|
+
Examples
|
|
229
|
+
- During a long task, just type:
|
|
230
|
+
- "Prefer do not touch tests yet" → will be treated as [hint]
|
|
231
|
+
- "[constraint] não editar src/app/ui/**" → blocks edits under that path
|
|
232
|
+
- "[override] expected_replacements=2" → adjusts the next edit_tool call
|
|
233
|
+
- "[assume] target=api" → adds an assumption in context
|
|
234
|
+
|
|
235
|
+
Notes
|
|
236
|
+
- The side-channel does not pause the agent — it adapts on the fly.
|
|
237
|
+
- If an overlay conflicts with the current plan: constraint > override > hint.
|
|
238
|
+
- All overlays are acknowledged via standard internal messages and persisted.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## <a name="configuration-and-environment-variables"></a>Configuration and Environment Variables
|
|
243
|
+
You must create a `.env` file (copy if needed from `.env.example`) with the following variables:
|
|
244
|
+
- `AZURE_OPENAI_ENDPOINT`
|
|
245
|
+
- `AZURE_OPENAI_API_KEY`
|
|
246
|
+
- `AZURE_OPENAI_API_VERSION`
|
|
247
|
+
- `AZURE_OPENAI_DEPLOYMENT`
|
|
248
|
+
- `GITHUB_PERSONAL_ACCESS_TOKEN` (optional; required for GitHub integrations)
|
|
249
|
+
- `NOTION_API_TOKEN` (optional; required for Notion integrations)
|
|
250
|
+
|
|
251
|
+
And others required by your agent/context or Azure setup.
|
|
252
|
+
|
|
253
|
+
Advanced config files are located in `src/app/agent/config/`.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## <a name="stack"></a>Tech Stack Overview
|
|
258
|
+
- Language: TypeScript (ESM)
|
|
259
|
+
- Runtime: Node.js >= 18
|
|
260
|
+
- CLI UI: React 18 via Ink 5, plus `ink-text-input`, `ink-spinner`, `ink-big-text`
|
|
261
|
+
- Bundler: esbuild, with `esbuild-plugin-node-externals`
|
|
262
|
+
- Test Runner: Jest 30 + babel-jest
|
|
263
|
+
- Transpilers: Babel presets (env, react, typescript)
|
|
264
|
+
- LLM/Agent: Azure OpenAI via `openai` SDK; MCP via `@modelcontextprotocol/sdk`
|
|
265
|
+
- Config loading: dotenv
|
|
266
|
+
- Utilities: uuid, diff, react-devtools-core
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## <a name="license"></a>License
|
|
271
|
+
Apache-2.0. Made by Alex Fonseca and NomadEngenuity contributors.
|
|
272
|
+
|
|
273
|
+
Enjoy, hack, and—if possible—contribute!
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## 🏗 Architecture Diagram
|
|
278
|
+
Below is a simplified diagram showing BluMa CLI's core architecture:
|
|
279
|
+
```
|
|
280
|
+
[ main.ts ] → [ App.tsx (UI Layer) ]
|
|
281
|
+
↓
|
|
282
|
+
[ Agent (Orchestrator) ]
|
|
283
|
+
↓
|
|
284
|
+
[ BluMaAgent (Core Loop & State) ]
|
|
285
|
+
↓
|
|
286
|
+
[ MCPClient / Tools / Native Tools / SubAgents ]
|
|
287
|
+
↓
|
|
288
|
+
[ External APIs & System Operations ]
|
|
289
|
+
```
|
|
290
|
+
This flow ensures a clean separation between presentation, orchestration, core logic, and integration layers.
|
|
291
|
+
|
|
292
|
+
### Sequence Diagram
|
|
293
|
+
```mermaid
|
|
294
|
+
sequenceDiagram
|
|
295
|
+
participant UI as UI (main.ts + App.tsx)
|
|
296
|
+
participant Agent as Agent (Orchestrator)
|
|
297
|
+
participant Core as BluMaAgent (Core Loop)
|
|
298
|
+
participant MCP as MCPClient / Tools
|
|
299
|
+
|
|
300
|
+
UI->>Agent: Initialize(sessionId, eventBus)
|
|
301
|
+
Agent->>Core: initialize()
|
|
302
|
+
Core->>MCP: initialize tools
|
|
303
|
+
UI->>Agent: processTurn(userInput)
|
|
304
|
+
Agent->>Core: processTurn(content)
|
|
305
|
+
Core->>MCP: Get available tools & context
|
|
306
|
+
MCP-->>Core: Tool list & details
|
|
307
|
+
Core-->>Agent: Tool call request or LLM message
|
|
308
|
+
Agent-->>UI: backend_message (e.g., confirmation_request)
|
|
309
|
+
UI->>Agent: handleToolResponse()
|
|
310
|
+
Agent->>Core: handleToolResponse(decision)
|
|
311
|
+
Core->>MCP: Execute tool
|
|
312
|
+
MCP-->>Core: Tool result
|
|
313
|
+
Core-->>Agent: backend_message(done)
|
|
314
|
+
Agent-->>UI: Update history & UI state
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
### Component Diagram
|
|
320
|
+
```mermaid
|
|
321
|
+
flowchart TD
|
|
322
|
+
subgraph UI["UI Layer"]
|
|
323
|
+
M["main.ts"]
|
|
324
|
+
A["App.tsx"]
|
|
325
|
+
end
|
|
326
|
+
subgraph AG["Agent Layer"]
|
|
327
|
+
AGN["Agent (Orchestrator)"]
|
|
328
|
+
CORE["BluMaAgent (Core Loop)"]
|
|
329
|
+
end
|
|
330
|
+
subgraph TOOLS["Tools & Integration"]
|
|
331
|
+
MCP["MCPClient"]
|
|
332
|
+
NT["Native Tools"]
|
|
333
|
+
SA["SubAgents"]
|
|
334
|
+
end
|
|
335
|
+
EXT["External APIs & FS"]
|
|
336
|
+
|
|
337
|
+
M --> A --> AGN --> CORE --> MCP --> NT
|
|
338
|
+
CORE --> SA
|
|
339
|
+
MCP --> EXT
|
|
340
|
+
NT --> EXT
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
### Activity Diagram
|
|
346
|
+
```mermaid
|
|
347
|
+
flowchart TD
|
|
348
|
+
Start((Start)) --> Input[User Input in UI]
|
|
349
|
+
Input --> Processing{Command Type?}
|
|
350
|
+
Processing -->|Slash Command| SC[Handle Slash Command]
|
|
351
|
+
Processing -->|Normal Input| PT[processTurn]
|
|
352
|
+
SC --> Done((End))
|
|
353
|
+
PT --> LLM[Send to LLM]
|
|
354
|
+
LLM --> ToolCall{Tool Requested?}
|
|
355
|
+
ToolCall -->|No| Display[Display Assistant Message]
|
|
356
|
+
ToolCall -->|Yes| Confirm[Ask for Confirmation]
|
|
357
|
+
Confirm --> Decision{Decision}
|
|
358
|
+
Decision -->|Accept| Exec[Execute Tool]
|
|
359
|
+
Decision -->|Decline| Skip[Skip Execution]
|
|
360
|
+
Exec --> Result[Return Tool Result]
|
|
361
|
+
Skip --> Done
|
|
362
|
+
Result --> Done
|
|
363
|
+
Display --> Done
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
### State Machine Diagram
|
|
369
|
+
```mermaid
|
|
370
|
+
stateDiagram-v2
|
|
371
|
+
[*] --> Idle
|
|
372
|
+
Idle --> Processing: User Input
|
|
373
|
+
Processing --> Awaiting_Confirmation: Tool Call Needs Approval
|
|
374
|
+
Awaiting_Confirmation --> Processing: User Accepts
|
|
375
|
+
Awaiting_Confirmation --> Idle: User Declines
|
|
376
|
+
Processing --> Completed: Task Completed
|
|
377
|
+
Processing --> Interrupted: User Interrupt
|
|
378
|
+
Completed --> Idle
|
|
379
|
+
Interrupted --> Idle
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
### Deployment Diagram
|
|
385
|
+
```mermaid
|
|
386
|
+
graph TD
|
|
387
|
+
CLI["CLI (BluMa)"] --> LocalFS[("Local File System")]
|
|
388
|
+
CLI --> AzureOpenAI[("Azure OpenAI API")]
|
|
389
|
+
CLI --> GitHubAPI[("GitHub API")]
|
|
390
|
+
CLI --> NotionAPI[("Notion API")]
|
|
391
|
+
CLI --> OtherAPIs[("Other External APIs")]
|
|
392
|
+
CLI --> MCPServer[("MCP Server / Plugins")]
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
### Data Flow Diagram
|
|
398
|
+
```mermaid
|
|
399
|
+
flowchart LR
|
|
400
|
+
U[User] --> UI[UI Layer]
|
|
401
|
+
UI --> Agent[Agent]
|
|
402
|
+
Agent --> Core[BluMaAgent]
|
|
403
|
+
Core --> MCP[MCPClient]
|
|
404
|
+
Core --> Sub[SubAgents]
|
|
405
|
+
MCP --> Tools[Native Tools & External APIs]
|
|
406
|
+
Sub --> Tools
|
|
407
|
+
Tools --> MCP
|
|
408
|
+
MCP --> Core
|
|
409
|
+
Core --> Agent
|
|
410
|
+
Agent --> UI
|
|
411
|
+
UI --> U
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## 💡 Usage Examples
|
|
417
|
+
- **Run Initialization Command**
|
|
418
|
+
```
|
|
419
|
+
/init
|
|
420
|
+
```
|
|
421
|
+
Executes the `init` subagent to prepare the working environment.
|
|
422
|
+
|
|
423
|
+
- **Confirm an Edit Operation**
|
|
424
|
+
When the system prompts an `edit_tool` operation, review the preview and choose:
|
|
425
|
+
```
|
|
426
|
+
Accept | Decline | Accept Always
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
- **Live Overlay**
|
|
430
|
+
During a long-running task, you can send hints:
|
|
431
|
+
```
|
|
432
|
+
[hint] Prefer small batch edits
|
|
433
|
+
[constraint] Avoid editing src/app/ui/**
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
## 🤝 Contributing
|
|
439
|
+
We welcome contributions! For full details, read [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
440
|
+
|
|
441
|
+
### 📋 Prerequisites
|
|
442
|
+
- **Node.js** >= 18 and **npm** >= 9 installed
|
|
443
|
+
- Dependencies installed via `npm install`
|
|
444
|
+
- Required environment variables configured (see *Configuration* section)
|
|
445
|
+
|
|
446
|
+
### 🔄 Contribution Workflow
|
|
447
|
+
1. **Fork** the repository
|
|
448
|
+
2. **Clone** your fork locally
|
|
449
|
+
3. Create a feature branch named according to [Conventional Commits](https://www.conventionalcommits.org/) (e.g., `feat/add-logging`)
|
|
450
|
+
4. Commit changes with meaningful messages
|
|
451
|
+
5. Push to your fork and open a Pull Request
|
|
452
|
+
|
|
453
|
+
### 🛠 Code Standards
|
|
454
|
+
- Follow TypeScript strict mode guidelines
|
|
455
|
+
- Maintain style via ESLint and Prettier (`npm run lint`)
|
|
456
|
+
- Keep functions short, modular, and documented with JSDoc
|
|
457
|
+
- All business logic must have unit tests
|
|
458
|
+
|
|
459
|
+
### 🧪 Testing Requirements
|
|
460
|
+
- Run `npm test` and ensure all tests pass
|
|
461
|
+
- Include new tests for any new functionality or bug fix
|
|
462
|
+
- Validate integration tests when adding new tools or APIs
|
|
463
|
+
|
|
464
|
+
### 🔍 Code Review Process
|
|
465
|
+
- Minimum of 1 maintainer approval before merge
|
|
466
|
+
- Resolve all review comments and passing CI before merge
|
|
467
|
+
|
|
468
|
+
### 📄 Documentation
|
|
469
|
+
- Update README.md or relevant Wiki pages when adding/removing features
|
|
470
|
+
- Add or update CHANGELOG.md for notable changes
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
474
|
+
## ⚠️ Limitations / Next Steps
|
|
475
|
+
- Current LLM integration optimised for Azure OpenAI; add more providers.
|
|
476
|
+
- Logging verbosity could be made configurable.
|
|
477
|
+
- Potential for richer plugin lifecycle (install/remove at runtime).
|
|
478
|
+
- Improve error reporting in subagents.
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## 🔒 Security Notes
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
## 🛠 Error Handling & Recovery Flows
|
|
487
|
+
BluMa handles different classes of errors gracefully:
|
|
488
|
+
- **Network/API Errors**: Retry logic with exponential backoff.
|
|
489
|
+
- **Authentication Failures**: Immediate notification to user, requires updating environment variables.
|
|
490
|
+
- **Tool Execution Errors**: Displayed with detailed message; execution can be retried or skipped.
|
|
491
|
+
- **LLM/API Exceptions**: Fall back to safe mode and keep context intact.
|
|
492
|
+
- **Session/History Save Failures**: Warn user and continue without losing core functionality.
|
|
493
|
+
|
|
494
|
+
---
|
|
495
|
+
|
|
496
|
+
## 📈 Metrics & Observability
|
|
497
|
+
- **Performance Metrics**: Average response time, tokens used per request, tool execution times.
|
|
498
|
+
- **Usage Tracking**: Number of commands executed, tool calls, sessions created.
|
|
499
|
+
- **Logging**: Structured logs for all events.
|
|
500
|
+
- Integration-ready with Prometheus/Grafana or external observability platforms.
|
|
501
|
+
|
|
502
|
+
---
|
|
503
|
+
|
|
504
|
+
## 🔐 Advanced Security Practices
|
|
505
|
+
- Use secret management tools (Vault, AWS Secrets Manager) to store environment variables.
|
|
506
|
+
- Apply principle of least privilege for API keys.
|
|
507
|
+
- Validate and sanitize all user inputs to avoid prompt injection attacks.
|
|
508
|
+
- Regularly rotate API keys.
|
|
509
|
+
|
|
510
|
+
---
|
|
511
|
+
|
|
512
|
+
## 🚀 Performance & Scalability
|
|
513
|
+
- Optimize context window by pruning irrelevant history.
|
|
514
|
+
- Batch related operations to reduce LLM calls.
|
|
515
|
+
- Support for distributed execution or remote agent hosting.
|
|
516
|
+
- Cache static responses where possible.
|
|
517
|
+
|
|
518
|
+
---
|
|
519
|
+
|
|
520
|
+
## 🔄 Development Cycle & CI/CD
|
|
521
|
+
- **Testing**: `npm test` and `npm run test:watch` for development.
|
|
522
|
+
- **Linting**: Enforce coding standards with ESLint/Prettier.
|
|
523
|
+
- **CI/CD**: Recommended GitHub Actions or similar to run tests/build on push.
|
|
524
|
+
- **Deployment**: Automatic packaging to npm or internal registry.
|
|
525
|
+
|
|
526
|
+
---
|
|
527
|
+
|
|
528
|
+
## 🗺 Roadmap & Release Notes
|
|
529
|
+
**Upcoming:**
|
|
530
|
+
- Multi-LLM provider support.
|
|
531
|
+
- Web-based dashboard.
|
|
532
|
+
- Richer subagent plugin APIs.
|
|
533
|
+
|
|
534
|
+
**Release Notes**:
|
|
535
|
+
- Follow [CHANGELOG.md](CHANGELOG.md) for version history.
|
|
536
|
+
|
|
537
|
+
---
|
|
538
|
+
|
|
539
|
+
## 🎯 Advanced Use Cases
|
|
540
|
+
- Chain multiple tools with complex decision-making.
|
|
541
|
+
- Build custom subagents for domain-specific automation.
|
|
542
|
+
- Integrate with CI pipelines for automated code review and refactoring.
|
|
543
|
+
|
|
544
|
+
---
|
|
545
|
+
|
|
546
|
+
## 📏 Code Standards & Contribution Guidelines
|
|
547
|
+
- Follow TypeScript strict mode.
|
|
548
|
+
- Commit messages must follow Conventional Commits (`feat:`, `fix:`, `chore:`).
|
|
549
|
+
- Keep functions short, modular and documented.
|
|
550
|
+
- Add unit tests for all business logic.
|
|
551
|
+
|
|
552
|
+
---
|
|
553
|
+
- Protect your API keys: never commit `.env` files.
|
|
554
|
+
- `edit_tool` can modify files — review previews before accepting.
|
|
555
|
+
- Use restricted permissions for API tokens wherever possible.
|
|
556
|
+
- If using on shared systems, ensure `.bluma-cli` config is private.
|
package/dist/main.js
CHANGED
|
@@ -2308,7 +2308,7 @@ Rule Summary:
|
|
|
2308
2308
|
- Always use tools (ls, readLines, count_lines, shell_command, edit_tool) to gather evidence before writing.
|
|
2309
2309
|
- Never invent file content. Read files via tools to confirm.
|
|
2310
2310
|
|
|
2311
|
-
## OUTPUT
|
|
2311
|
+
## OUTPUT
|
|
2312
2312
|
- Emit 'backend_message' events through tools only (message_notify_user) for progress updates.
|
|
2313
2313
|
- Before writing BluMa.md, propose structure via message_notify_user and proceed using edit_tool.
|
|
2314
2314
|
- If an irreversible operation is needed (e.g., overwriting an existing BluMa.md), issue 'confirmation_request' unless user policy indicates auto-approval.
|