@defai.digital/ax-cli 4.1.11 → 4.1.14

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 (83) hide show
  1. package/.ax-cli/settings.json +1 -0
  2. package/README.md +140 -589
  3. package/dist/agent/dependency-resolver.d.ts +7 -0
  4. package/dist/agent/dependency-resolver.js +46 -18
  5. package/dist/agent/dependency-resolver.js.map +1 -1
  6. package/dist/agent/execution/tool-executor.d.ts +4 -0
  7. package/dist/agent/execution/tool-executor.js +76 -52
  8. package/dist/agent/execution/tool-executor.js.map +1 -1
  9. package/dist/agent/parallel-tools.d.ts +4 -0
  10. package/dist/agent/parallel-tools.js +65 -24
  11. package/dist/agent/parallel-tools.js.map +1 -1
  12. package/dist/agent/planning/plan-executor.d.ts +0 -5
  13. package/dist/agent/planning/plan-executor.js +23 -6
  14. package/dist/agent/planning/plan-executor.js.map +1 -1
  15. package/dist/agent/streaming/stream-handler.js +7 -4
  16. package/dist/agent/streaming/stream-handler.js.map +1 -1
  17. package/dist/agent/subagent-orchestrator.d.ts +35 -2
  18. package/dist/agent/subagent-orchestrator.js +188 -146
  19. package/dist/agent/subagent-orchestrator.js.map +1 -1
  20. package/dist/agent/subagent-types.js +3 -1
  21. package/dist/agent/subagent-types.js.map +1 -1
  22. package/dist/agent/subagent.d.ts +15 -4
  23. package/dist/agent/subagent.js +91 -72
  24. package/dist/agent/subagent.js.map +1 -1
  25. package/dist/design/figma-alias.d.ts +77 -0
  26. package/dist/design/figma-alias.js +246 -0
  27. package/dist/design/figma-alias.js.map +1 -1
  28. package/dist/design/figma-client.d.ts +4 -0
  29. package/dist/design/figma-client.js +24 -4
  30. package/dist/design/figma-client.js.map +1 -1
  31. package/dist/design/figma-map.js +78 -6
  32. package/dist/design/figma-map.js.map +1 -1
  33. package/dist/design/figma-tokens.js +6 -2
  34. package/dist/design/figma-tokens.js.map +1 -1
  35. package/dist/design/index.d.ts +1 -1
  36. package/dist/design/index.js +3 -1
  37. package/dist/design/index.js.map +1 -1
  38. package/dist/design/types.d.ts +9 -0
  39. package/dist/mcp/client-v2.js +4 -0
  40. package/dist/mcp/client-v2.js.map +1 -1
  41. package/dist/mcp/config-detector.js +3 -4
  42. package/dist/mcp/config-detector.js.map +1 -1
  43. package/dist/mcp/debug.d.ts +207 -0
  44. package/dist/mcp/debug.js +398 -0
  45. package/dist/mcp/debug.js.map +1 -0
  46. package/dist/mcp/index.d.ts +1 -0
  47. package/dist/mcp/index.js +4 -0
  48. package/dist/mcp/index.js.map +1 -1
  49. package/dist/mcp/reconnection.js +6 -3
  50. package/dist/mcp/reconnection.js.map +1 -1
  51. package/dist/mcp/validation.js +15 -6
  52. package/dist/mcp/validation.js.map +1 -1
  53. package/dist/memory/index.d.ts +1 -0
  54. package/dist/memory/index.js +2 -0
  55. package/dist/memory/index.js.map +1 -1
  56. package/dist/memory/provider-context-store.d.ts +127 -0
  57. package/dist/memory/provider-context-store.js +385 -0
  58. package/dist/memory/provider-context-store.js.map +1 -0
  59. package/dist/sdk/errors.d.ts +2 -0
  60. package/dist/sdk/errors.js +2 -0
  61. package/dist/sdk/errors.js.map +1 -1
  62. package/dist/sdk/index.d.ts +633 -62
  63. package/dist/sdk/index.js +854 -116
  64. package/dist/sdk/index.js.map +1 -1
  65. package/dist/sdk/testing.d.ts +46 -4
  66. package/dist/sdk/testing.js +58 -6
  67. package/dist/sdk/testing.js.map +1 -1
  68. package/dist/sdk/version.d.ts +13 -9
  69. package/dist/sdk/version.js +13 -9
  70. package/dist/sdk/version.js.map +1 -1
  71. package/dist/utils/file-lock.d.ts +141 -0
  72. package/dist/utils/file-lock.js +559 -0
  73. package/dist/utils/file-lock.js.map +1 -0
  74. package/dist/utils/provider-context.d.ts +243 -0
  75. package/dist/utils/provider-context.js +421 -0
  76. package/dist/utils/provider-context.js.map +1 -0
  77. package/dist/utils/provider-file-cache.d.ts +91 -0
  78. package/dist/utils/provider-file-cache.js +165 -0
  79. package/dist/utils/provider-file-cache.js.map +1 -0
  80. package/dist/utils/provider-settings.d.ts +181 -0
  81. package/dist/utils/provider-settings.js +450 -0
  82. package/dist/utils/provider-settings.js.map +1 -0
  83. package/package.json +2 -2
