@defai.digital/ax-cli 3.8.20 → 3.8.22

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 CHANGED
@@ -1,813 +1,159 @@
1
- # AX CLI - Enterprise-Class CLI for GenAI coding
1
+ # AX CLI - Enterprise-Class CLI for GenAI Coding
2
2
 
3
3
  [![npm](https://img.shields.io/npm/dt/@defai.digital/ax-cli?style=flat-square&logo=npm&label=downloads)](https://npm-stat.com/charts.html?package=%40defai.digital%2Fax-cli)
4
- [![Tests](https://img.shields.io/badge/tests-1517%20passing-brightgreen?style=flat-square)](https://github.com/defai-digital/ax-cli/actions/workflows/test.yml)
4
+ [![Tests](https://img.shields.io/badge/tests-2083%20passing-brightgreen?style=flat-square)](https://github.com/defai-digital/ax-cli/actions/workflows/test.yml)
5
5
  [![Coverage](https://img.shields.io/badge/coverage-98%2B%25-brightgreen?style=flat-square)](https://github.com/defai-digital/ax-cli)
6
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.9%2B-blue?style=flat-square&logo=typescript)](https://www.typescriptlang.org/)
7
- [![Node.js Version](https://img.shields.io/badge/node-%3E%3D24.0.0-blue?style=flat-square)](https://nodejs.org/)
7
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D24.0.0-blue?style=flat-square&logo=node.js)](https://nodejs.org/)
8
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
9
- [![macOS](https://img.shields.io/badge/macOS-26-blue?style=flat-square&logo=apple)](https://www.apple.com/macos/)
10
- [![Windows](https://img.shields.io/badge/Windows-11-blue?style=flat-square&logo=windows)](https://www.microsoft.com/windows/)
11
- [![Ubuntu](https://img.shields.io/badge/Ubuntu-24.04-blue?style=flat-square&logo=ubuntu)](https://ubuntu.com/)
12
9
 
13
- ![AX CLI Screenshot](.github/assets/screenshot1.png)
10
+ <p align="center">
11
+ <img src=".github/assets/screenshot1.png" alt="AX CLI Screenshot" width="800"/>
12
+ </p>
14
13
 
15
14
  <p align="center">
16
15
  <strong>GLM-Optimized CLI • Enterprise Architecture • 98%+ Test Coverage • TypeScript & Zod</strong>
17
16
  </p>
18
17
 
19
- ## 📋 Table of Contents
20
-
21
- - [🚀 Quick Start](#-quick-start)
22
- - [✨ Features](#-features)
23
- - [🎉 What's New](#-whats-new-in-v3820)
24
- - [📦 Installation](#-installation)
25
- - [⚙️ Configuration](#️-configuration)
26
- - [🔒 Security](#-security--api-key-handling)
27
- - [🎯 Usage Examples](#-usage-examples)
28
- - [🔌 MCP Integration](#-mcp-model-context-protocol)
29
- - [🧠 Project Memory](#-project-memory)
30
- - [🎯 Multi-Phase Planner](#-multi-phase-task-planner-v300)
31
- - [🏗️ Architecture](#️-architecture)
32
- - [📚 Documentation](#-documentation)
33
- - [📋 Changelog](#-changelog)
34
-
35
18
  ---
36
19
 
37
- ## 🚀 Quick Start
38
-
39
- Get up and running in under 2 minutes:
20
+ ## Quick Start
40
21
 
41
22
  ```bash
42
- # 1️⃣ Install globally
23
+ # Install globally
43
24
  npm install -g @defai.digital/ax-cli
44
25
 
45
- # 2️⃣ Configure (secure API key setup)
26
+ # Configure (secure API key setup)
46
27
  ax-cli setup
47
28
 
48
- # 3️⃣ Initialize your project
29
+ # Initialize your project
49
30
  ax-cli init
50
31
 
51
- # 4️⃣ Start coding!
32
+ # Start coding!
52
33
  ax-cli
53
34
  ```
54
35
 
55
- **That's it!** 🎉 AX CLI is now ready to help you build, debug, and ship code faster.
56
-
57
- **Need help?** Run `ax-cli --help` or check the [Usage Guide](#-usage-examples).
58
-
59
- ## ✨ Features
60
-
61
- - **🤖 GLM-Focused AI CLI**: Optimized for Z.AI's GLM-4.6 (default, configurable)
62
- - **Note**: For xAI Grok models, use [grok-cli](https://github.com/superagent-ai/grok-cli)
63
- - **Note**: For Anthropic Claude models, use [claude-code](https://claude.ai/code)
64
- - **🧠 GLM 4.6 Optimized**: Primary support for General Language Model with advanced reasoning
65
- - **32K max tokens** (industry-standard, matches Claude Code CLI)
66
- - 200K context window, 128K max output capability
67
- - 30% more token efficient than GLM 4.5
68
- - Optimized for complex code generation and refactoring
69
- - **🎯 Multi-Phase Task Planner**: Intelligent task decomposition for complex requests
70
- - Automatic complexity detection (57 keyword patterns)
71
- - LLM-based plan generation with phases and dependencies
72
- - Phase-by-phase execution with progress tracking
73
- - File modification tracking and context pruning between phases
74
- - Plan management commands: `/plans`, `/plan`, `/phases`, `/pause`, `/resume`, `/skip`, `/abandon`
75
- - **🔄 Session Continuity**: Directory-specific conversation history with `--continue` flag
76
- - Preserve context across sessions for multi-day development
77
- - Each project maintains its own independent history
78
- - Seamlessly resume conversations where you left off
79
- - **🔌 Enhanced MCP Integration**: Model Context Protocol with production-ready templates
80
- - **One-command setup**: `ax-cli mcp add figma --template`
81
- - **12+ pre-configured templates**: Figma, GitHub, Vercel, Puppeteer, Storybook, Sentry, and more
82
- - **Tool discovery**: `ax-cli mcp tools <server>` to preview capabilities
83
- - **Template browser**: `ax-cli mcp browse` for quick navigation
84
- - **Front-end focused**: Design-to-code workflows with Figma integration
85
- - **[Complete Guide](docs/mcp-frontend-guide.md)**: Front-end developer workflows
86
- - **✅ Production-Ready**: 98%+ test coverage, TypeScript strict mode, Zod validation
87
- - **🎯 Interactive & Headless**: Chat interface or one-shot commands
88
- - **📝 Smart Project Init**: Automatic project analysis and custom instructions
89
- - **🧠 Project Memory**: Intelligent context caching for z.ai GLM-4.6
90
- - Automatic project scanning and context generation
91
- - z.ai implicit caching support (50% token savings on repeated context)
92
- - Cache statistics tracking and efficiency monitoring
93
- - **🏥 Health Check**: Comprehensive diagnostics with `ax-cli doctor`
94
- - Verify configuration, API connectivity, and dependencies
95
- - Detailed error messages with actionable suggestions
96
- - **🎨 Smart Verbosity Control**: Multi-level output for optimal UX
97
- - **Quiet mode** (default): Groups tool operations → 85% less noise
98
- - **Concise mode**: One line per tool execution
99
- - **Verbose mode**: Full details for debugging
100
- - Press `Ctrl+O` to cycle between levels
101
- - Auto-expands errors with full details
102
- - **🔄 Auto-Update**: Built-in update checker and installer
103
- - **🔒 Enterprise-Grade Security**: **FREE & Open Source**
104
- - **Command Injection Protection**: CVSS 9.8 CRITICAL fix - Safe command execution with whitelisting
105
- - **Path Traversal Hardening**: CVSS 8.6 HIGH fix - Prevent unauthorized file system access
106
- - **SSRF Attack Prevention**: CVSS 7.5 HIGH fix - Validate MCP transport URLs and block private IPs
107
- - **Input Sanitization**: CVSS 7.0 HIGH fix - Comprehensive input validation and sanitization
108
- - **Error Sanitization**: CVSS 6.5 MEDIUM fix - Prevent sensitive data leakage in error messages
109
- - **API Key Encryption**: AES-256-GCM encryption at rest with automatic migration
110
- - **Memory Leak Fixes**: Process pool management for long-running operations
111
- - **Security Audit Logging**: Basic JSON logging with 30-day retention
112
- - **Rate Limiting**: Token bucket algorithm to prevent API abuse (100 req/min)
113
- - **1517+ tests passing** with **98.29% coverage** - Production-ready security
114
- - **User-friendly defaults**: Full functionality with enterprise-grade security for everyone
115
- - **🏢 Enterprise Features**: Advanced capabilities for teams and compliance
116
- - **Compliance Report Generation**: SOC2, HIPAA, PCI-DSS automated reporting
117
- - **Advanced Audit Logging**: Tamper-proof encrypted logs with hash chains and extended retention (1+ years)
118
- - **Real-time Security Dashboards**: Monitor security events, anomalies, and compliance status
119
- - **Advanced Rate Limiting**: Custom quotas per user/team/project with cost analytics and budget alerts
120
- - **Team Collaboration**: Shared chat history with full-text search and multi-format export
121
- - **Policy Enforcement**: Tool execution policies, approval workflows, and usage analytics
122
- - **SSO/SAML Integration**: Enterprise identity provider support
123
- - **Priority Support**: 24-hour SLA email support
124
- - 📧 **Contact sales@defai.digital** for enterprise licensing and pricing
125
- - **📊 Advanced Code Analysis**: Professional-grade static analysis tools
126
- - **Dependency Analyzer**: Detect circular dependencies, calculate coupling metrics, identify orphan and hub files
127
- - **Code Smell Detector**: Find 10+ anti-patterns (long methods, large classes, duplicates, dead code, etc.)
128
- - **Hotspot Analyzer**: Identify frequently changing, complex code using git history analysis
129
- - **Metrics Calculator**: Cyclomatic complexity, Halstead metrics, Maintainability Index (MI)
130
- - **Security Scanner**: Detect SQL injection, XSS, path traversal, hardcoded secrets, and more
131
- - **[Complete Guide](docs/analysis-tools.md)** and **[API Documentation](docs/api/analyzers.md)**
132
-
133
- ### Max Tokens Configuration
134
-
135
- AX CLI uses **industry-standard max tokens** based on research of leading AI coding tools:
136
-
137
- | Tool | Max Tokens | Notes |
138
- |------|-----------|-------|
139
- | **Claude Code CLI** | 16k - 32k | Industry standard |
140
- | **GitHub Copilot** | 64k | GPT-4o default |
141
- | **Cursor AI** | 200k | With intelligent pruning |
142
- | **AX CLI (GLM 4.6)** | **32k** ✅ | Matches Claude Code upper default |
143
- | **AX CLI (Others)** | 8k | Appropriate for each model |
144
-
145
- **Why 32k for GLM 4.6?**
146
- - Competitive with industry leaders (Claude Code, GitHub Copilot)
147
- - GLM 4.6 supports up to 128k max output (our 32k is conservative at 25%)
148
- - Better for complex code generation, large file modifications, and multi-file context
149
- - Based on official Z.AI documentation and industry benchmarking
150
-
151
- [View all features →](docs/features.md)
152
-
153
- ## 🎉 What's New in v3.8.20
154
-
155
- **Centralized Paths & Unified Timeouts** - Uses centralized constants for paths and timeouts.
156
-
157
- ### 🔧 Improvements
158
-
159
- - **Centralized path constants** - Updated files to use `CONFIG_PATHS`:
160
- - `memory.ts`: Uses `CONFIG_PATHS.CUSTOM_MD` and `CONFIG_PATHS.INDEX_JSON` (replaces 5 duplicated path constructions)
161
- - `mcp-migrate.ts`: Uses `CONFIG_PATHS.PROJECT_SETTINGS`
162
- - `path-helpers.ts`: Uses `CONFIG_PATHS.PROJECT_DIR`
163
- - **Unified timeout usage** - Updated files to use `TIMEOUT_CONFIG` and `MCP_CONFIG`:
164
- - `permission-manager.ts`: Uses `TIMEOUT_CONFIG.TOOL_APPROVAL`
165
- - `mcp.ts`: Uses `MCP_CONFIG.HEALTH_CHECK_INTERVAL` for health monitoring
166
-
167
- ### 📝 Benefits
168
-
169
- - **Less Duplication**: Path constructions like `path.join(process.cwd(), CONFIG_DIR_NAME, FILE_NAMES.CUSTOM_MD)` replaced with `CONFIG_PATHS.CUSTOM_MD`
170
- - **Single Source of Truth**: All timeout and path values centralized in constants
171
- - **Better Maintainability**: Changes to paths only need to be made in one place
172
-
173
- ### ✅ Quality
174
-
175
- - All 2083 tests passing
176
- - 0 lint errors (570 warnings)
177
- - TypeScript strict mode passes
178
- - Build succeeds
179
- - Zero breaking changes
180
-
181
- ---
182
-
183
- ## 🎉 What's New in v3.8.19
184
-
185
- **Deduplicated Code, Performance & Stability** - Reduces code duplication and improves stability.
186
-
187
- ### 🔧 Improvements
188
-
189
- - **Exported reusable utilities** - Added `sleep()` and `calculateExponentialBackoff()` from retry-helper:
190
- - `sleep(ms)`: Promise-based delay utility
191
- - `calculateExponentialBackoff(attempt, initialDelay, maxDelay, addJitter)`: Calculates backoff with overflow protection
192
- - **Reduced duplicated code** - Updated files to use centralized utilities:
193
- - `task-planner.ts`: Uses `sleep()` and `calculateExponentialBackoff()` instead of inline implementations
194
- - `process-pool.ts`: Uses `sleep()` instead of `new Promise(resolve => setTimeout(...))`
195
- - `llm-agent.ts`: Uses `TIMEOUT_CONFIG.TOOL_APPROVAL` instead of hardcoded `5 * 60 * 1000`
196
- - **Extended timeout configuration** - Added new timeout constants:
197
- - `tool_approval`: 5 minutes for tool approval timeout
198
- - `context_cleanup_interval`: 5 minutes for context manager cleanup
199
- - **Updated cleanup intervals** - Centralized cleanup timing:
200
- - `context-manager.ts`: Uses `TIMEOUT_CONFIG.CONTEXT_CLEANUP_INTERVAL`
201
- - `rate-limiter.ts`: Uses `TIMEOUT_CONFIG.CONTEXT_CLEANUP_INTERVAL`
202
-
203
- ### 📝 Configuration
204
-
205
- Extended `timeouts` section in `config-defaults/settings.yaml`:
206
- ```yaml
207
- timeouts:
208
- # ... existing timeouts ...
209
- tool_approval: 300000
210
- context_cleanup_interval: 300000
211
- ```
212
-
213
- ### ✅ Quality
214
-
215
- - All 2083 tests passing
216
- - 0 lint errors (570 warnings)
217
- - TypeScript strict mode passes
218
- - Build succeeds
219
- - Zero breaking changes
220
-
221
- ---
222
-
223
- ## 🎉 What's New in v3.8.18
224
-
225
- **Extended Timeout Configuration** - Adds network/API and UI timeout constants.
226
-
227
- ### 🔧 Improvements
228
-
229
- - **Extended timeout configuration** - Added new timeout constants:
230
- - `settings_cache_ttl`: 5 seconds for settings manager cache
231
- - `api_health_check`: 5 seconds for API health checks
232
- - `command_check`: 3 seconds for command availability checks
233
- - `mcp_init`: 5 seconds for MCP initialization
234
- - `shutdown`: 10 seconds for graceful shutdown
235
- - `notification_display`: 3 seconds for notification display
236
- - **Updated files to use centralized constants**:
237
- - `bash-output.ts`: Uses `TIMEOUT_CONFIG.BASH_DEFAULT`
238
- - `task-planner.ts`: Uses `TIMEOUT_CONFIG.MS_PER_SECOND` and `MCP_CONFIG.RECONNECT_MAX_DELAY`
239
- - `use-input-handler.ts`: Uses `TIMEOUT_CONFIG.BASH_DEFAULT`
240
- - `settings-manager.ts`: Uses `TIMEOUT_CONFIG.SETTINGS_CACHE_TTL`
241
- - `llm/tools.ts`: Uses `TIMEOUT_CONFIG.MCP_INIT`
242
-
243
- ### 📝 Configuration
244
-
245
- Extended `timeouts` section in `config-defaults/settings.yaml`:
246
- ```yaml
247
- timeouts:
248
- # ... existing timeouts ...
249
- settings_cache_ttl: 5000
250
- api_health_check: 5000
251
- command_check: 3000
252
- mcp_init: 5000
253
- shutdown: 10000
254
- notification_display: 3000
255
- ```
256
-
257
- ### ✅ Quality
258
-
259
- - All 2083 tests passing
260
- - TypeScript strict mode passes
261
- - Build succeeds
262
- - Zero breaking changes
263
-
264
- ---
265
-
266
- ## 🎉 What's New in v3.8.17
267
-
268
- **Code Quality & Configuration Centralization** - Removes hardcoded values and unifies configuration.
269
-
270
- ### 🔧 Improvements
271
-
272
- - **Centralized timeout configuration** - All timeout values now configurable via `config-defaults/settings.yaml`
273
- - `TIMEOUT_CONFIG` exported from `constants.ts` for consistent access
274
- - Bash, search, hook, streaming, and process pool timeouts centralized
275
- - **Unified MCP configuration** - Health check interval and reconnect delay now in `MCP_CONFIG`
276
- - **Extended `SettingsYaml` interface** - Added `timeouts` section for configurable timeout values
277
- - **Removed hardcoded values** - Replaced magic numbers with named constants
278
-
279
- ### 📝 Configuration
280
-
281
- New `timeouts` section in `config-defaults/settings.yaml`:
282
- ```yaml
283
- timeouts:
284
- bash_default: 30000
285
- search_default: 30000
286
- hook_default: 30000
287
- streaming_first_chunk: 90000
288
- streaming_idle: 120000
289
- process_execution: 30000
290
- process_idle: 60000
291
- ```
292
-
293
- ### ✅ Quality
294
-
295
- - All 2083 tests passing
296
- - TypeScript strict mode passes
297
- - Build succeeds
298
- - Zero breaking changes
299
-
300
- ---
301
-
302
- ## 🎉 What's New in v3.8.16
303
-
304
- **MCP Timeout Configuration** - Fixes [#13](https://github.com/defai-digital/ax-cli/issues/13): AutomatosX agent timeout errors.
305
-
306
- ### ✨ New Features
307
-
308
- - **Per-server MCP timeout configuration** - Configure custom timeouts for long-running MCP tools
309
- - Add `timeout` field to MCP server config (in milliseconds)
310
- - Supports AutomatosX agents with 45+ minute execution times
311
- - Default: 60 seconds (MCP SDK default)
312
-
313
- ### 📝 Configuration Example
314
-
315
- ```json
316
- {
317
- "mcpServers": {
318
- "automatosx": {
319
- "name": "automatosx",
320
- "transport": { "type": "stdio", "command": "ax", "args": ["mcp"] },
321
- "timeout": 2700000
322
- }
323
- }
324
- }
325
- ```
326
-
327
- ### 🐛 Bug Fixes
328
-
329
- - **Fixed MCP error -32001 "Request timed out"** - Long-running tools no longer fail prematurely
330
- - **Per-tool timeout propagation** - Timeout now correctly passed to MCP SDK `callTool()`
331
-
332
- ### ✅ Quality
333
-
334
- - All tests passing
335
- - TypeScript strict mode passes
336
- - Build succeeds
337
- - Zero breaking changes
338
-
339
- ---
340
-
341
- ## 🎉 What's New in v3.8.15
342
-
343
- **Stability & Robustness Release** - Fixes streaming timeouts, search tool errors, and bash command validation:
344
-
345
- ### 🔧 Improvements
346
-
347
- - **Increased streaming timeouts** - First chunk timeout increased from 30s to 90s, idle timeout from 60s to 120s to handle complex operations with large context
348
- - **Better file type handling in search** - Fixed ripgrep `tsx` file type error by using glob patterns for non-builtin types (tsx, jsx, vue, svelte, etc.)
349
- - **Improved cd command validation** - Compound commands like `cd /path && grep` now show helpful error messages instead of failing silently
350
-
351
- ### 🐛 Bug Fixes
352
-
353
- - **Fixed "Streaming first chunk timeout" errors** - Complex operations no longer timeout prematurely
354
- - **Fixed "unrecognized file type: tsx" in search** - Search tool now handles modern file extensions correctly
355
- - **Fixed cd command with compound operators** - Clear error message explaining how to run commands in different directories
356
-
357
- ### ✅ Quality
358
-
359
- - All tests passing
360
- - TypeScript strict mode passes
361
- - Build succeeds
362
- - Zero breaking changes
363
-
364
- ---
365
-
366
- ## 🎉 What's New in v3.8.14
367
-
368
- **MCP Stability & Validation Release** - Prevents MCP server timeouts from misconfigured servers:
369
-
370
- ### 🔧 Improvements
371
-
372
- - **Proactive REPL command detection** - MCP config loader now detects commands that would start a REPL and hang forever (`node`, `python`, `python3`, `deno`, `bun`, `ruby`, `irb` without arguments)
373
- - **Automatic server skipping** - Problematic MCP servers are automatically skipped with a clear warning instead of causing 60-second timeouts
374
- - **Better error messages** - Clear guidance on how to fix misconfigured MCP servers
375
-
376
- ### 🐛 Bug Fixes
377
-
378
- - **Fixed MCP server timeout on REPL commands** - Servers configured with `node` (no args) no longer hang indefinitely
379
- - **Improved config validation** - Both legacy and modern MCP config formats now validated for REPL commands
380
-
381
- ### ✅ Quality
382
-
383
- - All tests passing
384
- - TypeScript strict mode passes
385
- - Build succeeds
386
- - Zero breaking changes
387
-
388
- ---
389
-
390
- ## 🎉 What's New in v3.8.13
391
-
392
- **Code Quality & Refactoring Release** - Centralized configuration and unified patterns:
393
-
394
- ### 🔧 Improvements
395
-
396
- - **Centralized hardcoded values** - Replaced hardcoded `400` max tool rounds in `src/index.ts` with `AGENT_CONFIG.MAX_TOOL_ROUNDS`
397
- - **New STREAMING_CONFIG constant** - Created centralized streaming configuration in `src/llm/client.ts` for timeout values
398
- - **Unified cache eviction strategy** - Standardized 80% target capacity eviction across `subagent.ts`, `llm-agent.ts`, and `progress-tracker.ts`
399
- - **New BASH_OUTPUT_CACHE_MAX_SIZE constant** - Added to `CACHE_CONFIG` for bash output hash cache
400
- - **Improved Map iteration safety** - Cache eviction now creates key array before deletion to avoid iterator invalidation
401
-
402
- ### 🐛 Bug Fixes
403
-
404
- - **Cleaned up orphaned test files** - Removed temporary `test-file-*.ts` files causing ESLint parsing errors
405
-
406
- ### ✅ Quality
407
-
408
- - All 2083 tests passing
409
- - TypeScript strict mode passes
410
- - Build succeeds
411
- - Zero breaking changes
36
+ **That's it!** AX CLI is now ready to help you build, debug, and ship code faster.
412
37
 
413
38
  ---
414
39
 
415
- ## 🎉 What's New in v3.8.12
40
+ ## Table of Contents
416
41
 
417
- **Security & Code Quality Release** - ReDoS vulnerability fixes and code cleanup:
418
-
419
- ### 🔒 Security Fixes
420
-
421
- - **Fixed ReDoS vulnerability in permission manager** - Glob pattern matching now uses `[^/]*` instead of `.*` to prevent catastrophic backtracking attacks
422
- - **Fixed ReDoS vulnerability in incremental analyzer** - Same fix applied to prevent exponential time complexity on malicious patterns
423
-
424
- ### 🐛 Bug Fixes
425
-
426
- - **Fixed 5 unused error variables in catch blocks** - Removed `_error` variables that ESLint warned about in:
427
- - `churn-calculator.ts`
428
- - `hotspot-detector.ts` (2 instances)
429
- - `metrics-analyzer.ts`
430
- - `security-analyzer.ts`
431
- - **Fixed 2 parseInt calls missing radix parameter** - Added explicit radix `10` to `parseInt()` calls in `status.ts` to ensure correct decimal parsing
432
-
433
- ### ✅ Quality
434
-
435
- - All 2083 tests passing
436
- - TypeScript strict mode passes
437
- - Zero breaking changes
438
- - Improved security posture against ReDoS attacks
439
-
440
- ---
441
-
442
- ## 🎉 What's New in v3.8.11
443
-
444
- **Critical npm Install Fix** - Fixes the `ERR_MODULE_NOT_FOUND` error when running ax-cli after npm install:
445
-
446
- ### 🐛 Bug Fixes
447
-
448
- - **Fixed @ax-cli/schemas module not found** - Resolved the error where Node.js couldn't find the bundled `@ax-cli/schemas` package
449
- - Added `prepublishOnly` script that properly copies workspace package to `node_modules/` before publishing
450
- - Added `postpublish` script to restore workspace symlink for local development
451
- - `bundleDependencies` now correctly includes the package files in the npm tarball
452
-
453
- ### 🔧 Technical Details
454
-
455
- The issue was that npm's `bundleDependencies` doesn't follow workspace symlinks. The fix:
456
- 1. Before publish: Replace symlink with real directory copy
457
- 2. npm pack/publish: Bundles the actual files into tarball
458
- 3. After publish: Restore symlink for local development
459
-
460
- ### ✅ Quality
461
-
462
- - Verified: Package extracts and runs correctly after npm install
463
- - All tests passing
464
- - Zero breaking changes
465
-
466
- ---
467
-
468
- ## 🎉 What's New in v3.8.10
469
-
470
- **npm Publish Fix & Code Quality** - Critical fix for npm installation and continued refactoring:
471
-
472
- ### 🐛 Bug Fixes
473
-
474
- - **Fixed npm install failure** - Resolved `EUNSUPPORTEDPROTOCOL` error when installing from npm
475
- - Changed `workspace:*` (pnpm-specific) to `*` (npm-compatible) for `@ax-cli/schemas` dependency
476
- - Added `bundleDependencies` to properly bundle the workspace package in npm tarball
477
- - Users can now install with `npm install -g @defai.digital/ax-cli` without errors
478
-
479
- ### 🔧 Improvements
480
-
481
- - **Centralized tool constants** - Added `TOOL_DEFAULTS` constant object in `src/llm/tools.ts`
482
- - **Unified naming conventions** - Renamed `GROK_TOOLS` to `LLM_TOOLS` with backwards-compatible aliases
483
- - **Enhanced text editor** - Added `EDITOR_CONFIG` and `ERROR_MESSAGES` constants for maintainability
484
- - **Atomic file writes** - Extracted `atomicWriteFile()` helper to eliminate code duplication
485
-
486
- ### ✅ Quality
487
-
488
- - All 2083 tests passing
489
- - TypeScript strict mode passes
490
- - Build succeeds
491
- - Zero breaking changes
42
+ - [Features](#features)
43
+ - [Installation](#installation)
44
+ - [Configuration](#configuration)
45
+ - [Usage](#usage)
46
+ - [MCP Integration](#mcp-integration)
47
+ - [Project Memory](#project-memory)
48
+ - [Multi-Phase Planner](#multi-phase-task-planner)
49
+ - [Security](#security)
50
+ - [Architecture](#architecture)
51
+ - [Changelog](#changelog)
52
+ - [Documentation](#documentation)
492
53
 
493
54
  ---
494
55
 
495
- ## 🎉 What's New in v3.8.9
496
-
497
- **Refactoring & Configuration Improvements** - Further centralization and code quality enhancements:
498
-
499
- ### 🔧 Improvements
500
-
501
- - **Centralized file name constants** - Added `FILE_NAMES` constant object to eliminate hard-coded file names across the codebase
502
- - **Extended CONFIG_PATHS** - Added new path constants for CUSTOM_MD, INDEX_JSON, MEMORY_JSON, and user directories
503
- - **Unified path handling** - Replaced 15+ hard-coded `.ax-cli` path references with centralized constants
504
- - **Improved text editor tool** - Enhanced functionality and reliability
505
- - **Subagent types refinement** - Streamlined specialized agent type definitions
506
- - **Prompt improvements** - Enhanced default prompts configuration
507
-
508
- ### ✅ Quality
56
+ ## Features
509
57
 
510
- - TypeScript strict mode passes
511
- - Build succeeds
512
- - 76/77 test files pass
513
- - Zero breaking changes
58
+ ### Core Capabilities
514
59
 
515
- ---
516
-
517
- ## 🎉 What's New in v3.8.8
60
+ | Feature | Description |
61
+ |---------|-------------|
62
+ | **GLM-Optimized** | Primary support for Z.AI's GLM-4.6 with 200K context window |
63
+ | **Multi-Phase Planner** | Intelligent task decomposition for complex requests |
64
+ | **Session Continuity** | Directory-specific conversation history with `--continue` |
65
+ | **MCP Integration** | Model Context Protocol with 12+ production-ready templates |
66
+ | **Project Memory** | Intelligent context caching with 50% token savings |
67
+ | **Smart Verbosity** | Three-level output control (Quiet → Concise → Verbose) |
518
68
 
519
- **Code Quality & Maintainability Release** - Major refactoring for improved code consistency:
69
+ ### AI Provider Support
520
70
 
521
- ### 🔧 Improvements
71
+ - **Z.AI GLM-4.6** (default) - 32K max tokens, optimized for complex code generation
72
+ - **OpenAI** - GPT-4, GPT-3.5
73
+ - **Anthropic** - Claude models
74
+ - **Ollama** - Local models
75
+ - **Custom endpoints** - Any OpenAI-compatible API
522
76
 
523
- - **Centralized configuration constants** - Added `CONFIG_DIR_NAME` constant to eliminate hard-coded `.ax-cli` strings across 15+ files
524
- - **Unified error handling** - Replaced inline `error instanceof Error ? error.message : String(error)` patterns with `extractErrorMessage()` utility across 20+ files
525
- - **Improved ES module consistency** - Converted inline `require()` calls to proper ES module imports
526
- - **Better home directory handling** - Replaced `process.env.HOME || process.env.USERPROFILE` patterns with Node.js `homedir()` function
527
- - **Removed examples folder** - Cleaned up unused example files
77
+ > **Note**: For xAI Grok, use [grok-cli](https://github.com/superagent-ai/grok-cli). For Anthropic Claude, use [claude-code](https://claude.ai/code).
528
78
 
529
- ### Quality
79
+ ### Security (Enterprise-Grade, FREE)
530
80
 
531
- - All tests passing
532
- - 98%+ test coverage maintained
533
- - Zero breaking changes
534
- - Improved code maintainability
81
+ | Protection | Severity | Description |
82
+ |------------|----------|-------------|
83
+ | API Key Encryption | - | AES-256-GCM encryption at rest |
84
+ | Command Injection | CVSS 9.8 | Safe command execution with whitelisting |
85
+ | Path Traversal | CVSS 8.6 | Prevent unauthorized file system access |
86
+ | SSRF Prevention | CVSS 7.5 | Validate MCP transport URLs |
87
+ | Input Sanitization | CVSS 7.0 | Comprehensive input validation |
88
+ | Rate Limiting | - | Token bucket algorithm (100 req/min) |
535
89
 
536
- ---
90
+ ### Code Analysis Tools
537
91
 
538
- ## 🎉 What's New in v3.8.7
539
-
540
- **Critical Bug Fixes & Resilience Improvements** - Stability and reliability enhancements.
92
+ - **Dependency Analyzer** - Circular dependencies, coupling metrics
93
+ - **Code Smell Detector** - 10+ anti-patterns detection
94
+ - **Hotspot Analyzer** - Git history-based complexity analysis
95
+ - **Security Scanner** - SQL injection, XSS, hardcoded secrets
541
96
 
542
97
  ---
543
98
 
544
- ## 🎉 What's New in v3.8.6
545
-
546
- **Patch Release** - Bug fixes and stability improvements:
547
-
548
- ### 🐛 Bug Fixes
549
-
550
- - **Performance optimizations** - Improved response times for tool operations
551
- - **Stability improvements** - Enhanced error handling in edge cases
552
-
553
- ### ✅ Quality
554
-
555
- - All 2029 tests passing
556
- - 98%+ test coverage maintained
557
- - Zero breaking changes
558
-
559
- ---
560
-
561
- ## 🎉 What's New in v3.8.5
562
-
563
- **Maintenance Release** - Dependency updates and minor improvements:
564
-
565
- ### 🔧 Improvements
566
-
567
- - **Updated dependencies** - Latest package versions for improved security and performance
568
- - **Documentation refinements** - Minor improvements to clarity and accuracy
569
-
570
- ### ✅ Quality
571
-
572
- - All 2029 tests passing
573
- - 98%+ test coverage maintained
574
- - Zero breaking changes
575
-
576
- ---
577
-
578
- ## 🎉 What's New in v3.8.4
579
-
580
- **Security & Stability Fixes** - Improved error handling and audit logging robustness:
581
-
582
- ### 🐛 Bug Fixes
583
-
584
- - **Fixed audit logger crash on permission errors** - Gracefully handle EPERM/EACCES/EROFS errors instead of crashing
585
- - **Fixed search validation errors being lost** - Validation errors now returned even when audit logging fails
586
- - **Fixed auto-accept logger always enabled** - Now defaults to disabled to prevent unexpected disk writes
587
- - **Fixed encryption error logging** - No longer leaks crypto implementation details (requires DEBUG env var)
588
- - **Improved quiet mode error display** - Shows actual error messages instead of generic "encountered errors"
589
-
590
- ### 🔒 Security
591
-
592
- - Audit logging failures no longer mask security validation errors (ReDoS protection preserved)
593
- - Encryption errors only logged when DEBUG or AX_DEBUG environment variable is set
594
- - Auto-accept audit logging requires explicit configuration to enable
595
-
596
- ### ✅ Quality
597
-
598
- - All 2029 tests passing
599
- - 98%+ test coverage maintained
600
- - Zero breaking changes
601
-
602
- ---
603
-
604
- ## 🎉 What's New in v3.8.3
605
-
606
- **MCP Protocol Fix** - Critical fix for MCP server connectivity:
607
-
608
- ### 🐛 Bug Fixes
609
-
610
- - **Fixed MCP server timeout issue** - Resolved 60-second timeout when connecting to AutomatosX MCP server
611
- - **Added Content-Length framing transport** - New `ContentLengthStdioTransport` class for LSP-style protocol compatibility
612
- - **Protocol mismatch fix** - MCP SDK uses NDJSON but AutomatosX uses Content-Length framing; now supports both
613
- - **Updated MCP SDK to v1.22.0** - Latest SDK with improved capabilities
614
- - **Fixed SDK v1.22 compatibility** - Updated client capabilities structure for new SDK version
615
-
616
- ### ✨ Improvements
617
-
618
- - **Faster MCP connections** - Connection time reduced from 60s timeout to ~200ms
619
- - **Better transport abstraction** - Configurable framing protocol (NDJSON or Content-Length)
620
- - **19 AutomatosX tools** - Full tool suite now available: `run_agent`, `list_agents`, `search_memory`, and more
621
-
622
- ### ✅ Quality
623
-
624
- - All tests passing
625
- - 98%+ test coverage maintained
626
- - Zero breaking changes
627
- - Improved MCP server stability
628
-
629
- ---
630
-
631
- ## 🎉 What's New in v3.8.2
632
-
633
- **Deep Bug Fixes** - Comprehensive stability improvements for enhanced input handling:
634
-
635
- ### 🐛 Bug Fixes
636
-
637
- - **Fixed external editor paste buffer race condition** - External editor callback now properly clears pending paste accumulation to prevent content overwrite
638
- - **Fixed `pastedBlocks` stale closure in submit** - Added `pastedBlocksRef` to ensure `expandPlaceholdersForSubmit` always has current paste block data during rapid paste + submit sequences
639
- - **Synchronized paste block refs** - All `setPastedBlocks` calls now sync `pastedBlocksRef` immediately to prevent race conditions
640
- - **Fixed async iterator cleanup** - Proper cleanup for async iterators in LLM agent
641
- - **Fixed cache eviction improvements** - Better memory management for token counter cache
642
- - **Fixed state validation and race conditions** - Improved state handling in MCP reconnection logic
643
- - **Fixed event listener error handling** - Better error boundaries for edge cases
644
-
645
- ### ✅ Quality
646
-
647
- - All tests passing
648
- - 98%+ test coverage maintained
649
- - Zero breaking changes
650
- - Improved stability for paste operations
651
-
652
- ---
653
-
654
- ## 🎉 What's New in v3.8.0
655
-
656
- **UI/UX Refinements & Bug Fixes** - Polish and stability improvements:
657
-
658
- ### ✨ Improvements
659
-
660
- - **🎨 Unified Terminology**: Consistent "Auto-Edit" naming across entire UI
661
- - Changed "Auto-apply" to "Auto-Edit" throughout all components
662
- - Unified color scheme: Yellow for active, gray for inactive
663
- - Consistent display in status bar, keyboard help, welcome panel, and toast messages
664
-
665
- - **🎨 Color Consistency**: Fixed UI color inconsistencies
666
- - Auto-edit mode now consistently shows yellow when enabled (was mixed green/yellow)
667
- - Verbosity mode properly shows yellow when active (Concise/Verbose), gray when Quiet
668
- - All keyboard shortcuts and status indicators use matching colors
669
-
670
- ### 🐛 Bug Fixes
671
-
672
- - **Fixed ModePill component** - Empty string values now display correctly
673
- - **Fixed ContextBar crashes** - Added bounds checking for invalid percentage values (NaN, Infinity, negative)
674
- - **Fixed formatTokenCount** - Handles invalid token counts gracefully (NaN, Infinity, negative)
675
- - **Fixed Verbosity display** - Pills now correctly highlight yellow when not in Quiet mode
676
- - **Fixed keyboard help colors** - Auto-edit status matches status bar coloring
677
-
678
- ### ✅ Quality
679
-
680
- - All 1,517 tests passing (9 skipped)
681
- - 98.29% test coverage maintained
682
- - Zero breaking changes
683
- - Improved UI/UX consistency
684
-
685
- ---
686
- - **Type Safety**: Full TypeScript support with proper type exports
687
-
688
- ### 📦 Breaking Changes
689
-
690
- **None!** All changes are backward compatible.
691
-
692
- ---
693
-
694
- ## 📦 Installation
99
+ ## Installation
695
100
 
696
101
  ### Supported Platforms
697
102
 
698
- AX CLI officially supports the following platforms:
699
-
700
103
  | Platform | Versions | Architecture |
701
104
  |----------|----------|--------------|
702
- | 🍎 **macOS** | 26+ | x64, ARM64 (Apple Silicon) |
703
- | 🪟 **Windows** | 11+ | x64, ARM64 |
704
- | 🐧 **Ubuntu** | 24.04+ | x64, ARM64 |
705
-
706
- **Note:** AX CLI may work on other platforms and older versions, but the above platforms are officially tested and supported.
105
+ | **macOS** | 26+ | x64, ARM64 (Apple Silicon) |
106
+ | **Windows** | 11+ | x64, ARM64 |
107
+ | **Ubuntu** | 24.04+ | x64, ARM64 |
707
108
 
708
109
  ### Prerequisites
709
110
 
710
111
  - Node.js 24.0.0 or higher
711
112
  - npm package manager
712
113
 
713
- ### Global Installation (Recommended)
114
+ ### Install
714
115
 
715
116
  ```bash
716
117
  npm install -g @defai.digital/ax-cli
717
118
  ```
718
119
 
719
- [Installation Guide →](docs/installation.md)
720
-
721
- ## ⚙️ Configuration
120
+ ---
722
121
 
723
- ### Quick Setup
122
+ ## Configuration
724
123
 
725
- The recommended way to configure AX CLI is using the interactive setup wizard:
124
+ ### Quick Setup (Recommended)
726
125
 
727
126
  ```bash
728
- # Run the setup wizard (recommended)
729
127
  ax-cli setup
730
-
731
- # This will:
732
- # 1. Guide you through provider selection (Z.AI, OpenAI, Anthropic, Ollama, etc.)
733
- # 2. Securely encrypt and store your API key (AES-256-GCM encryption)
734
- # 3. Configure default model and settings
735
- # 4. Validate your configuration
736
128
  ```
737
129
 
738
- **Alternative: Environment Variable Override**
130
+ This interactive wizard will:
131
+ 1. Guide you through provider selection
132
+ 2. Securely encrypt and store your API key (AES-256-GCM)
133
+ 3. Configure default model and settings
134
+ 4. Validate your configuration
135
+
136
+ ### Environment Variable Override
739
137
 
740
- For CI/CD pipelines or temporary overrides, you can set an environment variable:
138
+ For CI/CD pipelines:
741
139
 
742
140
  ```bash
743
- # Override API key temporarily (not recommended for daily use)
744
141
  export YOUR_API_KEY=your_api_key_here
745
142
  ax-cli
746
143
  ```
747
144
 
748
- **⚠️ Security Note**: API keys are automatically encrypted in config files using AES-256-GCM encryption. **Do not manually edit `~/.ax-cli/config.json`** - always use `ax-cli setup` to update your API key securely.
749
-
750
145
  ### Configuration Files
751
146
 
752
- - **User Settings**: `~/.ax-cli/config.json` (API keys are encrypted)
753
- - **Project Settings**: `.ax-cli/settings.json` (project-specific overrides)
754
- - **Custom Instructions**: `.ax-cli/CUSTOM.md` (AI behavior customization)
755
- - **Project Memory**: `.ax-cli/memory.json` (auto-generated context cache)
756
-
757
- [Configuration Guide →](docs/configuration.md)
758
-
759
- ---
760
-
761
- ## 🔒 Security & API Key Handling
762
-
763
- 🛡️ **Enterprise-Grade Security** - Your API keys and data are protected with multiple layers of security:
764
-
765
- ### 🔐 API Key Encryption
766
-
767
- - **AES-256-GCM Encryption**: Military-grade authenticated encryption at rest
768
- - **PBKDF2 Key Derivation**: 600,000 iterations (OWASP 2024 standard)
769
- - **Secure File Permissions**: Config files automatically set to `0600` (owner-only)
770
- - **Auto-Migration**: Existing plain-text keys are automatically encrypted
771
-
772
- ### 🎯 What's Protected
773
-
774
- ✅ **Casual file browsing** - Prevents accidental exposure in editors
775
- ✅ **Config backups** - Keys unreadable in plain-text backups
776
- ✅ **Accidental commits** - Encrypted keys are useless without machine context
777
- ✅ **Data at rest** - Never stored in plain-text on disk
778
-
779
- ### ⚠️ Limitations (Transparent)
780
-
781
- ❌ **Determined attackers** with machine access can derive encryption keys
782
- ❌ **Open-source analysis** - Implementation is publicly visible
783
-
784
- > **Trade-off**: Like AWS CLI, kubectl, and GitHub CLI, we balance security with usability and portability.
785
-
786
- ### 🛡️ Security Best Practices
787
-
788
- 1. **CI/CD**: Use environment variables (`export API_KEY=...`)
789
- 2. **File Permissions**: Verify `ls -la ~/.ax-cli/config.json` shows `-rw-------`
790
- 3. **Git Safety**: Add `.ax-cli/` to `.gitignore`
791
- 4. **Key Rotation**: Update regularly via `ax-cli setup`
792
- 5. **Scoped Keys**: Use minimal permissions and spending limits
793
- 6. **Monitoring**: Check provider dashboards for unusual activity
794
-
795
- ### 📊 Privacy & Logging
796
-
797
- - ✅ **API keys**: NEVER logged
798
- - ✅ **Prompts**: Stored locally (encrypted if keys present)
799
- - ✅ **Errors**: Sanitized to remove sensitive data
800
- - ✅ **Telemetry**: NONE collected
801
-
802
- ### 🚨 Report Security Issues
803
-
804
- Email: **security@defai.digital** (private, not public issues)
805
-
806
- Include: vulnerability description, reproduction steps, impact, and suggested fix. Response within 48 hours.
147
+ | File | Purpose |
148
+ |------|---------|
149
+ | `~/.ax-cli/config.json` | User settings (API keys encrypted) |
150
+ | `.ax-cli/settings.json` | Project-specific overrides |
151
+ | `.ax-cli/CUSTOM.md` | AI behavior customization |
152
+ | `.ax-cli/memory.json` | Auto-generated context cache |
807
153
 
808
154
  ---
809
155
 
810
- ## 🎯 Usage Examples
156
+ ## Usage
811
157
 
812
158
  ### Interactive Mode
813
159
 
@@ -815,75 +161,35 @@ Include: vulnerability description, reproduction steps, impact, and suggested fi
815
161
  # Start interactive chat
816
162
  ax-cli
817
163
 
818
- # Continue the most recent conversation in this directory
164
+ # Continue previous conversation
819
165
  ax-cli --continue
820
- # or
821
166
  ax-cli -c
822
-
823
- # Available slash commands:
824
- /help # Show help
825
- /continue # Continue incomplete response
826
- /init # Initialize project
827
- /clear # Clear chat history
828
- /models # Switch AI model
829
- /usage # Show API usage statistics
830
- /doctor # Run health check diagnostics
831
- /tasks # List background tasks
832
- /task <id> # View background task output
833
- /kill <id> # Kill a background task
834
- /version # Show AX CLI version
835
- /commit-and-push # AI-powered git commit
836
- /exit # Exit application
837
-
838
- # Multi-Phase Planner commands:
839
- /plans # List all execution plans
840
- /plan # Show current plan details
841
- /phases # Show phase progress
842
- /pause # Pause current plan execution
843
- /resume # Resume paused plan
844
- /skip # Skip current phase
845
- /abandon # Abandon current plan
846
167
  ```
847
168
 
848
- ### ⌨️ Keyboard Shortcuts (Claude Code-style)
849
-
850
- AX CLI supports powerful keyboard shortcuts for enhanced productivity:
851
-
852
- | Shortcut | Action | Description |
853
- |----------|--------|-------------|
854
- | **Ctrl+O** | Cycle verbosity | Quiet (grouped) → Concise (per-tool) → Verbose (full details) → Quiet |
855
- | **Ctrl+B** | Background mode | Move running command to background, or toggle "always background" mode |
856
- | **Ctrl+K** | Quick actions | Open quick actions menu |
857
- | **Shift+Tab** | Auto-edit mode | Toggle automatic approval for all operations |
858
- | **Ctrl+C** | Clear/Exit | Clear input (press twice to exit) |
859
- | **↑/↓** | History | Navigate command history |
860
- | **Ctrl+A/E** | Cursor | Move to line start/end |
861
- | **Ctrl+W** | Delete word | Delete word before cursor |
862
-
863
- **Verbosity Levels** (Ctrl+O to cycle):
864
- - **Quiet** (default): Groups operations → `⏺ Working on app.ts (3 edits, 5 reads) ✓ 2.3s`
865
- - **Concise**: One line per tool → `⏺ Read (app.ts) ✓ 22 lines`
866
- - **Verbose**: Full detailsShows args, outputs, diffs, timings
867
-
868
- ### 🔄 Background Tasks
869
-
870
- Run long-running commands in the background (like Claude Code's Ctrl+B):
871
-
872
- ```bash
873
- # Method 1: Append ' &' to any command
874
- > npm run dev &
875
- 🔄 Background task started
876
- Task ID: bg_abc123
877
-
878
- # Method 2: Press Ctrl+B during execution to move to background
879
-
880
- # Method 3: Toggle "always background" mode with Ctrl+B when idle
881
-
882
- # Manage background tasks:
883
- /tasks # List all background tasks
884
- /task bg_abc123 # View task output
885
- /kill bg_abc123 # Kill a running task
886
- ```
169
+ ### Slash Commands
170
+
171
+ | Command | Description |
172
+ |---------|-------------|
173
+ | `/help` | Show help |
174
+ | `/continue` | Continue incomplete response |
175
+ | `/init` | Initialize project |
176
+ | `/clear` | Clear chat history |
177
+ | `/models` | Switch AI model |
178
+ | `/usage` | Show API usage statistics |
179
+ | `/doctor` | Run health check diagnostics |
180
+ | `/tasks` | List background tasks |
181
+ | `/exit` | Exit application |
182
+
183
+ ### Keyboard Shortcuts
184
+
185
+ | Shortcut | Action |
186
+ |----------|--------|
187
+ | **Ctrl+O** | Cycle verbosity (Quiet Concise Verbose) |
188
+ | **Ctrl+B** | Move command to background |
189
+ | **Ctrl+K** | Quick actions menu |
190
+ | **Shift+Tab** | Toggle auto-edit mode |
191
+ | **Ctrl+C** | Clear input (press twice to exit) |
192
+ | **↑/↓** | Navigate command history |
887
193
 
888
194
  ### Headless Mode
889
195
 
@@ -891,558 +197,263 @@ Task ID: bg_abc123
891
197
  # One-shot commands
892
198
  ax-cli -p "analyze this codebase"
893
199
  ax-cli -p "fix TypeScript errors" -d /path/to/project
894
- ax-cli -p "write tests for utils/" --max-tool-rounds 50
200
+ ax-cli -p "write tests" --max-tool-rounds 50
895
201
 
896
202
  # With specific model
897
203
  ax-cli -p "refactor" --model glm-4.6
898
204
  ```
899
205
 
900
- ### 🔌 VSCode Integration
901
-
902
- AX CLI integrates seamlessly with Visual Studio Code via tasks and keyboard shortcuts:
206
+ ### Background Tasks
903
207
 
904
208
  ```bash
905
- # Analyze current file
906
- ax-cli --prompt "Analyze this file" --file src/index.ts --json --vscode
907
-
908
- # Explain selected code
909
- ax-cli --prompt "Explain this code" --selection "function foo() {...}" --json --vscode
209
+ # Append '&' to run in background
210
+ > npm run dev &
910
211
 
911
- # Review git changes
912
- ax-cli --prompt "Review my changes" --git-diff --json --vscode
212
+ # Or press Ctrl+B during execution
913
213
 
914
- # Analyze specific line range
915
- ax-cli --prompt "Optimize this section" --file app.ts --line-range 50-100 --json
214
+ # Manage tasks
215
+ /tasks # List all
216
+ /task bg_abc123 # View output
217
+ /kill bg_abc123 # Kill task
916
218
  ```
917
219
 
918
- **Quick Setup:**
919
- ```bash
920
- # Copy VSCode templates to your project
921
- cd your-project
922
- mkdir -p .vscode
923
- cp node_modules/@defai.digital/ax-cli/templates/vscode/*.json .vscode/
220
+ ### Health Check
924
221
 
925
- # Start using with Cmd+Shift+P → "Tasks: Run Task" → Select AX task
222
+ ```bash
223
+ ax-cli doctor # Run diagnostics
224
+ ax-cli doctor --verbose # Detailed output
225
+ ax-cli doctor --json # JSON format
926
226
  ```
927
227
 
928
- **Pre-configured Tasks:**
929
- - 🔍 Analyze Current File
930
- - 📝 Explain Selection
931
- - 🔄 Review Git Changes
932
- - 🧪 Generate Tests
933
- - 📚 Document Code
934
- - ♻️ Refactor Selection
935
- - 🐛 Find Bugs
936
- - ⚡ Optimize Performance
937
-
938
- [VSCode Integration Guide →](docs/vscode-integration-guide.md)
228
+ ---
939
229
 
940
- ### 🔄 Session Continuity (`--continue`)
230
+ ## MCP Integration
941
231
 
942
- Resume conversations seamlessly with directory-specific session history:
232
+ Extend AX CLI with Model Context Protocol servers:
943
233
 
944
234
  ```bash
945
- # Start a conversation in your project
946
- cd /path/to/your/project
947
- ax-cli
948
- # > Work on some features, then exit
235
+ # Add from template (one command!)
236
+ ax-cli mcp add figma --template
949
237
 
950
- # Later, continue where you left off
951
- cd /path/to/your/project
952
- ax-cli --continue
953
- # All previous context is restored!
238
+ # Add custom server
239
+ ax-cli mcp add linear --transport sse --url https://mcp.linear.app/sse
954
240
 
955
- # Each project maintains its own independent history
956
- cd /path/to/another/project
957
- ax-cli --continue
958
- # Fresh context for this project
959
- ```
241
+ # List servers
242
+ ax-cli mcp list
960
243
 
961
- **How It Works:**
962
- - Each project directory gets its own conversation session
963
- - History includes all messages, tool calls, and results
964
- - Integrated with `.ax-cli/CUSTOM.md` for project-specific context
965
- - Sessions stored in `~/.ax-cli/sessions/` by project hash
966
- - Up to 50 most recent messages preserved per session
244
+ # Preview tools
245
+ ax-cli mcp tools <server>
967
246
 
968
- **Use Cases:**
969
- - Multi-day feature development with accumulated knowledge
970
- - Resume after interruptions without losing context
971
- - Maintain separate conversations per project
972
- - Natural workflow continuity across sessions
247
+ # Browse templates
248
+ ax-cli mcp browse
249
+ ```
973
250
 
974
- ### Project Initialization
251
+ ### Available Templates
975
252
 
976
- ```bash
977
- # Analyze and initialize project
978
- ax-cli init
253
+ Figma, GitHub, Vercel, Puppeteer, Storybook, Sentry, and 6+ more.
979
254
 
980
- # Force regeneration
981
- ax-cli init --force
255
+ ### Per-Server Timeout
982
256
 
983
- # Verbose output
984
- ax-cli init --verbose
985
- ```
257
+ For long-running tools (e.g., AutomatosX):
986
258
 
987
- ### Usage Tracking
259
+ ```json
260
+ {
261
+ "mcpServers": {
262
+ "automatosx": {
263
+ "transport": { "type": "stdio", "command": "ax", "args": ["mcp"] },
264
+ "timeout": 2700000
265
+ }
266
+ }
267
+ }
268
+ ```
988
269
 
989
- Track your API usage across the current session:
270
+ ---
990
271
 
991
- ```bash
992
- # Show current session usage statistics
993
- ax-cli usage show
272
+ ## Project Memory
994
273
 
995
- # Show detailed breakdown by model
996
- ax-cli usage show --detailed
274
+ Intelligent context caching for reduced token costs:
997
275
 
998
- # Export as JSON
999
- ax-cli usage show --json
276
+ ```bash
277
+ # Initialize (scans codebase)
278
+ ax-cli memory warmup
1000
279
 
1001
- # Reset session statistics
1002
- ax-cli usage reset
280
+ # Output:
281
+ # Project memory generated (3,305 tokens)
282
+ # 📊 Token Distribution:
283
+ # Structure: 1,252 tokens (38%)
284
+ # README: 1,111 tokens (34%)
285
+ # Config: 835 tokens (25%)
286
+ # Patterns: 99 tokens (3%)
1003
287
  ```
1004
288
 
1005
- **Phase 1**: Z.AI provider with session-based tracking
1006
- - Tracks prompt tokens, completion tokens, and reasoning tokens
1007
- - Per-model breakdown available
1008
- - Historical data available via Z.AI dashboard: https://z.ai/manage-apikey/billing
1009
-
1010
- **Phase 2** (Coming Soon): Support for additional providers (OpenAI, Anthropic, etc.)
289
+ ### Commands
1011
290
 
1012
- [CLI Reference →](docs/cli-reference.md) | [Usage Guide →](docs/usage.md)
291
+ | Command | Description |
292
+ |---------|-------------|
293
+ | `memory warmup` | Create project memory |
294
+ | `memory refresh` | Update after changes |
295
+ | `memory status` | Show status & token distribution |
296
+ | `memory clear` | Remove project memory |
297
+ | `memory cache-stats` | Show cache efficiency |
1013
298
 
1014
- ## 📋 Working with Large Content
299
+ ### Options
1015
300
 
1016
- AX CLI has **intelligent paste handling** that automatically manages large text inputs for better readability.
301
+ ```bash
302
+ ax-cli memory warmup -d 5 # Custom scan depth (1-10)
303
+ ax-cli memory warmup -m 12000 # Custom max tokens
304
+ ax-cli memory warmup --dry-run # Preview without saving
305
+ ```
1017
306
 
1018
- ### 📝 Smart Paste Auto-Collapse
307
+ ---
1019
308
 
1020
- When you paste **20+ lines** of text, AX CLI automatically collapses it:
309
+ ## Multi-Phase Task Planner
1021
310
 
1022
- - ✅ **Automatic Detection**: Pastes with 20+ lines are auto-collapsed
1023
- - ✅ **Clean Display**: Shows `[Pasted text #1 +89 lines]` instead of cluttering the UI
1024
- - ✅ **Full Submission**: Complete text is still sent to the AI (not just the placeholder)
1025
- - ✅ **Review Anytime**: Press **Ctrl+P** on a collapsed block to expand/collapse
311
+ Automatic decomposition for complex requests:
1026
312
 
1027
- **Example:**
1028
313
  ```bash
1029
- # Paste a 100-line error log
1030
- # → Shows: [Pasted text #1 +100 lines]
1031
- # → AI receives: Full 100 lines
314
+ > "Refactor auth, add tests, update docs"
1032
315
 
1033
- # Position cursor on placeholder and press Ctrl+P to review
1034
- # Expands to show all 100 lines
316
+ 📋 Plan Generated: 4 phases
317
+ ├── Phase 1: Analysis (low risk)
318
+ ├── Phase 2: Implementation (medium risk)
319
+ ├── Phase 3: Testing (low risk)
320
+ └── Phase 4: Documentation (low risk)
1035
321
  ```
1036
322
 
1037
- **Configure in `~/.ax-cli/config.json`:**
1038
- ```json
1039
- {
1040
- "paste": {
1041
- "autoCollapse": true, // Enable/disable (default: true)
1042
- "collapseThreshold": 20 // Min lines to collapse (default: 20)
1043
- }
1044
- }
1045
- ```
323
+ ### Plan Commands
1046
324
 
1047
- ### ⚠️ Character Counter Warning
325
+ | Command | Description |
326
+ |---------|-------------|
327
+ | `/plans` | List all execution plans |
328
+ | `/plan` | Show current plan details |
329
+ | `/phases` | Show phase progress |
330
+ | `/pause` | Pause current plan |
331
+ | `/resume` | Resume paused plan |
332
+ | `/skip` | Skip current phase |
333
+ | `/abandon` | Abandon current plan |
1048
334
 
1049
- The character counter shows visual warnings for very large single inputs:
1050
- - Gray (0-999) → Cyan (1000-1599) → Yellow (1600-1999) → **Red (2000+)**
335
+ ### Complexity Triggers
1051
336
 
1052
- ### Alternative Approaches for Extremely Large Content
337
+ - Refactoring, migration, restructuring
338
+ - Multi-file changes
339
+ - Testing and documentation requests
340
+ - Multi-step instructions
1053
341
 
1054
- **Option 1: File Reference (Interactive Mode)**
1055
- ```bash
1056
- # Save your content to a file first
1057
- cat > context.txt
1058
- # (paste content, then Ctrl+D)
342
+ ---
1059
343
 
1060
- # Then use memory commands
1061
- ax-cli
1062
- > /memory add context.txt
1063
- > analyze the content I just added
1064
- ```
344
+ ## Security
1065
345
 
1066
- **Option 2: Headless Mode with File Input**
1067
- ```bash
1068
- # Direct file processing
1069
- ax-cli --prompt "analyze this: $(cat large-file.txt)"
346
+ ### API Key Protection
1070
347
 
1071
- # Or use the --file flag
1072
- ax-cli --file path/to/code.ts --prompt "review this code"
1073
- ```
348
+ - **AES-256-GCM** encryption at rest
349
+ - **PBKDF2** key derivation (600,000 iterations)
350
+ - **Secure permissions** (0600 owner-only)
351
+ - **Auto-migration** from plain-text
1074
352
 
1075
- **Option 3: Use `/memory` Commands**
1076
- ```bash
1077
- # In interactive mode
1078
- > /memory add src/
1079
- > /memory add logs/error.log
1080
- > analyze the errors in the log file
1081
- ```
353
+ ### Best Practices
1082
354
 
1083
- ### Character Count Guide
355
+ 1. **CI/CD**: Use environment variables
356
+ 2. **Permissions**: Verify `ls -la ~/.ax-cli/config.json` shows `-rw-------`
357
+ 3. **Git**: Add `.ax-cli/` to `.gitignore`
358
+ 4. **Rotation**: Update regularly via `ax-cli setup`
1084
359
 
1085
- The interactive terminal shows a character counter `[count/2000]` with color-coded warnings:
360
+ ### Privacy
1086
361
 
1087
- | Color | Range | Recommendation |
1088
- |-------|-------|----------------|
1089
- | **Gray** | 0-999 | Optimal length |
1090
- | **Cyan** | 1000-1599 | ⚠️ Getting long |
1091
- | **Yellow** | 1600-1999 | ⚠️ Consider using files |
1092
- | **Red** | 2000+ | ❌ Use file-based workflow |
362
+ - API keys: **Never logged**
363
+ - Telemetry: **None collected**
364
+ - Errors: Sanitized to remove sensitive data
1093
365
 
1094
- ## 🏥 Health Check & Diagnostics
366
+ ### Report Issues
1095
367
 
1096
- Run comprehensive diagnostics to verify your AX CLI configuration:
368
+ Email: **security@defai.digital** (private disclosure)
1097
369
 
1098
- ```bash
1099
- # Run full diagnostic check
1100
- ax-cli doctor
370
+ ---
1101
371
 
1102
- # Get detailed diagnostic information
1103
- ax-cli doctor --verbose
372
+ ## Architecture
1104
373
 
1105
- # Output results as JSON
1106
- ax-cli doctor --json
1107
- ```
374
+ - **SSOT Type System** via `@ax-cli/schemas`
375
+ - **TypeScript strict mode** with Zod validation
376
+ - **98%+ test coverage** (2083 tests)
377
+ - **Modular design** with clean separation
378
+ - **Enterprise security** with AES-256-GCM encryption
1108
379
 
1109
- The `doctor` command checks:
1110
- - ✓ Node.js version (24+)
1111
- - ✓ Configuration files (user and project)
1112
- - ✓ API key and base URL
1113
- - ✓ API connectivity and authentication
1114
- - ✓ Model configuration
1115
- - ✓ MCP server configuration
1116
- - ✓ Dependencies (ripgrep, git)
380
+ ---
1117
381
 
1118
- ## 🔌 MCP (Model Context Protocol)
382
+ ## Changelog
1119
383
 
1120
- Extend AX CLI with MCP servers for additional capabilities:
384
+ ### v3.8.21 (Latest)
1121
385
 
1122
- ```bash
1123
- # Add MCP server
1124
- ax-cli mcp add linear --transport sse --url https://mcp.linear.app/sse
386
+ - **Configurable confirmation timeout** - Now uses `TIMEOUT_CONFIG.CONFIRMATION_TIMEOUT`
387
+ - **Dynamic timeout message** - Displays actual configured value
1125
388
 
1126
- # List servers
1127
- ax-cli mcp list
389
+ ### v3.8.20
1128
390
 
1129
- # Remove server
1130
- ax-cli mcp remove linear
1131
- ```
391
+ - **Centralized path constants** - `CONFIG_PATHS` for unified path handling
392
+ - **Unified timeout usage** - `TIMEOUT_CONFIG` and `MCP_CONFIG`
1132
393
 
1133
- [MCP Integration Guide →](docs/mcp.md)
394
+ ### v3.8.19
1134
395
 
1135
- ## 🧠 Project Memory
396
+ - **Exported utilities** - `sleep()` and `calculateExponentialBackoff()`
397
+ - **Reduced code duplication** - Centralized backoff logic
1136
398
 
1137
- Project Memory enables intelligent context caching for z.ai GLM-4.6, reducing token costs and improving response consistency:
399
+ ### v3.8.18
1138
400
 
1139
- ```bash
1140
- # Initialize project memory (scans codebase)
1141
- ax-cli memory warmup
401
+ - **Extended timeout configuration** - Network/API and UI timeouts
1142
402
 
1143
- # Output:
1144
- # ✓ Project memory generated (3,305 tokens)
1145
- #
1146
- # 📊 Context breakdown:
1147
- # Structure: 1,252 tokens (38%)
1148
- # README: 1,111 tokens (34%)
1149
- # Config: 835 tokens (25%)
1150
- # Patterns: 99 tokens (3%)
1151
- ```
403
+ ### v3.8.17
1152
404
 
1153
- ### How It Works
405
+ - **Centralized configuration** - All timeouts configurable via YAML
1154
406
 
1155
- 1. **Warmup**: Scans your project structure, README, configs, and detects architecture patterns
1156
- 2. **Auto-Injection**: Memory context is automatically prepended to system prompts
1157
- 3. **z.ai Caching**: Identical prompt prefixes are automatically cached by z.ai (50% token savings)
1158
- 4. **Statistics**: Track cache efficiency with `ax-cli memory cache-stats`
407
+ ### v3.8.16
1159
408
 
1160
- ### Memory Commands
409
+ - **Per-server MCP timeout** - Fixes AutomatosX timeout errors
1161
410
 
1162
- ```bash
1163
- ax-cli memory warmup # Create project memory
1164
- ax-cli memory refresh # Update after changes
1165
- ax-cli memory status # Show memory status & token distribution
1166
- ax-cli memory clear # Remove project memory
1167
- ax-cli memory cache-stats # Show cache efficiency statistics
411
+ ### v3.8.15
1168
412
 
1169
- # Options
1170
- ax-cli memory warmup -d 5 # Custom scan depth (1-10)
1171
- ax-cli memory warmup -m 12000 # Custom max tokens
1172
- ax-cli memory warmup --dry-run # Preview without saving
1173
- ax-cli memory status --verbose # Show full context
1174
- ax-cli memory status --json # JSON output
1175
- ```
413
+ - **Increased streaming timeouts** - 90s first chunk, 120s idle
414
+ - **Better file type handling** - Glob patterns for tsx, jsx, vue
1176
415
 
1177
- ### Token Distribution Visualization
416
+ ### v3.8.14
1178
417
 
1179
- ```
1180
- 📊 Token Distribution:
1181
- ████████░░░░░░░░░░░░ Structure (38%)
1182
- ███████░░░░░░░░░░░░░ README (34%)
1183
- █████░░░░░░░░░░░░░░░ Config (25%)
1184
- █░░░░░░░░░░░░░░░░░░░ Patterns (3%)
1185
- ```
418
+ - **REPL command detection** - Prevents MCP server hangs
1186
419
 
1187
- ### Recommended Workflow
420
+ [View full changelog →](https://github.com/defai-digital/ax-cli/releases)
1188
421
 
1189
- ```bash
1190
- # 1. Initialize project (if not done)
1191
- ax-cli init
422
+ ---
1192
423
 
1193
- # 2. Create project memory
1194
- ax-cli memory warmup
424
+ ## Documentation
1195
425
 
1196
- # 3. Use ax-cli normally - memory is auto-injected
1197
- ax-cli -p "refactor authentication module"
426
+ | Guide | Description |
427
+ |-------|-------------|
428
+ | [Features](docs/features.md) | Complete feature list |
429
+ | [Installation](docs/installation.md) | Detailed installation guide |
430
+ | [Configuration](docs/configuration.md) | Configuration options |
431
+ | [Usage](docs/usage.md) | Comprehensive usage guide |
432
+ | [CLI Reference](docs/cli-reference.md) | Command-line reference |
433
+ | [MCP Integration](docs/mcp.md) | Model Context Protocol guide |
434
+ | [Architecture](docs/architecture.md) | Technical architecture |
435
+ | [Troubleshooting](docs/troubleshooting.md) | Common issues |
1198
436
 
1199
- # 4. After major changes, refresh memory
1200
- ax-cli memory refresh
1201
- ```
437
+ ---
1202
438
 
1203
- ## 🎯 Multi-Phase Task Planner (v3.0.0)
439
+ ## Enterprise Features
1204
440
 
1205
- AX CLI now includes an intelligent multi-phase task planner that automatically decomposes complex requests:
441
+ For teams requiring advanced capabilities:
1206
442
 
1207
- ```bash
1208
- # Complex requests are automatically detected and planned
1209
- > "Refactor the authentication system, add tests, and update documentation"
443
+ - **Compliance Reports** - SOC2, HIPAA, PCI-DSS
444
+ - **Advanced Audit Logging** - Tamper-proof with 1+ year retention
445
+ - **Team Collaboration** - Shared history with full-text search
446
+ - **Policy Enforcement** - Approval workflows
447
+ - **SSO/SAML** - Enterprise identity provider support
448
+ - **Priority Support** - 24-hour SLA
1210
449
 
1211
- 📋 Plan Generated: 4 phases
1212
- ├── Phase 1: Analysis (low risk)
1213
- ├── Phase 2: Implementation (medium risk)
1214
- ├── Phase 3: Testing (low risk)
1215
- └── Phase 4: Documentation (low risk)
450
+ Contact: **sales@defai.digital**
1216
451
 
1217
- Executing Phase 1/4: Analysis...
1218
- ```
452
+ ---
1219
453
 
1220
- **Features:**
1221
- - **Automatic Complexity Detection**: 57 keyword patterns detect when planning is needed
1222
- - **LLM-Based Decomposition**: Intelligent breakdown into logical phases
1223
- - **Dependency Management**: Phases execute in proper order
1224
- - **Progress Tracking**: Real-time updates on phase completion
1225
- - **File Tracking**: Monitors which files are modified per phase
1226
- - **Context Pruning**: Automatically manages token limits between phases
1227
-
1228
- **Complexity Triggers:**
1229
- - Refactoring, migration, or restructuring tasks
1230
- - Multi-file changes or feature implementations
1231
- - Testing and documentation requests
1232
- - Architecture or design tasks
1233
- - Multi-step instructions (first...then...finally)
454
+ ## License
1234
455
 
1235
- ## 🤖 Advanced Multi-Agent Orchestration
1236
-
1237
- **AX CLI** is designed as a focused, single-agent CLI tool for direct AI-powered development tasks. For advanced multi-agent orchestration, collaborative AI workflows, and complex task automation, we recommend **[AutomatosX](https://automatosx.com)**.
1238
-
1239
- ### When to Use AutomatosX Instead
1240
-
1241
- - **Multi-Agent Collaboration**: Coordinate multiple AI agents working together on complex projects
1242
- - **Specialized Agent Teams**: Use domain-specific agents (QA, architecture, security, etc.)
1243
- - **Advanced Workflows**: Build sophisticated automation pipelines with agent orchestration
1244
- - **Enterprise Scale**: Large-scale projects requiring parallel agent execution and coordination
1245
-
1246
- AX CLI focuses on being a reliable, single-agent development assistant, while AutomatosX provides the full multi-agent orchestration platform for advanced use cases.
1247
-
1248
- ## 🏗️ Architecture
1249
-
1250
- AX CLI implements enterprise-grade architecture with:
1251
-
1252
- - **Single Source of Truth (SSOT)** type system via `@ax-cli/schemas`
1253
- - **TypeScript strict mode** with Zod runtime validation
1254
- - **98%+ test coverage** (1517 tests passing)
1255
- - **Modular design** with clean separation of concerns
1256
- - **Enterprise security** with AES-256-GCM encryption for sensitive data
1257
-
1258
- [Architecture Documentation →](docs/architecture.md)
1259
-
1260
- ## 📚 Documentation
1261
-
1262
- - [Features](docs/features.md) - Complete feature list and capabilities
1263
- - [Installation](docs/installation.md) - Detailed installation guide
1264
- - [Configuration](docs/configuration.md) - Configuration options and settings
1265
- - [Security & API Key Handling](#-security--api-key-handling) - Security model, encryption details, and best practices
1266
- - [Usage](docs/usage.md) - Comprehensive usage guide
1267
- - [CLI Reference](docs/cli-reference.md) - Command-line interface reference
1268
- - [MCP Integration](docs/mcp.md) - Model Context Protocol guide
1269
- - [Project Memory](automatosx/prd/project-memory-prd.md) - Project memory feature specification
1270
- - [Architecture](docs/architecture.md) - Technical architecture details
1271
- - [Development](docs/development.md) - Development and contribution guide
1272
- - [Troubleshooting](docs/troubleshooting.md) - Common issues and solutions
1273
-
1274
- ## 📋 Changelog
1275
-
1276
- ### v3.8.0 (2025-11-23)
1277
-
1278
- **🎨 UI/UX Refinements & Bug Fixes:**
1279
-
1280
- **✨ Improvements:**
1281
- - Unified "Auto-Edit" terminology throughout entire UI (was inconsistently "Auto-apply")
1282
- - Consistent yellow color scheme for Auto-Edit mode when enabled
1283
- - Fixed Verbosity mode color display (yellow when active, gray when Quiet)
1284
- - Improved visual consistency across status bar, keyboard help, and welcome panel
1285
-
1286
- **🐛 Bug Fixes:**
1287
- - Fixed ModePill component handling of empty string values
1288
- - Fixed ContextBar crashes with invalid percentage values (NaN, Infinity, negative)
1289
- - Fixed formatTokenCount handling of invalid inputs
1290
- - Fixed Verbosity pill not highlighting when not in Quiet mode
1291
- - Fixed keyboard help color inconsistencies
1292
-
1293
- **✅ Quality:**
1294
- - All 1,517 tests passing (9 skipped)
1295
- - 98.29% test coverage maintained
1296
- - Zero breaking changes
1297
-
1298
- ### v3.7.2 (2025-11-23)
1299
-
1300
- **🐛 Bug Fixes - Test Stability:**
1301
- - Fixed flaky process-pool tests failing in CI/CD environments
1302
- - Added proper async cleanup waiting with `setImmediate()`
1303
- - Fixed race condition where `activeProcesses` count was checked before cleanup completed
1304
- - Tests: "should handle errors without leaking resources" and "should remove all event listeners after execution"
1305
- - Follows Node.js best practices for testing async cleanup operations
1306
-
1307
- **✅ Test Results:**
1308
- - All 1,517 tests passing (9 skipped)
1309
- - 98.29% test coverage maintained
1310
- - Zero breaking changes
1311
- - Improved CI/CD reliability
1312
-
1313
- ### v3.6.1 (2025-11-22)
1314
-
1315
- **🔧 Improvements:**
1316
- - **Smart Paste Auto-Collapse**: Intelligent handling of large text inputs
1317
- - Automatic collapse of 20+ line pastes for better readability
1318
- - Press Ctrl+P to expand/collapse pasted content
1319
- - Configurable threshold in `~/.ax-cli/config.json`
1320
- - Full content still sent to AI (not just the placeholder)
1321
-
1322
- **✅ Quality:**
1323
- - All 1,381 tests passing with 98.29% coverage
1324
- - Zero breaking changes
1325
- - Cleaner codebase with reduced complexity
1326
-
1327
- ### v3.6.0 (2025-11-22)
1328
-
1329
- **🔒 Enterprise-Grade Security (FREE & Open Source):**
1330
- - **API Key Encryption**: AES-256-GCM encryption for API keys at rest
1331
- - **Command Injection Protection**: CVSS 9.8 CRITICAL fix with command whitelisting
1332
- - **Path Traversal Hardening**: CVSS 8.6 HIGH fix preventing unauthorized file access
1333
- - **SSRF Attack Prevention**: CVSS 7.5 HIGH fix for MCP transport URL validation
1334
- - **Input Sanitization**: CVSS 7.0 HIGH fix for comprehensive input validation
1335
- - **Error Sanitization**: CVSS 6.5 MEDIUM fix preventing credential leakage
1336
- - **Security Audit Logging**: Basic JSON logging with 30-day retention
1337
- - **Rate Limiting**: Token bucket algorithm to prevent API abuse
1338
- - **Memory Leak Fixes**: Process pool management for long-running operations
1339
-
1340
- **✅ Test Quality:**
1341
- - **1517+ tests passing** with 98.29% coverage
1342
- - All security modules fully tested and validated
1343
- - Production-ready security implementation
1344
-
1345
- **🏢 Enterprise Features (Available):**
1346
- - Advanced audit logging with compliance reports (SOC2, HIPAA, PCI-DSS)
1347
- - Team collaboration with shared chat history
1348
- - Policy enforcement and approval workflows
1349
- - Extended audit log retention (1+ years)
1350
- - SSO/SAML integration support
1351
- - Priority 24-hour SLA support
1352
- - Contact sales@defai.digital for enterprise licensing
1353
-
1354
- **🔧 Configuration Improvements:**
1355
- - New `ax-cli setup` wizard for secure API key configuration
1356
- - Automatic migration of plain-text API keys to encrypted format
1357
- - Environment variable override support for CI/CD workflows
1358
-
1359
- ### v3.5.3 (2025-11-22)
1360
-
1361
- **Bug Fixes - Test Quality & Reliability:**
1362
- - Fixed unhandled promise rejection in subagent tests that caused Node.js warnings
1363
- - Replaced meaningless test assertions (`expect(true).toBe(true)`) with real validation
1364
- - Properly skipped untestable tests with clear TODO documentation
1365
- - Fixed flaky performance test by adjusting timing threshold (0.9x instead of 0.7x)
1366
-
1367
- **Test Suite Improvements:**
1368
- - Improved test isolation and error handling patterns
1369
- - Enhanced performance test reliability for CI/CD environments
1370
- - Better documentation of test limitations
1371
- - All 1,038 tests passing (1,036 passed + 2 properly skipped)
1372
-
1373
- **Code Quality:**
1374
- - Comprehensive test quality analysis across all test files
1375
- - Eliminated false confidence from placeholder tests
1376
- - Maintained 98%+ test coverage with genuine validation
1377
-
1378
- ### v3.7.1 (2025-11-22)
1379
-
1380
- **Bug Fixes - Critical Stability Improvements:**
1381
- - Fixed crash on malformed LLM responses: Added try-catch to `parseToolArgumentsCached` in LLMAgent
1382
- - Prevents agent crash when LLM sends invalid JSON in tool arguments
1383
- - Returns empty object instead of throwing, allowing session to continue
1384
- - Affects ~1 in 1000 tool calls based on observed LLM behavior
1385
- - Fixed memory leak in BashTool: Added dispose() method
1386
- - Properly terminates running bash processes on cleanup
1387
- - Removes all event listeners to prevent accumulation
1388
- - Fixes resource leak from orphaned process handles
1389
- - Fixed agent disposal: Added tool cleanup cascade
1390
- - Agent now calls bash.dispose() during cleanup
1391
- - Ensures all tool resources are properly released
1392
-
1393
- **Bug Fixes - Performance & Memory:**
1394
- - Fixed unbounded cache growth in `toolCallArgsCache`
1395
- - Limited to 500 entries with LRU eviction (oldest 100)
1396
- - Prevents 5+ MB memory leak per 10,000 tool calls
1397
- - Applied to both LLMAgent and Subagent classes
1398
- - Fixed resource leak in bash abort handler
1399
- - Cleanup listener now called even when moveToBackground() fails
1400
- - Prevents event listener memory leaks
1401
- - Updated MCPManager to use singleton TokenCounter
1402
- - Saves 100-200ms initialization time
1403
- - Shares tiktoken encoder instance across MCP operations
1404
-
1405
- **Test Results:**
1406
- - All 1,497 tests passing (9 skipped)
1407
- - 98.29% test coverage maintained
1408
- - Zero breaking changes
1409
-
1410
- **Combined Performance Gains:**
1411
- - Startup: 245-495ms faster (30-50% improvement)
1412
- - Runtime: 70-150ms faster per session
1413
- - Memory: Bounded, predictable usage with no leaks
1414
-
1415
- ### v3.5.2 (2025-11-22)
1416
-
1417
- **Bug Fixes - Resource Leak Prevention:**
1418
- - Fixed uncleaned nested timeout in bash tool that held process references after exit
1419
- - Fixed uncleaned timeout in MCP URL validation causing 3-second memory leaks
1420
- - Added `.unref()` to background cleanup timers to prevent GC blocking
1421
- - Added try-finally blocks for guaranteed timeout cleanup in error scenarios
1422
-
1423
- **Bug Fixes - Platform Compatibility:**
1424
- - Fixed Windows home directory bug in command history (used `os.homedir()` instead of `"~"` fallback)
1425
-
1426
- **Code Quality:**
1427
- - Comprehensive resource leak analysis across 78+ potential issues
1428
- - Improved timeout cleanup patterns following Node.js best practices
1429
- - Enhanced memory management for better garbage collection
1430
-
1431
- ### v3.5.0
1432
-
1433
- **Features:**
1434
- - Multi-phase task planner with automatic complexity detection
1435
- - Enhanced MCP integration with production-ready templates
1436
- - Project memory system with intelligent context caching
1437
- - Advanced code analysis tools (dependency, security, metrics)
1438
-
1439
- ## 📄 License
1440
-
1441
- MIT License - see [LICENSE](LICENSE) for details
1442
-
1443
- ## 🙏 Acknowledgments
1444
-
1445
- Built with **AutomatosX** multi-agent orchestration to achieve enterprise-class standards.
456
+ MIT License - see [LICENSE](LICENSE) for details.
1446
457
 
1447
458
  ---
1448
459