@nomad-e/bluma-cli 0.0.45 → 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.
Files changed (3) hide show
  1. package/README.md +556 -557
  2. package/dist/main.js +6 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,557 +1,556 @@
1
- # BluMa CLI
2
-
3
- [![npm version](https://img.shields.io/npm/v/bluma.svg?style=flat-square)](https://www.npmjs.com/package/bluma)
4
- [![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](LICENSE)
5
- [![Build Status](https://img.shields.io/badge/build-passing-brightgreen?style=flat-square)](https://shields.io/)
6
-
7
- <p align="center">
8
- <img src="https://pharmaseedevsa.blob.core.windows.net/pharmassee-dev-storage/bluma.png" alt="Tela inicial 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="2024-06-01"
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 "2024-06-01"
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", "2024-06-01", "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
- │ └── protocols/ # Protocols & helpers
175
- ```
176
- ---
177
-
178
- ## <a name="development-and-build"></a>Development and Build
179
- - Build is performed using [esbuild](https://esbuild.github.io/) (see scripts/build.js).
180
- - TS source files are in `src/` and compiled to `dist/`.
181
- - Use `npm run build` to compile and get the CLI binary ready.
182
- - Config files are automatically copied to `dist/config`.
183
-
184
- ### Main scripts:
185
- ```bash
186
- npm run build # Compiles project to dist/
187
- npm start # Runs CLI (after build)
188
- npm run dev # (If configured, hot-reload/TS watch)
189
- ```
190
-
191
- ---
192
-
193
- ## <a name="extensibility-tools-and-plugins"></a>Extensibility: Tools and Plugins
194
- - Add native tools in `src/app/agent/tools/natives/`
195
- - Use the MCP SDK for advanced plugins integrating with external APIs
196
- - Create custom Ink components to expand the interface
197
-
198
- ---
199
-
200
- ## <a name="tests"></a>Tests
201
- - The repository ships with Jest 30 configured (babel-jest) and TypeScript support.
202
- - Test files are located under `tests/` and follow `*.spec.ts` naming.
203
- - Run tests:
204
-
205
- ```bash
206
- npm test
207
- npm run test:watch
208
- ```
209
-
210
- ---
211
-
212
- ## Live Dev Overlays (Open Channel During Processing)
213
- 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.
214
-
215
- Key points
216
- - Permissive mode enabled: during processing, any free text you type is treated as a [hint] automatically.
217
- - Structured prefixes are also supported at any time:
218
- - [hint] Text for immediate guidance to the agent
219
- - [constraint] Rules/limits (e.g., "não tocar em src/app/agent/**")
220
- - [override] Parameter overrides as key=value pairs (e.g., "file_path=C:/... expected_replacements=2")
221
- - [assume] Register explicit assumptions
222
- - [cancel] Interrupt safely (already supported)
223
-
224
- How it works
225
- - Frontend: the input remains active in read-only (processing) mode and emits a dev_overlay event.
226
- - 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.
227
- - Logging & history: every overlay is logged and stored in session history for auditability.
228
-
229
- Examples
230
- - During a long task, just type:
231
- - "Prefer do not touch tests yet" → will be treated as [hint]
232
- - "[constraint] não editar src/app/ui/**" → blocks edits under that path
233
- - "[override] expected_replacements=2" → adjusts the next edit_tool call
234
- - "[assume] target=api" → adds an assumption in context
235
-
236
- Notes
237
- - The side-channel does not pause the agent it adapts on the fly.
238
- - If an overlay conflicts with the current plan: constraint > override > hint.
239
- - All overlays are acknowledged via standard internal messages and persisted.
240
-
241
- ---
242
-
243
- ## <a name="configuration-and-environment-variables"></a>Configuration and Environment Variables
244
- You must create a `.env` file (copy if needed from `.env.example`) with the following variables:
245
- - `AZURE_OPENAI_ENDPOINT`
246
- - `AZURE_OPENAI_API_KEY`
247
- - `AZURE_OPENAI_API_VERSION`
248
- - `AZURE_OPENAI_DEPLOYMENT`
249
- - `GITHUB_PERSONAL_ACCESS_TOKEN` (optional; required for GitHub integrations)
250
- - `NOTION_API_TOKEN` (optional; required for Notion integrations)
251
-
252
- And others required by your agent/context or Azure setup.
253
-
254
- Advanced config files are located in `src/app/agent/config/`.
255
-
256
- ---
257
-
258
- ## <a name="stack"></a>Tech Stack Overview
259
- - Language: TypeScript (ESM)
260
- - Runtime: Node.js >= 18
261
- - CLI UI: React 18 via Ink 5, plus `ink-text-input`, `ink-spinner`, `ink-big-text`
262
- - Bundler: esbuild, with `esbuild-plugin-node-externals`
263
- - Test Runner: Jest 30 + babel-jest
264
- - Transpilers: Babel presets (env, react, typescript)
265
- - LLM/Agent: Azure OpenAI via `openai` SDK; MCP via `@modelcontextprotocol/sdk`
266
- - Config loading: dotenv
267
- - Utilities: uuid, diff, react-devtools-core
268
-
269
- ---
270
-
271
- ## <a name="license"></a>License
272
- Apache-2.0. Made by Alex Fonseca and NomadEngenuity contributors.
273
-
274
- Enjoy, hack, and—if possible—contribute!
275
-
276
- ---
277
-
278
- ## 🏗 Architecture Diagram
279
- Below is a simplified diagram showing BluMa CLI's core architecture:
280
- ```
281
- [ main.ts ] → [ App.tsx (UI Layer) ]
282
-
283
- [ Agent (Orchestrator) ]
284
-
285
- [ BluMaAgent (Core Loop & State) ]
286
-
287
- [ MCPClient / Tools / Native Tools / SubAgents ]
288
-
289
- [ External APIs & System Operations ]
290
- ```
291
- This flow ensures a clean separation between presentation, orchestration, core logic, and integration layers.
292
-
293
- ### Sequence Diagram
294
- ```mermaid
295
- sequenceDiagram
296
- participant UI as UI (main.ts + App.tsx)
297
- participant Agent as Agent (Orchestrator)
298
- participant Core as BluMaAgent (Core Loop)
299
- participant MCP as MCPClient / Tools
300
-
301
- UI->>Agent: Initialize(sessionId, eventBus)
302
- Agent->>Core: initialize()
303
- Core->>MCP: initialize tools
304
- UI->>Agent: processTurn(userInput)
305
- Agent->>Core: processTurn(content)
306
- Core->>MCP: Get available tools & context
307
- MCP-->>Core: Tool list & details
308
- Core-->>Agent: Tool call request or LLM message
309
- Agent-->>UI: backend_message (e.g., confirmation_request)
310
- UI->>Agent: handleToolResponse()
311
- Agent->>Core: handleToolResponse(decision)
312
- Core->>MCP: Execute tool
313
- MCP-->>Core: Tool result
314
- Core-->>Agent: backend_message(done)
315
- Agent-->>UI: Update history & UI state
316
- ```
317
-
318
- ---
319
-
320
- ### Component Diagram
321
- ```mermaid
322
- flowchart TD
323
- subgraph UI["UI Layer"]
324
- M["main.ts"]
325
- A["App.tsx"]
326
- end
327
- subgraph AG["Agent Layer"]
328
- AGN["Agent (Orchestrator)"]
329
- CORE["BluMaAgent (Core Loop)"]
330
- end
331
- subgraph TOOLS["Tools & Integration"]
332
- MCP["MCPClient"]
333
- NT["Native Tools"]
334
- SA["SubAgents"]
335
- end
336
- EXT["External APIs & FS"]
337
-
338
- M --> A --> AGN --> CORE --> MCP --> NT
339
- CORE --> SA
340
- MCP --> EXT
341
- NT --> EXT
342
- ```
343
-
344
- ---
345
-
346
- ### Activity Diagram
347
- ```mermaid
348
- flowchart TD
349
- Start((Start)) --> Input[User Input in UI]
350
- Input --> Processing{Command Type?}
351
- Processing -->|Slash Command| SC[Handle Slash Command]
352
- Processing -->|Normal Input| PT[processTurn]
353
- SC --> Done((End))
354
- PT --> LLM[Send to LLM]
355
- LLM --> ToolCall{Tool Requested?}
356
- ToolCall -->|No| Display[Display Assistant Message]
357
- ToolCall -->|Yes| Confirm[Ask for Confirmation]
358
- Confirm --> Decision{Decision}
359
- Decision -->|Accept| Exec[Execute Tool]
360
- Decision -->|Decline| Skip[Skip Execution]
361
- Exec --> Result[Return Tool Result]
362
- Skip --> Done
363
- Result --> Done
364
- Display --> Done
365
- ```
366
-
367
- ---
368
-
369
- ### State Machine Diagram
370
- ```mermaid
371
- stateDiagram-v2
372
- [*] --> Idle
373
- Idle --> Processing: User Input
374
- Processing --> Awaiting_Confirmation: Tool Call Needs Approval
375
- Awaiting_Confirmation --> Processing: User Accepts
376
- Awaiting_Confirmation --> Idle: User Declines
377
- Processing --> Completed: Task Completed
378
- Processing --> Interrupted: User Interrupt
379
- Completed --> Idle
380
- Interrupted --> Idle
381
- ```
382
-
383
- ---
384
-
385
- ### Deployment Diagram
386
- ```mermaid
387
- graph TD
388
- CLI["CLI (BluMa)"] --> LocalFS[("Local File System")]
389
- CLI --> AzureOpenAI[("Azure OpenAI API")]
390
- CLI --> GitHubAPI[("GitHub API")]
391
- CLI --> NotionAPI[("Notion API")]
392
- CLI --> OtherAPIs[("Other External APIs")]
393
- CLI --> MCPServer[("MCP Server / Plugins")]
394
- ```
395
-
396
- ---
397
-
398
- ### Data Flow Diagram
399
- ```mermaid
400
- flowchart LR
401
- U[User] --> UI[UI Layer]
402
- UI --> Agent[Agent]
403
- Agent --> Core[BluMaAgent]
404
- Core --> MCP[MCPClient]
405
- Core --> Sub[SubAgents]
406
- MCP --> Tools[Native Tools & External APIs]
407
- Sub --> Tools
408
- Tools --> MCP
409
- MCP --> Core
410
- Core --> Agent
411
- Agent --> UI
412
- UI --> U
413
- ```
414
-
415
- ---
416
-
417
- ## 💡 Usage Examples
418
- - **Run Initialization Command**
419
- ```
420
- /init
421
- ```
422
- Executes the `init` subagent to prepare the working environment.
423
-
424
- - **Confirm an Edit Operation**
425
- When the system prompts an `edit_tool` operation, review the preview and choose:
426
- ```
427
- Accept | Decline | Accept Always
428
- ```
429
-
430
- - **Live Overlay**
431
- During a long-running task, you can send hints:
432
- ```
433
- [hint] Prefer small batch edits
434
- [constraint] Avoid editing src/app/ui/**
435
- ```
436
-
437
- ---
438
-
439
- ## 🤝 Contributing
440
- We welcome contributions! For full details, read [CONTRIBUTING.md](CONTRIBUTING.md).
441
-
442
- ### 📋 Prerequisites
443
- - **Node.js** >= 18 and **npm** >= 9 installed
444
- - Dependencies installed via `npm install`
445
- - Required environment variables configured (see *Configuration* section)
446
-
447
- ### 🔄 Contribution Workflow
448
- 1. **Fork** the repository
449
- 2. **Clone** your fork locally
450
- 3. Create a feature branch named according to [Conventional Commits](https://www.conventionalcommits.org/) (e.g., `feat/add-logging`)
451
- 4. Commit changes with meaningful messages
452
- 5. Push to your fork and open a Pull Request
453
-
454
- ### 🛠 Code Standards
455
- - Follow TypeScript strict mode guidelines
456
- - Maintain style via ESLint and Prettier (`npm run lint`)
457
- - Keep functions short, modular, and documented with JSDoc
458
- - All business logic must have unit tests
459
-
460
- ### 🧪 Testing Requirements
461
- - Run `npm test` and ensure all tests pass
462
- - Include new tests for any new functionality or bug fix
463
- - Validate integration tests when adding new tools or APIs
464
-
465
- ### 🔍 Code Review Process
466
- - Minimum of 1 maintainer approval before merge
467
- - Resolve all review comments and passing CI before merge
468
-
469
- ### 📄 Documentation
470
- - Update README.md or relevant Wiki pages when adding/removing features
471
- - Add or update CHANGELOG.md for notable changes
472
-
473
- ---
474
-
475
- ## ⚠️ Limitations / Next Steps
476
- - Current LLM integration optimised for Azure OpenAI; add more providers.
477
- - Logging verbosity could be made configurable.
478
- - Potential for richer plugin lifecycle (install/remove at runtime).
479
- - Improve error reporting in subagents.
480
-
481
- ---
482
-
483
- ## 🔒 Security Notes
484
-
485
- ---
486
-
487
- ## 🛠 Error Handling & Recovery Flows
488
- BluMa handles different classes of errors gracefully:
489
- - **Network/API Errors**: Retry logic with exponential backoff.
490
- - **Authentication Failures**: Immediate notification to user, requires updating environment variables.
491
- - **Tool Execution Errors**: Displayed with detailed message; execution can be retried or skipped.
492
- - **LLM/API Exceptions**: Fall back to safe mode and keep context intact.
493
- - **Session/History Save Failures**: Warn user and continue without losing core functionality.
494
-
495
- ---
496
-
497
- ## 📈 Metrics & Observability
498
- - **Performance Metrics**: Average response time, tokens used per request, tool execution times.
499
- - **Usage Tracking**: Number of commands executed, tool calls, sessions created.
500
- - **Logging**: Structured logs for all events.
501
- - Integration-ready with Prometheus/Grafana or external observability platforms.
502
-
503
- ---
504
-
505
- ## 🔐 Advanced Security Practices
506
- - Use secret management tools (Vault, AWS Secrets Manager) to store environment variables.
507
- - Apply principle of least privilege for API keys.
508
- - Validate and sanitize all user inputs to avoid prompt injection attacks.
509
- - Regularly rotate API keys.
510
-
511
- ---
512
-
513
- ## 🚀 Performance & Scalability
514
- - Optimize context window by pruning irrelevant history.
515
- - Batch related operations to reduce LLM calls.
516
- - Support for distributed execution or remote agent hosting.
517
- - Cache static responses where possible.
518
-
519
- ---
520
-
521
- ## 🔄 Development Cycle & CI/CD
522
- - **Testing**: `npm test` and `npm run test:watch` for development.
523
- - **Linting**: Enforce coding standards with ESLint/Prettier.
524
- - **CI/CD**: Recommended GitHub Actions or similar to run tests/build on push.
525
- - **Deployment**: Automatic packaging to npm or internal registry.
526
-
527
- ---
528
-
529
- ## 🗺 Roadmap & Release Notes
530
- **Upcoming:**
531
- - Multi-LLM provider support.
532
- - Web-based dashboard.
533
- - Richer subagent plugin APIs.
534
-
535
- **Release Notes**:
536
- - Follow [CHANGELOG.md](CHANGELOG.md) for version history.
537
-
538
- ---
539
-
540
- ## 🎯 Advanced Use Cases
541
- - Chain multiple tools with complex decision-making.
542
- - Build custom subagents for domain-specific automation.
543
- - Integrate with CI pipelines for automated code review and refactoring.
544
-
545
- ---
546
-
547
- ## 📏 Code Standards & Contribution Guidelines
548
- - Follow TypeScript strict mode.
549
- - Commit messages must follow Conventional Commits (`feat:`, `fix:`, `chore:`).
550
- - Keep functions short, modular and documented.
551
- - Add unit tests for all business logic.
552
-
553
- ---
554
- - Protect your API keys: never commit `.env` files.
555
- - `edit_tool` can modify files review previews before accepting.
556
- - Use restricted permissions for API tokens wherever possible.
557
- - If using on shared systems, ensure `.bluma-cli` config is private.
1
+ # BluMa CLI
2
+
3
+ [![npm version](https://img.shields.io/npm/v/bluma.svg?style=flat-square)](https://www.npmjs.com/package/bluma)
4
+ [![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](LICENSE)
5
+ [![Build Status](https://img.shields.io/badge/build-passing-brightgreen?style=flat-square)](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
@@ -1648,8 +1648,11 @@ import fs9 from "fs";
1648
1648
  import path8 from "path";
1649
1649
  var SYSTEM_PROMPT = `
1650
1650
 
1651
- **Goal:** Operate as a fully autonomous AI software engineer capable of managing end-to-end software development and maintenance tasks \u2014 including coding, refactoring, testing, documentation, environment setup, and repository management \u2014 with no human intervention required unless explicitly requested.
1652
-
1651
+ IDENTITY AND OBJECTIVE:
1652
+ Operate as a fully autonomous AI software engineer capable of managing end-to-end software development and maintenance tasks \u2014 including
1653
+ coding, refactoring, testing, documentation, environment setup, and repository management \u2014 with no human intervention required unless
1654
+ explicitly requested.
1655
+
1653
1656
  You are BluMa, a fully AUTONOMOUS AI Software Engineer from NomadEngenuity.
1654
1657
  Your sole objective is to complete the user's request from end to end, with maximum precision, efficiency, and autonomy.
1655
1658
  You operate as a CLI agent with full permission to create, modify, delete files, and execute system commands including Git and shell commands.
@@ -2305,7 +2308,7 @@ Rule Summary:
2305
2308
  - Always use tools (ls, readLines, count_lines, shell_command, edit_tool) to gather evidence before writing.
2306
2309
  - Never invent file content. Read files via tools to confirm.
2307
2310
 
2308
- ## OUTPUT & PROTOCOLS
2311
+ ## OUTPUT
2309
2312
  - Emit 'backend_message' events through tools only (message_notify_user) for progress updates.
2310
2313
  - Before writing BluMa.md, propose structure via message_notify_user and proceed using edit_tool.
2311
2314
  - If an irreversible operation is needed (e.g., overwriting an existing BluMa.md), issue 'confirmation_request' unless user policy indicates auto-approval.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nomad-e/bluma-cli",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "description": "BluMa independent agent for automation and advanced software engineering.",
5
5
  "author": "Alex Fonseca",
6
6
  "license": "Apache-2.0",