@defai.digital/ax-cli 3.6.0 → 3.6.1

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 (104) hide show
  1. package/.ax-cli/checkpoints/2025-11-20/checkpoint-11e9e0ba-c39d-4fd2-aa77-bc818811c921.json +69 -0
  2. package/.ax-cli/checkpoints/2025-11-20/checkpoint-2b260b98-b418-4c7c-9694-e2b94967e662.json +24 -0
  3. package/.ax-cli/checkpoints/2025-11-20/checkpoint-7e03601e-e8ab-4cd7-9841-a74b66adf78f.json +69 -0
  4. package/.ax-cli/checkpoints/2025-11-20/checkpoint-7f9c6562-771f-4fd0-adcf-9e7e9ac34ae8.json +44 -0
  5. package/.ax-cli/checkpoints/2025-11-20/checkpoint-e1ebe666-4c3a-4367-ba5c-27fe512a9c70.json +24 -0
  6. package/.ax-cli/checkpoints/2025-11-21/checkpoint-15743e7d-430c-4d76-b6fc-955d7a5c250c.json +44 -0
  7. package/.ax-cli/checkpoints/2025-11-21/checkpoint-25cf7679-0b3f-4988-83d7-704548fbba91.json +69 -0
  8. package/.ax-cli/checkpoints/2025-11-21/checkpoint-54aedbac-6db0-464e-8ebb-dbb3979e6dca.json +24 -0
  9. package/.ax-cli/checkpoints/2025-11-21/checkpoint-7658aed8-fe5d-4222-903f-1a7c63717ea7.json +24 -0
  10. package/.ax-cli/checkpoints/2025-11-21/checkpoint-c9c13497-40dc-4294-a327-6a5fc854eaa1.json +69 -0
  11. package/.ax-cli/memory.json +8 -1
  12. package/README.md +423 -89
  13. package/ax.config.json +333 -0
  14. package/dist/analyzers/code-smells/detectors/data-clumps-detector.js +7 -9
  15. package/dist/analyzers/code-smells/detectors/data-clumps-detector.js.map +1 -1
  16. package/dist/analyzers/code-smells/detectors/dead-code-detector.js +1 -1
  17. package/dist/analyzers/code-smells/detectors/dead-code-detector.js.map +1 -1
  18. package/dist/analyzers/code-smells/detectors/duplicate-code-detector.js +22 -10
  19. package/dist/analyzers/code-smells/detectors/duplicate-code-detector.js.map +1 -1
  20. package/dist/analyzers/code-smells/detectors/feature-envy-detector.js +1 -1
  21. package/dist/analyzers/code-smells/detectors/feature-envy-detector.js.map +1 -1
  22. package/dist/analyzers/code-smells/detectors/inappropriate-intimacy-detector.js +1 -1
  23. package/dist/analyzers/code-smells/detectors/inappropriate-intimacy-detector.js.map +1 -1
  24. package/dist/analyzers/code-smells/detectors/large-class-detector.js +4 -1
  25. package/dist/analyzers/code-smells/detectors/large-class-detector.js.map +1 -1
  26. package/dist/analyzers/code-smells/detectors/long-method-detector.js +4 -1
  27. package/dist/analyzers/code-smells/detectors/long-method-detector.js.map +1 -1
  28. package/dist/analyzers/code-smells/detectors/long-parameter-list-detector.js +4 -1
  29. package/dist/analyzers/code-smells/detectors/long-parameter-list-detector.js.map +1 -1
  30. package/dist/analyzers/code-smells/detectors/magic-numbers-detector.js +4 -5
  31. package/dist/analyzers/code-smells/detectors/magic-numbers-detector.js.map +1 -1
  32. package/dist/analyzers/code-smells/detectors/nested-conditionals-detector.js +4 -1
  33. package/dist/analyzers/code-smells/detectors/nested-conditionals-detector.js.map +1 -1
  34. package/dist/hooks/use-chat-reducer.d.ts +61 -0
  35. package/dist/hooks/use-chat-reducer.js +118 -0
  36. package/dist/hooks/use-chat-reducer.js.map +1 -0
  37. package/dist/hooks/use-enhanced-input.d.ts +40 -0
  38. package/dist/hooks/use-enhanced-input.js +249 -0
  39. package/dist/hooks/use-enhanced-input.js.map +1 -0
  40. package/dist/hooks/use-input-handler.d.ts +46 -0
  41. package/dist/hooks/use-input-handler.js +1430 -0
  42. package/dist/hooks/use-input-handler.js.map +1 -0
  43. package/dist/hooks/use-input-history.d.ts +9 -0
  44. package/dist/hooks/use-input-history.js +112 -0
  45. package/dist/hooks/use-input-history.js.map +1 -0
  46. package/dist/index.js +0 -0
  47. package/dist/index.js.bak +664 -0
  48. package/dist/schemas/settings-schemas.d.ts +23 -0
  49. package/dist/schemas/settings-schemas.js +17 -0
  50. package/dist/schemas/settings-schemas.js.map +1 -1
  51. package/dist/tools/web-search/index.d.ts +0 -2
  52. package/dist/tools/web-search/index.js +0 -2
  53. package/dist/tools/web-search/index.js.map +1 -1
  54. package/dist/tools/web-search/router.d.ts +0 -2
  55. package/dist/tools/web-search/router.js +2 -37
  56. package/dist/tools/web-search/router.js.map +1 -1
  57. package/dist/tools/web-search/web-search-tool.js +2 -12
  58. package/dist/tools/web-search/web-search-tool.js.map +1 -1
  59. package/dist/ui/components/chat-input.d.ts +4 -1
  60. package/dist/ui/components/chat-input.js +133 -52
  61. package/dist/ui/components/chat-input.js.map +1 -1
  62. package/dist/ui/components/chat-interface.js +2 -2
  63. package/dist/ui/components/chat-interface.js.map +1 -1
  64. package/dist/ui/components/keyboard-hints.js +2 -0
  65. package/dist/ui/components/keyboard-hints.js.map +1 -1
  66. package/dist/ui/components/status-bar.js +1 -11
  67. package/dist/ui/components/status-bar.js.map +1 -1
  68. package/dist/ui/components/welcome-panel.js +4 -0
  69. package/dist/ui/components/welcome-panel.js.map +1 -1
  70. package/dist/ui/hooks/use-enhanced-input.d.ts +4 -0
  71. package/dist/ui/hooks/use-enhanced-input.js +119 -9
  72. package/dist/ui/hooks/use-enhanced-input.js.map +1 -1
  73. package/dist/ui/hooks/use-input-handler.d.ts +2 -0
  74. package/dist/ui/hooks/use-input-handler.js +15 -3
  75. package/dist/ui/hooks/use-input-handler.js.map +1 -1
  76. package/dist/utils/audit-logger.d.ts +28 -70
  77. package/dist/utils/audit-logger.js +30 -135
  78. package/dist/utils/audit-logger.js.map +1 -1
  79. package/dist/utils/paste-collapse.d.ts +46 -0
  80. package/dist/utils/paste-collapse.js +77 -0
  81. package/dist/utils/paste-collapse.js.map +1 -0
  82. package/dist/utils/paste-utils.d.ts +99 -0
  83. package/dist/utils/paste-utils.js +239 -0
  84. package/dist/utils/paste-utils.js.map +1 -0
  85. package/dist/utils/rate-limiter.d.ts +15 -1
  86. package/dist/utils/rate-limiter.js +15 -1
  87. package/dist/utils/rate-limiter.js.map +1 -1
  88. package/package.json +3 -7
  89. package/packages/schemas/dist/index.d.ts +14 -0
  90. package/packages/schemas/dist/index.d.ts.map +1 -0
  91. package/packages/schemas/dist/index.js +19 -0
  92. package/packages/schemas/dist/index.js.map +1 -0
  93. package/packages/schemas/dist/public/core/brand-types.d.ts +308 -0
  94. package/packages/schemas/dist/public/core/brand-types.d.ts.map +1 -0
  95. package/packages/schemas/dist/public/core/brand-types.js +243 -0
  96. package/packages/schemas/dist/public/core/brand-types.js.map +1 -0
  97. package/packages/schemas/dist/public/core/enums.d.ts +227 -0
  98. package/packages/schemas/dist/public/core/enums.d.ts.map +1 -0
  99. package/packages/schemas/dist/public/core/enums.js +222 -0
  100. package/packages/schemas/dist/public/core/enums.js.map +1 -0
  101. package/packages/schemas/dist/public/core/id-types.d.ts +286 -0
  102. package/packages/schemas/dist/public/core/id-types.d.ts.map +1 -0
  103. package/packages/schemas/dist/public/core/id-types.js +136 -0
  104. package/packages/schemas/dist/public/core/id-types.js.map +1 -0
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # AX CLI - Enterprise-Class GLM AI CLI
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-1036%20passing-brightgreen?style=flat-square)](https://github.com/defai-digital/ax-cli/actions/workflows/test.yml)
4
+ [![Tests](https://img.shields.io/badge/tests-1381%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
7
  [![Node.js Version](https://img.shields.io/badge/node-%3E%3D24.0.0-blue?style=flat-square)](https://nodejs.org/)
@@ -75,20 +75,38 @@ ax-cli
75
75
  - Configure chat and coding models separately
76
76
  - Manual model switching with `--chat-mode` flag
77
77
  - Optimize cost and performance for different task types
78
- - **🌐 Web Search** (NEW in v3.4.0): Real-time internet search capabilities
79
- - Integrated Tavily AI (AI-optimized search) and Brave Search
80
- - Intelligent query routing based on intent detection
81
- - Results caching for faster responses and reduced API costs
82
- - Support for technical docs, code examples, news, and general queries
83
- - Configurable search depth and freshness filters
78
+ - **🌐 Web Search** (NEW in v3.4.0): Real-time package search capabilities
79
+ - **Works out-of-the-box**: npm, PyPI, and crates.io package search (no API keys required)
80
+ - **Intelligent routing**: Automatically selects the best engine based on query intent
81
+ - JavaScript/Node.js packages npm registry search
82
+ - Python packages PyPI registry search
83
+ - Rust packages crates.io registry search
84
+ - Results caching for faster responses (5 minute TTL)
85
+ - Support for package discovery, dependency research, and version information
86
+ - Session-based context for iterative package exploration
84
87
  - **🔄 Auto-Update**: Built-in update checker and installer
85
- - **🔒 Enterprise Security** (NEW in v3.6.0): Optional hardening features for enterprise deployments
86
- - **Automatic API Key Encryption**: AES-256-GCM encryption at rest (transparent migration)
87
- - **Optional Command Whitelist**: Restrict bash commands to safe list (disabled by default)
88
- - **Optional SSRF Protection**: Validate MCP transport URLs (disabled by default)
89
- - **Optional Error Sanitization**: Remove sensitive data from error messages (disabled by default)
90
- - **117 security tests** with 98%+ coverage
91
- - **User-friendly defaults**: Full functionality for 95% of users, opt-in hardening for enterprise
88
+ - **🔒 Enterprise-Grade Security** (NEW in v3.6.0): **FREE & Open Source**
89
+ - **Command Injection Protection**: CVSS 9.8 CRITICAL fix - Safe command execution with whitelisting
90
+ - **Path Traversal Hardening**: CVSS 8.6 HIGH fix - Prevent unauthorized file system access
91
+ - **SSRF Attack Prevention**: CVSS 7.5 HIGH fix - Validate MCP transport URLs and block private IPs
92
+ - **Input Sanitization**: CVSS 7.0 HIGH fix - Comprehensive input validation and sanitization
93
+ - **Error Sanitization**: CVSS 6.5 MEDIUM fix - Prevent sensitive data leakage in error messages
94
+ - **API Key Encryption**: AES-256-GCM encryption at rest with automatic migration
95
+ - **Memory Leak Fixes**: Process pool management for long-running operations
96
+ - **Security Audit Logging**: Basic JSON logging with 30-day retention
97
+ - **Rate Limiting**: Token bucket algorithm to prevent API abuse (100 req/min)
98
+ - **1381+ tests passing** with **98.29% coverage** - Production-ready security
99
+ - **User-friendly defaults**: Full functionality with enterprise-grade security for everyone
100
+ - **🏢 Enterprise Features**: Advanced capabilities for teams and compliance
101
+ - **Compliance Report Generation**: SOC2, HIPAA, PCI-DSS automated reporting
102
+ - **Advanced Audit Logging**: Tamper-proof encrypted logs with hash chains and extended retention (1+ years)
103
+ - **Real-time Security Dashboards**: Monitor security events, anomalies, and compliance status
104
+ - **Advanced Rate Limiting**: Custom quotas per user/team/project with cost analytics and budget alerts
105
+ - **Team Collaboration**: Shared chat history with full-text search and multi-format export
106
+ - **Policy Enforcement**: Tool execution policies, approval workflows, and usage analytics
107
+ - **SSO/SAML Integration**: Enterprise identity provider support
108
+ - **Priority Support**: 24-hour SLA email support
109
+ - 📧 **Contact sales@defai.digital** for enterprise licensing and pricing
92
110
  - **📊 Advanced Code Analysis** (NEW in v2.4.0): Professional-grade static analysis tools
93
111
  - **Dependency Analyzer**: Detect circular dependencies, calculate coupling metrics, identify orphan and hub files
94
112
  - **Code Smell Detector**: Find 10+ anti-patterns (long methods, large classes, duplicates, dead code, etc.)
@@ -134,7 +152,7 @@ AX CLI officially supports the following platforms:
134
152
  ### Prerequisites
135
153
 
136
154
  - Node.js 24.0.0 or higher
137
- - npm or bun package manager
155
+ - npm package manager
138
156
 
139
157
  ### Global Installation (Recommended)
140
158
 
@@ -148,20 +166,37 @@ npm install -g @defai.digital/ax-cli
148
166
 
149
167
  ### Quick Setup
150
168
 
169
+ The recommended way to configure AX CLI is using the interactive setup wizard:
170
+
151
171
  ```bash
152
- # Set your API key (for cloud providers)
153
- export YOUR_API_KEY=your_api_key_here
172
+ # Run the setup wizard (recommended)
173
+ ax-cli setup
174
+
175
+ # This will:
176
+ # 1. Guide you through provider selection (Z.AI, OpenAI, Anthropic, Ollama, etc.)
177
+ # 2. Securely encrypt and store your API key (AES-256-GCM encryption)
178
+ # 3. Configure default model and settings
179
+ # 4. Validate your configuration
180
+ ```
154
181
 
155
- # Or configure in settings
156
- ax-cli # Will prompt for API key on first run
182
+ **Alternative: Environment Variable Override**
183
+
184
+ For CI/CD pipelines or temporary overrides, you can set an environment variable:
185
+
186
+ ```bash
187
+ # Override API key temporarily (not recommended for daily use)
188
+ export YOUR_API_KEY=your_api_key_here
189
+ ax-cli
157
190
  ```
158
191
 
192
+ **⚠️ 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.
193
+
159
194
  ### Configuration Files
160
195
 
161
- - **User Settings**: `~/.ax-cli/config.json`
162
- - **Project Settings**: `.ax-cli/settings.json`
163
- - **Custom Instructions**: `.ax-cli/CUSTOM.md`
164
- - **Project Memory**: `.ax-cli/memory.json` (auto-generated)
196
+ - **User Settings**: `~/.ax-cli/config.json` (API keys are encrypted)
197
+ - **Project Settings**: `.ax-cli/settings.json` (project-specific overrides)
198
+ - **Custom Instructions**: `.ax-cli/CUSTOM.md` (AI behavior customization)
199
+ - **Project Memory**: `.ax-cli/memory.json` (auto-generated context cache)
165
200
 
166
201
  [Configuration Guide →](docs/configuration.md)
167
202
 
@@ -366,17 +401,43 @@ ax-cli usage reset
366
401
 
367
402
  ## 📋 Working with Large Content
368
403
 
369
- When working with large amounts of text (logs, code files, documentation), use **file-based workflows** instead of pasting directly into the terminal.
404
+ AX CLI has **intelligent paste handling** that automatically manages large text inputs for better readability.
405
+
406
+ ### 📝 Smart Paste Auto-Collapse
407
+
408
+ When you paste **20+ lines** of text, AX CLI automatically collapses it:
370
409
 
371
- ### ⚠️ Terminal Paste Limitations
410
+ - **Automatic Detection**: Pastes with 20+ lines are auto-collapsed
411
+ - ✅ **Clean Display**: Shows `[Pasted text #1 +89 lines]` instead of cluttering the UI
412
+ - ✅ **Full Submission**: Complete text is still sent to the AI (not just the placeholder)
413
+ - ✅ **Review Anytime**: Press **Ctrl+P** on a collapsed block to expand/collapse
414
+
415
+ **Example:**
416
+ ```bash
417
+ # Paste a 100-line error log
418
+ # → Shows: [Pasted text #1 +100 lines]
419
+ # → AI receives: Full 100 lines
420
+
421
+ # Position cursor on placeholder and press Ctrl+P to review
422
+ # → Expands to show all 100 lines
423
+ ```
424
+
425
+ **Configure in `~/.ax-cli/config.json`:**
426
+ ```json
427
+ {
428
+ "paste": {
429
+ "autoCollapse": true, // Enable/disable (default: true)
430
+ "collapseThreshold": 20 // Min lines to collapse (default: 20)
431
+ }
432
+ }
433
+ ```
372
434
 
373
- **Avoid pasting large content directly** into the interactive terminal:
435
+ ### ⚠️ Character Counter Warning
374
436
 
375
- - **DON'T**: Paste large code files, logs, or documents (>2000 characters)
376
- - ⚠️ Some terminals may have paste limitations
377
- - ⚠️ Character counter shows visual warning: Gray (0-999) → Cyan (1000-1599) → Yellow (1600-1999) → **Red (2000+)**
437
+ The character counter shows visual warnings for very large single inputs:
438
+ - Gray (0-999) Cyan (1000-1599) Yellow (1600-1999) → **Red (2000+)**
378
439
 
379
- ### ✅ Recommended Approaches
440
+ ### ✅ Alternative Approaches for Extremely Large Content
380
441
 
381
442
  **Option 1: File Reference (Interactive Mode)**
382
443
  ```bash
@@ -448,7 +509,9 @@ Use different models for chat vs coding tasks to optimize performance and cost:
448
509
 
449
510
  ### Configuration
450
511
 
451
- Add to `~/.ax-cli/config.json` or `.ax-cli/settings.json`:
512
+ **Option 1: Project Settings** (recommended for project-specific preferences)
513
+
514
+ Add to `.ax-cli/settings.json` in your project directory:
452
515
 
453
516
  ```json
454
517
  {
@@ -460,6 +523,8 @@ Add to `~/.ax-cli/config.json` or `.ax-cli/settings.json`:
460
523
  }
461
524
  ```
462
525
 
526
+ **Option 2: Environment Variables** (for temporary or CI/CD use)
527
+
463
528
  ### Usage
464
529
 
465
530
  ```bash
@@ -491,70 +556,66 @@ ax-cli --chat-mode
491
556
 
492
557
  ## 🌐 Web Search (NEW)
493
558
 
494
- Search the internet for real-time information, documentation, code examples, and current events.
559
+ Search package registries for JavaScript, Python, and Rust packages with intelligent language detection and cross-registry comparison.
495
560
 
496
561
  ### ✨ Works Out of the Box!
497
562
 
498
- **npm package search is enabled by default** (no API key required). For enhanced web search capabilities, optionally configure Tavily AI or Brave Search.
563
+ **Package search is enabled by default** (no API key required):
564
+ - **npm** - JavaScript/Node.js packages from npmjs.com
565
+ - **PyPI** - Python packages from pypi.org
566
+ - **crates.io** - Rust packages from crates.io
499
567
 
500
568
  ### Quick Setup
501
569
 
502
- **Option 1: Use npm Search Only** (Default - No Setup Required)
503
- - npm package search works immediately
504
- - Perfect for JavaScript/TypeScript development
570
+ **No setup required!** Package search works immediately:
571
+ - **npm** - JavaScript/Node.js packages work immediately
572
+ - **PyPI** - Python packages work immediately
573
+ - **crates.io** - Rust packages work immediately
574
+ - Perfect for package discovery and dependency management
505
575
  - No API keys needed
506
576
 
507
- **Option 2: Add Enhanced Web Search** (Optional)
508
- 1. **Get API Keys** (choose one or both):
509
- - **Tavily AI** (recommended): https://tavily.com/
510
- - Free tier: 1,000 searches/month
511
- - Best for: AI-optimized general search, technical queries
512
- - **Brave Search**: https://brave.com/search/api/
513
- - Free tier: 2,000 searches/month
514
- - Best for: News, current events, privacy-focused
515
-
516
- 2. **Configure API Keys**:
517
-
518
- ```bash
519
- # Add to ~/.bashrc, ~/.zshrc, or .env (OPTIONAL)
520
- export TAVILY_API_KEY="your_tavily_api_key"
521
- export BRAVE_API_KEY="your_brave_api_key"
522
- ```
523
-
524
577
  ### Usage
525
578
 
526
579
  ```bash
527
580
  # The AI will automatically use web search when needed
528
581
  ax-cli
529
582
 
530
- > "Find a React state management library" # Uses npm search
531
- > "Search for axios npm package" # Uses npm search
532
- > "What are the latest TypeScript features?" # Uses Tavily/Brave (if configured)
533
- > "Latest security news" # Uses Brave (if configured)
583
+ > "Find a React state management library" # Uses npm search
584
+ > "Search for axios npm package" # Uses npm search
585
+ > "Find a Python data analysis library" # Uses PyPI search
586
+ > "Search for tokio rust crate" # Uses crates.io search
534
587
  ```
535
588
 
536
589
  ### How It Works
537
590
 
538
- - **Intelligent Routing**: Automatically selects the best search engine based on query type
539
- - **Package queries** → npm search (always available, no API key)
540
- - **Technical queries** → Tavily (if configured) or npm fallback
541
- - **News queries** → Brave (if configured) or npm fallback
542
- - **General queries** → Tavily (if configured) or npm fallback
591
+ - **Intelligent Routing**: Automatically selects the best search engine based on query type and language detection
592
+ - **JavaScript/Node.js packages** → npm registry search (always available, no API key)
593
+ - **Python packages** → PyPI registry search (always available, no API key)
594
+ - **Rust packages** → crates.io registry search (always available, no API key)
595
+ - **General/technical queries** → package search fallback
596
+
597
+ - **Language Detection**: Automatically detects programming language from keywords
598
+ - Python keywords (pip, django, flask, pandas) → PyPI
599
+ - Rust keywords (cargo, crate, tokio, serde) → crates.io
600
+ - npm/package keywords → npm registry
601
+ - Multiple engines may be used in parallel for best results
543
602
 
544
- - **Automatic Caching**: Results cached for 5 minutes to reduce API costs
603
+ - **Automatic Caching**: Results cached for 5 minutes for faster subsequent queries
545
604
 
546
- - **LLM Integration**: The AI decides when to search based on:
547
- - Real-time information needs
548
- - Documentation lookups
549
- - Current events
550
- - Questions beyond training data
605
+ - **LLM Integration**: The AI automatically uses package search for:
606
+ - Package discovery and dependency management
607
+ - Version compatibility checks
608
+ - Alternative package recommendations
609
+ - Package documentation and usage information
551
610
 
552
611
  ### Features
553
612
 
554
- - **Search Depth**: `basic` (faster) or `advanced` (comprehensive)
555
- - **Freshness Filters**: `day`, `week`, `month`, or `year`
556
- - **AI Summaries**: Automatic answer generation from search results
613
+ - **Multi-Registry Package Search**: Search across npm, PyPI, and crates.io simultaneously
614
+ - Package metadata, descriptions, and download statistics
615
+ - Version information and release dates
616
+ - No API keys or setup required
557
617
  - **Source Attribution**: All results include URLs and sources
618
+ - **Parallel Search**: Multiple engines searched concurrently for comprehensive results
558
619
 
559
620
  ### Manual Usage
560
621
 
@@ -562,36 +623,253 @@ While the AI uses web search automatically, you can also request it explicitly:
562
623
 
563
624
  ```bash
564
625
  # In interactive mode
565
- > "search the web for Next.js 14 server actions tutorial"
626
+ > "search npm for a markdown parser library"
627
+ > "search PyPI for a web scraping package"
628
+ > "search crates.io for async runtime"
566
629
 
567
630
  # Headless mode
568
- ax-cli -p "search for latest Node.js LTS security updates"
631
+ ax-cli -p "search for react-query npm package"
632
+ ax-cli -p "find a Python FastAPI alternative"
569
633
  ```
570
634
 
571
- ### Costs (Optional - Free Tier Available)
635
+ ### Web Search Session
636
+
637
+ AX CLI maintains intelligent search context across your conversation, enabling natural follow-up questions and iterative refinement:
572
638
 
573
- Both services offer generous free tiers:
639
+ **Session Continuity:**
640
+ - Package search results are preserved in conversation context
641
+ - Ask follow-up questions about packages without re-searching
642
+ - Reference previous search results naturally
643
+ - Session context includes package URLs, metadata, versions, and download stats
574
644
 
575
- | Service | Free Tier | Paid Tier |
576
- |---------|-----------|-----------|
577
- | Tavily AI | 1,000/month | $120/month (10K searches) |
578
- | Brave Search | 2,000/month | $3/1,000 queries |
579
- | **Combined** | **~3,000/month FREE** | **~$150/month (20K total)** |
645
+ **Example Session:**
580
646
 
581
- **Recommendation**: Start with free tiers (sufficient for most users). Only upgrade if you exceed limits.
647
+ ```bash
648
+ ax-cli
649
+
650
+ # Initial package search
651
+ > "search npm for a state management library"
652
+ 🔍 Searching npm registry...
653
+ Found 5 packages:
654
+
655
+ 1. **zustand** (2.5M weekly downloads)
656
+ Small, fast and scalable state-management
657
+ Latest: v4.4.7 | Size: 1.2KB gzipped
658
+
659
+ 2. **redux** (8.1M weekly downloads)
660
+ Predictable state container for JavaScript apps
661
+ Latest: v5.0.0 | Size: 6.2KB (core only)
662
+
663
+ 3. **mobx** (1.2M weekly downloads)
664
+ Simple, scalable state management
665
+ Latest: v6.12.0 | Size: 16KB
666
+ ...
667
+
668
+ # Natural follow-up (uses cached context from npm search)
669
+ > "which one has the smallest bundle size?"
670
+ Based on the npm search results:
671
+ - ✅ zustand: 1.2KB (gzipped) - Smallest
672
+ - jotai: 2.9KB (gzipped)
673
+ - redux: 6.2KB (core only)
674
+ - mobx: 16KB
675
+
676
+ # Version and compatibility check
677
+ > "what's the latest version of zustand and does it support React 18?"
678
+ Package: zustand v4.4.7 (latest)
679
+ ✅ Full React 18 support with concurrent features
680
+ ✅ TypeScript 5.0+ support
681
+ 📅 Last published: 2 weeks ago
682
+
683
+ # Installation guide
684
+ > "show me how to install and use zustand"
685
+ Installation:
686
+ npm install zustand
687
+
688
+ Basic usage:
689
+ [Provides code example from npm documentation]
690
+ ```
691
+
692
+ **Context-Aware Features:**
693
+
694
+ 1. **Result Caching**: Package search results stay in memory for the session
695
+ - 5-minute cache for identical queries
696
+ - Instant responses for follow-up questions about packages
697
+ - No repeated API calls to registries
698
+
699
+ 2. **Multi-Turn Package Refinement**:
700
+ ```bash
701
+ > "search npm for a react table library"
702
+ Found: tanstack-table, react-table, ag-grid-react, mui-x-data-grid
703
+
704
+ > "which ones have TypeScript support?"
705
+ All 4 packages support TypeScript:
706
+ - @tanstack/react-table: Full TS rewrite
707
+ - react-table (deprecated, use @tanstack)
708
+ - ag-grid-react: TypeScript included
709
+ - @mui/x-data-grid: Full TS support
710
+
711
+ > "which has the best documentation?"
712
+ Based on npm stats and GitHub stars:
713
+ - @tanstack/react-table: Excellent docs, 24K stars
714
+
715
+ > "install that one"
716
+ npm install @tanstack/react-table
717
+ ```
718
+
719
+ 3. **Cross-Registry Context**:
720
+ ```bash
721
+ > "search for data validation libraries"
722
+ Searching npm, PyPI, and crates.io...
723
+
724
+ npm: zod, yup, joi, ajv
725
+ PyPI: pydantic, marshmallow, cerberus
726
+ crates.io: serde, validator
727
+
728
+ > "compare the JavaScript and Python options"
729
+ **JavaScript (npm):**
730
+ - zod: 3.5M/week, TypeScript-first, 30KB
731
+ - yup: 5.2M/week, Schema builder, 45KB
732
+
733
+ **Python (PyPI):**
734
+ - pydantic: 50M/month, Type hints, fast
735
+ - marshmallow: 8M/month, Schema validation
736
+
737
+ > "which is fastest?"
738
+ - JavaScript: zod (TypeScript inference, zero-cost)
739
+ - Python: pydantic (uses Rust core, 20x faster than marshmallow)
740
+ ```
741
+
742
+ 4. **Package Comparison Tables**:
743
+ ```bash
744
+ > "search npm for http client libraries"
745
+ Found: axios, node-fetch, got, ky, superagent
746
+
747
+ > "create a comparison table"
748
+
749
+ | Package | Weekly DLs | Size | Last Update | Browser | Node |
750
+ |-------------|------------|---------|-------------|---------|------|
751
+ | axios | 48M | 11.5KB | 2 weeks ago | ✅ | ✅ |
752
+ | node-fetch | 35M | 4.5KB | 3 months | ❌ | ✅ |
753
+ | got | 23M | 15KB | 1 week ago | ❌ | ✅ |
754
+ | ky | 1.2M | 12KB | 2 weeks ago | ✅ | ✅ |
755
+
756
+ > "which is best for Node.js backend with retry logic?"
757
+ Recommendation: **got**
758
+ - Built-in retry with exponential backoff
759
+ - HTTP/2 support
760
+ - Request cancellation
761
+ - Promise & stream support
762
+ ```
763
+
764
+ **Session Management:**
765
+
766
+ - **Session Duration**: Active for entire interactive session
767
+ - **History Integration**: Search results included in `--continue` sessions
768
+ - **Memory Commands**:
769
+ ```bash
770
+ /clear # Clears search context and conversation
771
+ /exit # Ends session (context lost)
772
+ ```
773
+ - **Persistent Context**: Use with `--continue` to maintain search context across sessions
774
+
775
+ **Best Practices:**
776
+
777
+ 1. **Start Broad, Refine Iteratively**:
778
+ ```bash
779
+ > "search npm for testing libraries"
780
+ Found: jest, vitest, mocha, jasmine, playwright, cypress
781
+
782
+ > "focus on those for integration testing"
783
+ Integration testing: playwright, cypress, vitest (has browser mode)
784
+
785
+ > "which has TypeScript support?"
786
+ All 3 have TypeScript:
787
+ - playwright: Native TS
788
+ - cypress: Full TS support
789
+ - vitest: Native TS (Vite-powered)
790
+
791
+ > "show setup for playwright"
792
+ npm install -D @playwright/test
793
+ [Provides example config and test]
794
+ ```
795
+
796
+ 2. **Leverage Context for Framework Comparisons**:
797
+ ```bash
798
+ > "search npm for react vue svelte packages"
799
+ Found core packages with download stats:
800
+ - react: 22M/week
801
+ - vue: 5.1M/week
802
+ - svelte: 850K/week
803
+
804
+ > "compare their package ecosystems"
805
+ **React:** 180K+ packages
806
+ **Vue:** 45K+ packages
807
+ **Svelte:** 8K+ packages
808
+
809
+ > "which has better TypeScript support?"
810
+ All have excellent TS support:
811
+ - React: @types/react (20M/week)
812
+ - Vue: Built-in TS (Vue 3+)
813
+ - Svelte: svelte-check + TypeScript plugin
814
+ ```
815
+
816
+ 3. **Version Compatibility Checks**:
817
+ ```bash
818
+ > "search npm for next auth package"
819
+ Found: next-auth (8M/week, v4.24.5)
820
+
821
+ > "does it work with Next.js 15?"
822
+ ⚠️ Compatibility:
823
+ - next-auth v4: Next.js 12-14
824
+ - For Next.js 15: Use NextAuth.js v5 (beta)
825
+
826
+ > "show me the v5 package"
827
+ Package: next-auth@beta (v5.0.0-beta.4)
828
+ ✅ Next.js 15 compatible
829
+ [Installation and migration guide]
830
+ ```
831
+
832
+ 4. **Combine Search with Development Tasks**:
833
+ ```bash
834
+ > "search npm for a markdown parser library"
835
+ Found: marked, remark, markdown-it, showdown
836
+
837
+ > "which is fastest and most secure?"
838
+ Recommendation: **marked**
839
+ - 13M/week downloads
840
+ - Fast (built-in sanitization)
841
+ - Active maintenance
842
+
843
+ > "install marked and show me basic usage"
844
+ Installing: npm install marked
845
+ [Generates code example with marked usage]
846
+
847
+ > "add it to my project"
848
+ [Creates/updates relevant files with implementation]
849
+ ```
850
+
851
+ **Performance Tips:**
852
+
853
+ - **First search**: 1-3 seconds (registry API call)
854
+ - **Follow-up questions**: Instant (uses cached package data)
855
+ - **Cache duration**: 5 minutes per query
856
+ - **Parallel searches**: Multiple registries searched concurrently for cross-language queries
857
+ - **Offline work**: Use `--continue` to preserve search context across sessions
582
858
 
583
859
  ### Troubleshooting
584
860
 
585
- **"No search engines configured"**
586
- - Set at least one API key (TAVILY_API_KEY or BRAVE_API_KEY)
861
+ **No results found**
862
+ - Package registries (npm, PyPI, crates.io) are always available
863
+ - Try refining your search query
864
+ - Check your internet connection
587
865
 
588
866
  **Rate limit errors**
589
- - Check your usage at provider dashboards
867
+ - Package registry searches are rate-limited by the registry providers
590
868
  - Results are cached to minimize API calls
591
869
 
592
870
  **Slow searches**
593
- - Use `basic` search depth (default)
594
- - Results are cached after first search
871
+ - Results are cached after first search (5 minute TTL)
872
+ - Subsequent identical queries will be instant
595
873
 
596
874
  ## 🔌 MCP (Model Context Protocol)
597
875
 
@@ -729,8 +1007,9 @@ AX CLI implements enterprise-grade architecture with:
729
1007
 
730
1008
  - **Single Source of Truth (SSOT)** type system via `@ax-cli/schemas`
731
1009
  - **TypeScript strict mode** with Zod runtime validation
732
- - **98%+ test coverage** (562 tests)
1010
+ - **98%+ test coverage** (1381 tests passing)
733
1011
  - **Modular design** with clean separation of concerns
1012
+ - **Enterprise security** with AES-256-GCM encryption for sensitive data
734
1013
 
735
1014
  [Architecture Documentation →](docs/architecture.md)
736
1015
 
@@ -749,6 +1028,61 @@ AX CLI implements enterprise-grade architecture with:
749
1028
 
750
1029
  ## 📋 Changelog
751
1030
 
1031
+ ### v3.6.1 (2025-11-22)
1032
+
1033
+ **🔧 Improvements:**
1034
+ - **Web Search Simplification**: Removed Tavily AI dependency, focusing entirely on package registries
1035
+ - Streamlined to npm, PyPI, and crates.io package search only
1036
+ - No API keys required for web search functionality
1037
+ - Reduced dependencies and simplified architecture
1038
+ - **Documentation Overhaul**: Completely updated web search documentation
1039
+ - 200+ lines updated with package-focused examples
1040
+ - 15+ new realistic examples showing npm, PyPI, and crates.io workflows
1041
+ - Comprehensive session examples for package discovery and comparison
1042
+ - Best practices for cross-registry searches and version compatibility checks
1043
+ - **Smart Paste Auto-Collapse**: Intelligent handling of large text inputs
1044
+ - Automatic collapse of 20+ line pastes for better readability
1045
+ - Press Ctrl+P to expand/collapse pasted content
1046
+ - Configurable threshold in `~/.ax-cli/config.json`
1047
+ - Full content still sent to AI (not just the placeholder)
1048
+
1049
+ **✅ Quality:**
1050
+ - All 1,381 tests passing with 98.29% coverage
1051
+ - Zero breaking changes
1052
+ - Cleaner codebase with reduced complexity
1053
+
1054
+ ### v3.6.0 (2025-11-22)
1055
+
1056
+ **🔒 Enterprise-Grade Security (FREE & Open Source):**
1057
+ - **API Key Encryption**: AES-256-GCM encryption for API keys at rest
1058
+ - **Command Injection Protection**: CVSS 9.8 CRITICAL fix with command whitelisting
1059
+ - **Path Traversal Hardening**: CVSS 8.6 HIGH fix preventing unauthorized file access
1060
+ - **SSRF Attack Prevention**: CVSS 7.5 HIGH fix for MCP transport URL validation
1061
+ - **Input Sanitization**: CVSS 7.0 HIGH fix for comprehensive input validation
1062
+ - **Error Sanitization**: CVSS 6.5 MEDIUM fix preventing credential leakage
1063
+ - **Security Audit Logging**: Basic JSON logging with 30-day retention
1064
+ - **Rate Limiting**: Token bucket algorithm to prevent API abuse
1065
+ - **Memory Leak Fixes**: Process pool management for long-running operations
1066
+
1067
+ **✅ Test Quality:**
1068
+ - **1381+ tests passing** (up from 1,038) with 98.29% coverage
1069
+ - All security modules fully tested and validated
1070
+ - Production-ready security implementation
1071
+
1072
+ **🏢 Enterprise Features (Available):**
1073
+ - Advanced audit logging with compliance reports (SOC2, HIPAA, PCI-DSS)
1074
+ - Team collaboration with shared chat history
1075
+ - Policy enforcement and approval workflows
1076
+ - Extended audit log retention (1+ years)
1077
+ - SSO/SAML integration support
1078
+ - Priority 24-hour SLA support
1079
+ - Contact sales@defai.digital for enterprise licensing
1080
+
1081
+ **🔧 Configuration Improvements:**
1082
+ - New `ax-cli setup` wizard for secure API key configuration
1083
+ - Automatic migration of plain-text API keys to encrypted format
1084
+ - Environment variable override support for CI/CD workflows
1085
+
752
1086
  ### v3.5.3 (2025-11-22)
753
1087
 
754
1088
  **Bug Fixes - Test Quality & Reliability:**
@@ -790,7 +1124,7 @@ AX CLI implements enterprise-grade architecture with:
790
1124
  - Multi-phase task planner with automatic complexity detection
791
1125
  - Enhanced MCP integration with production-ready templates
792
1126
  - Project memory system with intelligent context caching
793
- - Web search capabilities with Tavily AI and Brave Search
1127
+ - Web search capabilities with npm, PyPI, and crates.io package registries
794
1128
  - Advanced code analysis tools (dependency, security, metrics)
795
1129
 
796
1130
  ## 📄 License