package/README.md CHANGED
@@ -1,739 +1,290 @@
1
- # AX CLI - Enterprise-Class CLI for Vibe Coding
1
+ # AX CLI - AI Coding Assistant for GLM & Grok
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-2265%20passing-brightgreen?style=flat-square)](https://github.com/defai-digital/ax-cli/actions/workflows/test.yml)
4
+ [![Tests](https://img.shields.io/badge/tests-3584%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
  [![Node.js](https://img.shields.io/badge/node-%3E%3D24.0.0-blue?style=flat-square&logo=node.js)](https://nodejs.org/)
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
8
8
 
9
9
  <p align="center">
10
- <img src=".github/assets/screenshot1.png" alt="AX CLI Screenshot" width="800"/>
10
+ <img src=".github/assets/glm.png" alt="AX-GLM" width="400"/>
11
+ <img src=".github/assets/grok.png" alt="AX-Grok" width="400"/>
11
12
  </p>
12
13
 
13
14
  <p align="center">
14
- <strong>GLM-Optimized CLI Enterprise Architecture 98%+ Test Coverage</strong>
15
+ <strong>Enterprise-grade AI coding assistant optimized for GLM and Grok</strong>
15
16
  </p>
16
17
 
17
18
  ---
18
19
 
19
20
  ## Quick Start
20
21
 
21
- ```bash
22
- # Install globally
23
- npm install -g @defai.digital/ax-cli
24
-
25
- # Configure (secure API key setup)
26
- ax-cli setup
22
+ ### For GLM Users (Z.AI)
27
23
 
28
- # For VSCode users - install the extension (recommended)
29
- code --install-extension defai-digital.ax-cli-vscode
24
+ ```bash
25
+ npm install -g @defai.digital/ax-glm
26
+ ax-glm setup
27
+ ax-glm
28
+ ```
30
29
 
31
- # Initialize your project
32
- ax-cli init
30
+ ### For Grok Users (xAI)
33
31
 
34
- # Start coding!
35
- ax-cli
32
+ ```bash
33
+ npm install -g @defai.digital/ax-grok
34
+ ax-grok setup
35
+ ax-grok
36
36
  ```
37
37
 
38
- **That's it!** AX CLI is now ready to help you build, debug, and ship code faster. VSCode users get enhanced features with the native extension.
38
+ That's it! Run `/init` inside the CLI to initialize your project.
39
39
 
40
- ---
41
-
42
- ## Table of Contents
43
-
44
- - [Features](#features)
45
- - [Installation](#installation)
46
- - [Provider-Specific CLIs](#provider-specific-clis)
47
- - [Configuration](#configuration)
48
- - [Usage](#usage)
49
- - [VSCode Integration](#vscode-integration)
50
- - [MCP Integration](#mcp-integration)
51
- - [Project Memory](#project-memory)
52
- - [Multi-Phase Planner](#multi-phase-task-planner)
53
- - [Security](#security)
54
- - [Architecture](#architecture)
55
- - [Changelog](#changelog)
56
- - [Documentation](#documentation)
40
+ > **Legacy Package:** `@defai.digital/ax-cli` is maintained for backward compatibility but new users should install `ax-glm` or `ax-grok` directly.
57
41
 
58
42
  ---
59
43
 
60
- ## Features
61
-
62
- ### Core Capabilities
44
+ ## Why AX CLI?
63
45
 
64
46
  | Feature | Description |
65
47
  |---------|-------------|
66
- | **GLM-Optimized** | Primary support for Z.AI's GLM-4.6 (200K context) and GLM-4.5v (vision) |
67
- | **Multi-Phase Planner** | Intelligent task decomposition for complex requests |
68
- | **Session Continuity** | Directory-specific conversation history with `--continue` |
48
+ | **Provider Optimized** | First-class support for GLM (Z.AI) and Grok (xAI) with provider-specific parameters |
49
+ | **17 Built-in Tools** | File editing, bash execution, search, todos, and more |
69
50
  | **MCP Integration** | Model Context Protocol with 12+ production-ready templates |
70
51
  | **Project Memory** | Intelligent context caching with 50% token savings |
71
- | **Smart Verbosity** | Three-level output control (Quiet Concise → Verbose) |
72
- | **Auto-Update** | Automatic update check on startup with user confirmation |
52
+ | **Enterprise Security** | AES-256-GCM encryption, no telemetry, CVSS-rated protections |
53
+ | **98%+ Test Coverage** | 3584+ tests with strict TypeScript |
73
54
 
74
- ### AI Provider Support
55
+ ---
75
56
 
76
- - **Z.AI GLM-4.6** (default) - 200K context, optimized for complex code generation
77
- - **Z.AI GLM-4.5v** (vision) - 64K multimodal context, auto-switches for image analysis
78
- - **OpenAI** - GPT-4, GPT-3.5
79
- - **Anthropic** - Claude models
80
- - **Ollama** - Local models
81
- - **Custom endpoints** - Any OpenAI-compatible API
57
+ ## Supported Models
82
58
 
83
- ### Security (Enterprise-Grade, FREE)
59
+ ### GLM (Z.AI)
84
60
 
85
- | Protection | Severity | Description |
86
- |------------|----------|-------------|
87
- | API Key Encryption | - | AES-256-GCM encryption at rest |
88
- | Command Injection | CVSS 9.8 | Safe command execution with whitelisting |
89
- | Path Traversal | CVSS 8.6 | Prevent unauthorized file system access |
90
- | SSRF Prevention | CVSS 7.5 | Validate MCP transport URLs |
91
- | Input Sanitization | CVSS 7.0 | Comprehensive input validation |
92
- | Rate Limiting | - | Token bucket algorithm (100 req/min) |
61
+ | Model | Context | Features |
62
+ |-------|---------|----------|
63
+ | `glm-4.6` | 200K | Thinking mode, optimized for code |
64
+ | `glm-4.5v` | 64K | Vision support for image analysis |
65
+ | `glm-4` | 128K | Balanced performance |
93
66
 
94
- ### Code Analysis Tools
67
+ ### Grok (xAI)
95
68
 
96
- - **Dependency Analyzer** - Circular dependencies, coupling metrics
97
- - **Code Smell Detector** - 10+ anti-patterns detection
98
- - **Hotspot Analyzer** - Git history-based complexity analysis
99
- - **Security Scanner** - SQL injection, XSS, hardcoded secrets
100
- - **Multi-Language Support** - TypeScript, JavaScript, Python, Rust, Go, C, C++, Swift, HTML, CSS
69
+ | Model | Features |
70
+ |-------|----------|
71
+ | `grok-3` | Reasoning effort (thinking mode), 131K context |
72
+ | `grok-3-mini` | Fast, cost-effective with thinking |
73
+ | `grok-2-vision` | Image understanding |
74
+ | `grok-2` | Live web search |
101
75
 
102
76
  ---
103
77
 
104
78
  ## Installation
105
79
 
106
- ### Supported Platforms
107
-
108
- | Platform | Versions | Architecture |
109
- |----------|----------|--------------|
110
- | **macOS** | 26+ | x64, ARM64 (Apple Silicon) |
111
- | **Windows** | 11+ | x64, ARM64 |
112
- | **Ubuntu** | 24.04+ | x64, ARM64 |
113
-
114
- ### Prerequisites
80
+ ### Requirements
115
81
 
116
- - Node.js 24.0.0 or higher
117
- - npm package manager
82
+ - Node.js 24.0.0+
83
+ - macOS 14+, Windows 11+, or Ubuntu 24.04+
118
84
 
119
85
  ### Install
120
86
 
121
87
  ```bash
122
- npm install -g @defai.digital/ax-cli
123
- ```
124
-
125
- ---
126
-
127
- ## Provider-Specific CLIs
128
-
129
- In addition to the main `ax-cli` package, we offer lightweight provider-specific CLIs for developers who prefer a dedicated experience with their AI provider of choice.
130
-
131
- ### AX-GLM - GLM-Optimized CLI
132
-
133
- **[@defai.digital/ax-glm](https://www.npmjs.com/package/@defai.digital/ax-glm)** - A streamlined CLI optimized for Z.AI's GLM models.
134
-
135
- ```bash
136
- # Install
137
- npm install -g @defai.digital/ax-glm
138
-
139
- # Run
140
- ax-glm
88
+ # Choose your provider
89
+ npm install -g @defai.digital/ax-glm # GLM (Z.AI)
90
+ npm install -g @defai.digital/ax-grok # Grok (xAI)
141
91
  ```
142
92
 
143
- **Features:**
144
- - **GLM-4.6** (200K context) - Advanced reasoning and code generation
145
- - **GLM-4.5v** (Vision) - Multimodal support for image analysis
146
- - **Thinking Mode** - Extended reasoning for complex problems
147
- - Pre-configured for optimal GLM performance
148
- - Lightweight package with minimal dependencies
149
-
150
- **Supported Models:**
151
- | Model | Context | Description |
152
- |-------|---------|-------------|
153
- | `glm-4.6` | 200K | Latest GLM with superior code generation |
154
- | `glm-4.5v` | 64K | Vision-enabled for image analysis |
155
- | `glm-4.5` | 128K | Balanced performance and context |
156
-
157
- ### AX-Grok - Grok-Optimized CLI
158
-
159
- **[@defai.digital/ax-grok](https://www.npmjs.com/package/@defai.digital/ax-grok)** - A streamlined CLI optimized for xAI's Grok models.
93
+ ### Setup
160
94
 
161
95
  ```bash
162
- # Install
163
- npm install -g @defai.digital/ax-grok
164
-
165
- # Run
166
- ax-grok
96
+ ax-glm setup # or ax-grok setup
167
97
  ```
168
98
 
169
- **Features:**
170
- - **Grok 3** - Latest Grok model with advanced reasoning
171
- - **Grok 3 Mini** - Fast, cost-effective option
172
- - **Vision Support** - Image understanding capabilities
173
- - **Web Search** - Real-time information retrieval
174
- - **Thinking Mode** - Extended reasoning with transparent thought process
175
- - Pre-configured for optimal Grok performance
176
-
177
- **Supported Models:**
178
- | Model | Description |
179
- |-------|-------------|
180
- | `grok-3` | Full Grok 3 with maximum capabilities |
181
- | `grok-3-fast` | Optimized for speed |
182
- | `grok-3-mini` | Lightweight, cost-effective |
183
- | `grok-3-mini-fast` | Fastest response times |
184
-
185
- ### Choosing Between CLIs
186
-
187
- | Package | Best For |
188
- |---------|----------|
189
- | **@defai.digital/ax-cli** | Multi-provider support, enterprise features, maximum flexibility |
190
- | **@defai.digital/ax-glm** | Dedicated GLM users, minimal footprint, China-optimized |
191
- | **@defai.digital/ax-grok** | Dedicated Grok users, real-time search, xAI ecosystem |
192
-
193
- All three packages share the same core architecture, tools, and capabilities - they differ only in default provider configuration and package size.
99
+ The setup wizard will:
100
+ 1. Securely encrypt and store your API key (AES-256-GCM)
101
+ 2. Configure your default model
102
+ 3. Validate your configuration
194
103
 
195
104
  ---
196
105
 
197
- ## Configuration
198
-
199
- ### Quick Setup (Recommended)
200
-
201
- ```bash
202
- ax-cli setup
203
- ```
204
-
205
- This interactive wizard will:
206
- 1. Guide you through provider selection
207
- 2. Securely encrypt and store your API key (AES-256-GCM)
208
- 3. Configure default model and settings
209
- 4. Validate your configuration
210
-
211
- Then start `ax-cli` and run `/init` to initialize your project and generate `.ax-cli/CUSTOM.md`.
212
-
213
- ### Environment Variable Override
106
+ ## Usage
214
107
 
215
- For CI/CD pipelines:
108
+ ### Interactive Mode
216
109
 
217
110
  ```bash
218
- export YOUR_API_KEY=your_api_key_here
219
- ax-cli
220
- ```
221
-
222
- ### Configuration Files
223
-
224
- | File | Purpose |
225
- |------|---------|
226
- | `~/.ax-cli/config.json` | User settings (API keys encrypted) |
227
- | `.ax-cli/settings.json` | Project-specific overrides |
228
- | `.ax-cli/CUSTOM.md` | AI behavior customization |
229
- | `.ax-cli/memory.json` | Auto-generated context cache |
230
-
231
- ### Auto-Update Settings
232
-
233
- AX CLI automatically checks for updates on startup and prompts you to install. Configure in `~/.ax-cli/config.json`:
234
-
235
- ```json
236
- {
237
- "autoUpdate": {
238
- "enabled": true,
239
- "checkIntervalHours": 24,
240
- "autoInstall": false
241
- }
242
- }
111
+ ax-glm # Start chat
112
+ ax-glm --continue # Resume previous conversation
113
+ ax-glm -c # Short form
243
114
  ```
244
115
 
245
- | Setting | Default | Description |
246
- |---------|---------|-------------|
247
- | `enabled` | `true` | Enable/disable automatic update checks |
248
- | `checkIntervalHours` | `24` | Hours between update checks (0 = always check) |
249
- | `autoInstall` | `false` | Auto-install without prompting (not recommended) |
250
-
251
- ---
252
-
253
- ## Usage
254
-
255
- ### Interactive Mode
116
+ ### Headless Mode
256
117
 
257
118
  ```bash
258
- # Start interactive chat
259
- ax-cli
260
-
261
- # Continue previous conversation
262
- ax-cli --continue
263
- ax-cli -c
119
+ ax-glm -p "analyze this codebase"
120
+ ax-glm -p "fix TypeScript errors" -d /path/to/project
264
121
  ```
265
122
 
266
- ### Slash Commands
123
+ ### Essential Commands
267
124
 
268
125
  | Command | Description |
269
126
  |---------|-------------|
270
- | `/help` | Show help |
271
- | `/continue` | Continue incomplete response |
272
- | `/init` | Initialize project |
273
- | `/clear` | Clear chat history |
127
+ | `/init` | Initialize project context |
128
+ | `/help` | Show all commands |
274
129
  | `/models` | Switch AI model |
275
- | `/usage` | Show API usage statistics |
276
- | `/doctor` | Run health check diagnostics |
277
- | `/tasks` | List background tasks |
278
- | `/exit` | Exit application |
130
+ | `/doctor` | Run diagnostics |
131
+ | `/exit` | Exit CLI |
279
132
 
280
133
  ### Keyboard Shortcuts
281
134
 
282
135
  | Shortcut | Action |
283
136
  |----------|--------|
284
- | **Ctrl+O** | Cycle verbosity (Quiet → Concise → Verbose) |
285
- | **Ctrl+B** | Move command to background |
286
- | **Ctrl+K** | Quick actions menu |
287
- | **Shift+Tab** | Toggle auto-edit mode |
288
- | **Ctrl+C** | Clear input (press twice to exit) |
289
- | **Esc×2** | Clear input (press Escape twice quickly) |
290
- | **↑/↓** | Navigate command history |
291
-
292
- ### Headless Mode
137
+ | `Ctrl+O` | Toggle verbosity |
138
+ | `Ctrl+K` | Quick actions |
139
+ | `Ctrl+B` | Background mode |
140
+ | `Shift+Tab` | Auto-edit mode |
141
+ | `Esc` ×2 | Cancel/clear |
293
142
 
294
- ```bash
295
- # One-shot commands
296
- ax-cli -p "analyze this codebase"
297
- ax-cli -p "fix TypeScript errors" -d /path/to/project
298
- ax-cli -p "write tests" --max-tool-rounds 50
299
-
300
- # With specific model
301
- ax-cli -p "refactor" --model glm-4.6
302
- ```
143
+ ---
303
144
 
304
- ### Background Tasks
145
+ ## Configuration
305
146
 
306
- ```bash
307
- # Append '&' to run in background
308
- > npm run dev &
147
+ ### Config Files
309
148
 
310
- # Or press Ctrl+B during execution
149
+ | File | Purpose |
150
+ |------|---------|
151
+ | `~/.ax-glm/config.json` | User settings (encrypted API key) |
152
+ | `.ax-glm/settings.json` | Project overrides |
153
+ | `.ax-glm/CUSTOM.md` | Custom AI instructions |
311
154
 
312
- # Manage tasks
313
- /tasks # List all
314
- /task bg_abc123 # View output
315
- /kill bg_abc123 # Kill task
316
- ```
155
+ > Grok uses `~/.ax-grok/` and `.ax-grok/` directories.
317
156
 
318
- ### Health Check
157
+ ### Environment Variables
319
158
 
320
159
  ```bash
321
- ax-cli doctor # Run diagnostics
322
- ax-cli doctor --verbose # Detailed output
323
- ax-cli doctor --json # JSON format
160
+ # For CI/CD
161
+ export ZAI_API_KEY=your_key # GLM
162
+ export XAI_API_KEY=your_key # Grok
324
163
  ```
325
164
 
326
165
  ---
327
166
 
328
167
  ## MCP Integration
329
168
 
330
- Extend AX CLI with Model Context Protocol servers:
169
+ Extend capabilities with Model Context Protocol:
331
170
 
332
171
  ```bash
333
- # Add from template (one command!)
334
- ax-cli mcp add figma --template
335
-
336
- # Add custom server
337
- ax-cli mcp add linear --transport sse --url https://mcp.linear.app/sse
338
-
339
- # List servers
340
- ax-cli mcp list
341
-
342
- # Preview tools
343
- ax-cli mcp tools <server>
344
-
345
- # Browse templates
346
- ax-cli mcp browse
172
+ ax-glm mcp add figma --template
173
+ ax-glm mcp add github --template
174
+ ax-glm mcp list
347
175
  ```
348
176
 
349
- ### Available Templates
350
-
351
- Figma, GitHub, Vercel, Puppeteer, Storybook, Sentry, and 6+ more.
352
-
353
- ### Per-Server Timeout
354
-
355
- For long-running tools (e.g., AutomatosX):
356
-
357
- ```json
358
- {
359
- "mcpServers": {
360
- "automatosx": {
361
- "transport": { "type": "stdio", "command": "ax", "args": ["mcp"] },
362
- "timeout": 2700000
363
- }
364
- }
365
- }
366
- ```
177
+ **Available Templates:** Figma, GitHub, Vercel, Puppeteer, Storybook, Sentry, and more.
367
178
 
368
179
  ---
369
180
 
370
- ## VSCode Integration
371
-
372
- AX CLI offers two powerful VSCode integration options:
373
-
374
- ### Option 1: Native VSCode Extension (Recommended)
375
-
376
- The official AX CLI extension provides the most seamless experience:
181
+ ## VSCode Extension
377
182
 
378
183
  ```bash
379
- # Install extension from VSCode Marketplace
380
184
  code --install-extension defai-digital.ax-cli-vscode
381
-
382
- # Or install via VSCode: Extensions → Search "AX CLI"
383
185
  ```
384
186
 
385
- **Key Features:**
386
- - **Terminal Integration with Diff Preview** - File changes appear as diffs with accept/reject
387
- - **Sidebar Chat Panel** - Native chat interface with multiple sessions
388
- - **Secure API Key Storage** - OS-level credential storage (Keychain/Credential Manager)
389
- - **Context-Aware Commands** - Right-click actions for current file/selection
390
- - **Checkpoint & Rewind System** - Automatic checkpoints before changes
391
- - **Multi-Provider AI Support** - Switch between Grok, GLM, Claude, GPT-4o from status bar
392
-
393
- **Quick Start:**
394
- 1. Install extension: `code --install-extension defai-digital.ax-cli-vscode`
395
- 2. Set API key: `Cmd+Shift+K` (Mac) or `Ctrl+Shift+K` (Windows/Linux)
396
- 3. Open chat: `Cmd+Shift+A` or click AX icon in sidebar
397
- 4. Start coding with AI assistance!
398
-
399
- **Keyboard Shortcuts:**
400
- | Shortcut (Mac) | Shortcut (Win/Linux) | Action |
401
- |----------------|---------------------|---------|
402
- | `Cmd+Shift+A` | `Ctrl+Shift+A` | Open Chat |
403
- | `Cmd+Shift+E` | `Ctrl+Shift+E` | Explain Selection |
404
- | `Cmd+Shift+R` | `Ctrl+Shift+R` | Refactor Selection |
405
- | `Cmd+Shift+T` | `Ctrl+Shift+T` | Generate Tests |
406
- | `Cmd+Shift+B` | `Ctrl+Shift+B` | Find Bugs |
407
-
408
- ### Option 2: Terminal Integration (Lightweight)
409
-
410
- Use AX CLI in VSCode's integrated terminal with pre-configured tasks:
411
-
412
- ```bash
413
- # Copy VSCode templates to your project
414
- cd your-project
415
- mkdir -p .vscode
416
- cp node_modules/@defai.digital/ax-cli/templates/vscode/*.json .vscode/
417
-
418
- # Run tasks via Command Palette
419
- Cmd+Shift+P → "Tasks: Run Task" → Select AX task
420
- ```
421
-
422
- **Available Tasks:**
423
- - AX: Interactive Chat
424
- - AX: Analyze Current File
425
- - AX: Explain Selection
426
- - AX: Generate Tests for File
427
- - AX: Review Git Changes
428
- - AX: Find Bugs in File
429
-
430
- For detailed setup instructions, see **[VSCode Integration Guide](docs/vscode-integration-guide.md)**.
431
-
432
- ---
433
-
434
- ## Figma Integration
435
-
436
- Connect AX CLI with Figma for design-to-code workflows:
437
-
438
- ### Interactive Mode (Recommended)
439
-
440
- ```bash
441
- # Start interactive mode
442
- ax-cli
443
-
444
- # Then use natural language:
445
- > Map my Figma file ABC123xyz
446
- > Extract design tokens from my Figma file and format as Tailwind
447
- > Audit my design for accessibility issues
448
- > Search for all button components in my Figma file
449
- ```
450
-
451
- ### CLI Commands
452
-
453
- ```bash
454
- # Authenticate with Figma
455
- ax-cli design auth login
456
-
457
- # Map your Figma file structure
458
- ax-cli design map YOUR_FILE_KEY
459
-
460
- # Extract design tokens
461
- ax-cli design tokens pull YOUR_FILE_KEY --format tailwind
462
-
463
- # Audit design consistency
464
- ax-cli design audit YOUR_FILE_KEY --rules all
465
- ```
466
-
467
- For the complete guide, see **[Figma Integration Guide](docs/figma-guide.md)**.
187
+ - Sidebar chat panel
188
+ - Diff preview for file changes
189
+ - Context-aware commands
190
+ - Checkpoint & rewind system
468
191
 
469
192
  ---
470
193
 
471
194
  ## Project Memory
472
195
 
473
- Intelligent context caching for reduced token costs:
474
-
475
- ```bash
476
- # Initialize (scans codebase)
477
- ax-cli memory warmup
478
-
479
- # Output:
480
- # ✓ Project memory generated (3,305 tokens)
481
- # 📊 Token Distribution:
482
- # Structure: 1,252 tokens (38%)
483
- # README: 1,111 tokens (34%)
484
- # Config: 835 tokens (25%)
485
- # Patterns: 99 tokens (3%)
486
- ```
487
-
488
- ### Commands
489
-
490
- | Command | Description |
491
- |---------|-------------|
492
- | `memory warmup` | Create project memory |
493
- | `memory refresh` | Update after changes |
494
- | `memory status` | Show status & token distribution |
495
- | `memory clear` | Remove project memory |
496
- | `memory cache-stats` | Show cache efficiency |
497
-
498
- ### Options
499
-
500
- ```bash
501
- ax-cli memory warmup -d 5 # Custom scan depth (1-10)
502
- ax-cli memory warmup -m 12000 # Custom max tokens
503
- ax-cli memory warmup --dry-run # Preview without saving
504
- ```
505
-
506
- ---
507
-
508
- ## Multi-Phase Task Planner
509
-
510
- Automatic decomposition for complex requests:
196
+ Reduce token costs with intelligent caching:
511
197
 
512
198
  ```bash
513
- > "Refactor auth, add tests, update docs"
514
-
515
- 📋 Plan Generated: 4 phases
516
- ├── Phase 1: Analysis (low risk)
517
- ├── Phase 2: Implementation (medium risk)
518
- ├── Phase 3: Testing (low risk)
519
- └── Phase 4: Documentation (low risk)
199
+ ax-glm memory warmup # Generate context cache
200
+ ax-glm memory status # View token distribution
520
201
  ```
521
202
 
522
- ### Plan Commands
523
-
524
- | Command | Description |
525
- |---------|-------------|
526
- | `/plans` | List all execution plans |
527
- | `/plan` | Show current plan details |
528
- | `/phases` | Show phase progress |
529
- | `/pause` | Pause current plan |
530
- | `/resume` | Resume paused plan |
531
- | `/skip` | Skip current phase |
532
- | `/abandon` | Abandon current plan |
533
-
534
- ### Complexity Triggers
535
-
536
- - Refactoring, migration, restructuring
537
- - Multi-file changes
538
- - Testing and documentation requests
539
- - Multi-step instructions
540
-
541
203
  ---
542
204
 
543
205
  ## Security
544
206
 
545
- ### API Key Protection
546
-
547
- - **AES-256-GCM** encryption at rest
548
- - **PBKDF2** key derivation (600,000 iterations)
549
- - **Secure permissions** (0600 owner-only)
550
- - **Auto-migration** from plain-text
551
-
552
- ### Best Practices
553
-
554
- 1. **CI/CD**: Use environment variables
555
- 2. **Permissions**: Verify `ls -la ~/.ax-cli/config.json` shows `-rw-------`
556
- 3. **Git**: Add `.ax-cli/` to `.gitignore`
557
- 4. **Rotation**: Update regularly via `ax-cli setup`
558
-
559
- ### Privacy
560
-
561
- - API keys: **Never logged**
562
- - Telemetry: **None collected**
563
- - Errors: Sanitized to remove sensitive data
564
-
565
- ### Report Issues
566
-
567
- Email: **security@defai.digital** (private disclosure)
207
+ - **API Key Encryption:** AES-256-GCM with PBKDF2 (600K iterations)
208
+ - **No Telemetry:** Zero data collection
209
+ - **CVSS Protections:** Command injection (9.8), path traversal (8.6), SSRF (7.5)
568
210
 
569
211
  ---
570
212
 
571
- ## Architecture
213
+ ## Packages
572
214
 
573
- - **SSOT Type System** via `@ax-cli/schemas`
574
- - **TypeScript strict mode** with Zod validation
575
- - **98%+ test coverage** (2265+ tests)
576
- - **Modular design** with clean separation
577
- - **Enterprise security** with AES-256-GCM encryption
215
+ | Package | Description |
216
+ |---------|-------------|
217
+ | [@defai.digital/ax-glm](https://www.npmjs.com/package/@defai.digital/ax-glm) | GLM-optimized CLI |
218
+ | [@defai.digital/ax-grok](https://www.npmjs.com/package/@defai.digital/ax-grok) | Grok-optimized CLI |
219
+ | [@defai.digital/ax-core](https://www.npmjs.com/package/@defai.digital/ax-core) | Shared core library |
220
+ | [@defai.digital/ax-cli](https://www.npmjs.com/package/@defai.digital/ax-cli) | Legacy launcher |
578
221
 
579
222
  ---
580
223
 
581
224
  ## Changelog
582
225
 
583
- ### v4.1.7 - Fix workspace:* dependency resolution
584
-
585
- - **Fix**: Resolve `workspace:*` protocol to actual versions before npm publish
586
- - ax-glm and ax-grok now correctly depend on `^4.1.7` instead of `workspace:*`
587
- - ax-core now correctly depends on `@defai.digital/ax-schemas@^4.1.7`
588
- - All features from v4.1.6 included
589
-
590
- ### v4.1.6 - Enhanced Setup Wizards
591
-
592
- - **GLM Setup Rework**: Dual-path setup supporting Z.AI Cloud and Local Server
593
- - Z.AI Cloud path: API key → model selection → MCP integration
594
- - Local Server path: Auto-detection of Ollama/LM Studio/vLLM/LocalAI → dynamic model fetching
595
- - No API key required for local inference
596
- - **Grok Setup Enhancement**: 5-step wizard with advanced configuration
597
- - Model selection grouped by family (Grok 3 with thinking vs Grok 2 standard)
598
- - Feature badges (🧠 Thinking, 👁️ Vision, 🔍 Search) with context window info
599
- - Extended thinking mode configuration (off/low/high reasoning_effort)
600
- - Live web search toggle
601
- - API key validation with format checking (xai- prefix)
602
- - **Unified ax-cli Setup**: Provider selection launches provider-specific setup flows
603
- - Saves `selectedProvider` and `serverType` to config
604
- - Auto-launches correct CLI (ax-glm or ax-grok) based on selection
605
-
606
- ### v4.1.5 - Suppress dotenv Output
607
-
608
- - **Fix**: Suppress dotenv v17+ output message (`[dotenv@17.x.x] injecting env...`)
609
- - Added `{ quiet: true }` to dotenv.config() calls in cli-factory.ts and index.ts
610
-
611
- ### v4.1.4 - Provider-Aware Update Command
612
-
613
- - **Update Command**: `ax-glm update` and `ax-grok update` now check/update their own packages
614
- - `ax-glm update` checks `@defai.digital/ax-glm` (not ax-cli)
615
- - `ax-grok update` checks `@defai.digital/ax-grok` (not ax-cli)
616
- - **API Key Encryption**: Verified AES-256-GCM encryption working for all CLIs
617
- - API keys stored as `apiKeyEncrypted` with IV, salt, and auth tag
618
- - PBKDF2 with 600,000 iterations for key derivation
619
- - Machine-specific encryption tied to hostname/platform/arch
620
-
621
- ### v4.1.3 - Provider-Aware SDK
226
+ ### v4.1.13 - SDK 1.4.0 Multi-Provider Support
227
+ - **SDK 1.4.0**: Multi-provider support with ProviderContext
228
+ - `createGLMAgent()` and `createGrokAgent()` factory functions
229
+ - Provider-specific context stores and file caching
230
+ - File locking for concurrent access safety
231
+ - Provider settings management
622
232
 
623
- - **Provider-Aware SDK**: New SDK functions for provider-specific agent creation
624
- - `createGLMAgent()` - Create GLM-optimized agents with thinking mode support
625
- - `createGrokAgent()` - Create Grok-optimized agents with reasoning_effort support
626
- - `createProviderAgent()` - Generic provider-aware agent factory
627
- - **SDK Exports**: ax-glm and ax-grok packages now export SDK at `@defai.digital/ax-glm/sdk` and `@defai.digital/ax-grok/sdk`
628
- - **Provider Definitions**: Export GLM_PROVIDER, GROK_PROVIDER, and helper functions
629
- - **Error Messages**: Provider-aware error messages reference the correct CLI name (ax-glm, ax-grok)
630
- - **Doctor Command**: Verified working for all CLIs (ax-cli, ax-glm, ax-grok)
233
+ ### v4.1.12 - Figma & MCP Improvements
234
+ - Figma component instance detection (`instanceOf` field)
235
+ - Figma text style extraction (fontSize, fontFamily, fontWeight, lineHeight)
236
+ - MCP debug mode with comprehensive diagnostics
237
+ - Alias validation command with batch support
238
+ - Fixed cache invalidation for parameterized Figma API calls
631
239
 
632
- ### v4.1.2 - Setup Improvements for Provider-Specific CLIs
240
+ ### v4.1.11 - Provider Branding
241
+ - Unique ASCII logos for ax-glm and ax-grok
242
+ - Provider-specific color schemes
633
243
 
634
- - **ax-glm Setup**: Added server selection (Z.AI Cloud or Local/Custom server support)
635
- - Supports Ollama, LMStudio, vLLM, or any OpenAI-compatible endpoint
636
- - 5-step setup wizard for GLM with server selection
637
- - **ax-grok Setup**: Simplified to 4-step wizard (Grok online only, no server URL needed)
638
- - **Local Server Support**: ax-glm now works with local GLM models via custom endpoints
244
+ ### v4.1.10 - Grok Fixes
245
+ - `reasoning_effort` for Grok-3 thinking mode
246
+ - Enhanced web search parameters
247
+ - Auto-switch to grok-2-vision for images
639
248
 
640
- ### v4.1.1 - Bug Fixes for Provider-Specific CLIs
249
+ ### v4.1.9 - Setup Wizard
250
+ - Provider selection flow
251
+ - Provider-specific config directories
641
252
 
642
- - **Status Bar Fix**: CLI name now correctly displays 'ax-glm' or 'ax-grok' instead of hardcoded 'ax-cli'
643
- - **Thinking Mode Fix**: Synced LLM client with original ax-cli v4.0.2 logic for proper GLM thinking mode handling
644
- - **CI/CD Improvements**: Fixed publish workflow, Zod v4 compatibility, ES2023 target support
645
-
646
- ### v4.1.0 - Provider-Specific CLIs (Monorepo Architecture)
647
-
648
- Major release introducing provider-specific CLI packages:
649
-
650
- - **New Packages**:
651
- - `@defai.digital/ax-glm` - GLM-optimized CLI for Z.AI models (GLM-4.6, GLM-4.5v)
652
- - `@defai.digital/ax-grok` - Grok-optimized CLI for xAI models (Grok 3, Grok 3 Mini)
653
- - `@defai.digital/ax-core` - Shared core functionality for all CLI variants
654
- - **Monorepo Architecture**: Unified codebase with pnpm workspaces for better maintainability
655
- - **Lightweight Options**: Provider-specific CLIs with minimal dependencies for focused use cases
656
- - **Shared Core**: All packages share the same tools, MCP integration, and enterprise features
657
-
658
- ### v4.0.5 - SDK Data Mutation Bug Fixes
659
-
660
- - **Event Isolation**: Progress reporter and logger now emit separate object copies
661
- - **Tool Registry**: Clones definitions, tags, and execution args to prevent external mutation
662
- - **Testing Utilities**: MockAgent, MockMCPServer, MockSettingsManager now return deep copies
663
- - **Agent Lifecycle**: Double disposal guard, non-Error throwable handling, subagent config isolation
664
-
665
- ### v4.0.4 - VS Code Extension & SDK Bug Fixes
666
-
667
- - VS Code extension: IPC timeout handling, memory leak fixes, cross-platform path handling
668
- - SDK: Multiple agent cleanup, version parsing improvements, testing utility fixes
669
-
670
- ### v4.0.0 - Tool System v3.0
671
-
672
- - Rich tool definitions with 500+ word descriptions, usage notes, and anti-patterns
673
- - Format generators for OpenAI/Anthropic from single source of truth
674
- - Result enhancer with malware detection and sensitive data warnings
675
-
676
- ### Earlier Versions
677
-
678
- For complete changelog history, see [GitHub Releases](https://github.com/defai-digital/ax-cli/releases).
253
+ [View all releases](https://github.com/defai-digital/ax-cli/releases)
679
254
 
680
255
  ---
681
256
 
682
257
  ## Documentation
683
258
 
684
- | Guide | Description |
685
- |-------|-------------|
686
- | [Features](docs/features.md) | Complete feature list |
687
- | [Installation](docs/installation.md) | Detailed installation guide |
688
- | [Configuration](docs/configuration.md) | Configuration options |
689
- | [Usage](docs/usage.md) | Comprehensive usage guide |
690
- | [CLI Reference](docs/cli-reference.md) | Command-line reference |
691
- | [VSCode Integration](docs/vscode-integration-guide.md) | VSCode extension & terminal setup |
692
- | [MCP Integration](docs/mcp.md) | Model Context Protocol guide |
693
- | [Figma Integration](docs/figma-guide.md) | Design-to-code workflow with Figma |
694
- | [Architecture](docs/architecture.md) | Technical architecture |
695
- | [Troubleshooting](docs/troubleshooting.md) | Common issues |
259
+ - [Features](docs/features.md)
260
+ - [Configuration](docs/configuration.md)
261
+ - [CLI Reference](docs/cli-reference.md)
262
+ - [MCP Integration](docs/mcp.md)
263
+ - [VSCode Guide](docs/vscode-integration-guide.md)
264
+ - [Figma Integration](docs/figma-guide.md)
265
+ - [Troubleshooting](docs/troubleshooting.md)
696
266
 
697
267
  ---
698
268
 
699
- ## Enterprise Features
269
+ ## Enterprise
700
270
 
701
271
  For teams requiring advanced capabilities:
702
272
 
703
- - **Compliance Reports** - SOC2, HIPAA, PCI-DSS
704
- - **Advanced Audit Logging** - Tamper-proof with 1+ year retention
705
- - **Team Collaboration** - Shared history with full-text search
706
- - **Policy Enforcement** - Approval workflows
707
- - **SSO/SAML** - Enterprise identity provider support
708
- - **Priority Support** - 24-hour SLA
273
+ - Compliance reports (SOC2, HIPAA)
274
+ - Advanced audit logging
275
+ - SSO/SAML integration
276
+ - Priority support (24-hour SLA)
709
277
 
710
278
  Contact: **sales@defai.digital**
711
279
 
712
280
  ---
713
281
 
714
- ## Acknowledgments
715
-
716
- This project was inspired by and partially based on [grok-cli](https://github.com/superagent-ai/grok-cli). Thanks to the original authors for their open-source contributions.
717
-
718
- ### AI Co-Authors
719
-
720
- This project is developed with assistance from multiple AI coding assistants:
721
-
722
- - [AutomatosX](https://github.com/defai-digital/automatosx) - AI agent orchestration platform
723
- - [Claude](https://github.com/claude) - Anthropic's AI assistant
724
- - [Gemini CLI](https://github.com/google-gemini/gemini-cli) - Google's AI coding assistant
725
- - [Codex](https://github.com/openai/codex) - OpenAI's code generation model
726
-
727
- ---
728
-
729
282
  ## License
730
283
 
731
- MIT License - see [LICENSE](LICENSE) for details.
284
+ MIT License - see [LICENSE](LICENSE)
732
285
 
733
286
  ---
734
287
 
735
288
  <p align="center">
736
289
  Made with ❤️ by <a href="https://github.com/defai-digital">DEFAI Digital</a>
737
290
  </p>
738
-
739
-