ai-toolbox

Public

Forked from crunch3r/ai-toolbox

AI Toolbox — LM Studio Plugin 109 tools across 17 categories: file system, web research, browser automation, Git/GitHub, database, document parsing, background commands, code execution, utilities, image processing, HTTP client, vector RAG, text processing, interactive UI generation, auto-context management, backup & restore, and line operations.

90 Downloads

README

🧰 AI Toolbox — LM Studio Plugin

108 tools across 17 core categories identified in current source code. (22 Git/GitHub tools + 86 others)


📋 Table of Contents


✨ Features

FeatureDescription
📁 File SystemRead, write, search, and manage files with path validation & backup support
🌐 Web ResearchMulti-engine search (DDG, Google, Bing) with automatic fallback
🖥️ Browser AutomationHeadless Puppeteer browser with persistent sessions & UI interaction
🐙 Git & GitHubFull Git operations (including stash/blame) + GitHub API integration
🗃️ DatabaseRead-only SQLite queries with SQL validation
⏳ Background CommandsLong-running process management and status tracking
⚡ Code ExecutionSandboxed JS/Python + full shell commands (pipes, redirects, env vars)
🔧 UtilitiesClipboard, notifications, system info, memory, session summaries, and environment management
🖼️ Image ProcessingOCR (Tesseract.js), screenshots, and image comparison
📊 Vector RAGSemantic search with vector embeddings for intelligent document retrieval
🎨 UI GenerationGenerate and render interactive HTML/CSS/JS components in-browser
🧠 Context ManagementAutomatic session tracking, decision logging, and memory management
📝 Text ProcessingAdvanced regex-based text transformations (sed/awk equivalents)

🗂️ Tool Categories

File System (~21 tools)

list_directory · read_file · save_file · replace_text_in_file · insert_at_line · append_file · delete_lines_in_file · make_directory · move_file · copy_file · delete_path · delete_files_by_pattern · find_files · fuzzy_find_local_files · get_file_metadata · change_directory · read_document · analyze_project

Web Research (4 tools)

web_search · wikipedia_search · fetch_web_content · rag_web_content

Browser Automation (5 tools)

browser_open_page · browser_session_control · browser_session_close · preview_html · open_file

Git & GitHub (22 tools)

Local Operations (isomorphic-git): git_status · git_diff · git_commit · git_log · git_add · git_checkout · git_stash · git_blame

Remote API (GitHub CLI gh): gh_auth · gh_create_issue · gh_list_issues · gh_view_comments · gh_create_pr · gh_list_prs · gh_push

Note: Remote operations require the GitHub CLI to be installed and authenticated (gh auth login).

Database (1 tool)

query_database

Background Commands (3 tools)

run_background_command · check_background_command · cancel_background_command

Execution (5 tools)

run_javascript · run_python · execute_command · run_in_terminal · run_tests

Utilities (~29 tools)

save_memory · get_system_info · read_clipboard · write_clipboard · send_notification · findLMStudioHome · get_enabled_tools · system_monitor · process_list · env_inspect · hash_file · token_count · convert_format · secret_scan · port_check · package_manage · detect_os_environment · json_query · env_update · get_current_working_directory · markdown_table_gen · refactor_code

Image Processing (4 tools)

image_to_text · compare_images · describe_image · screenshot_desktop

Vector RAG (4 tools)

vector_rag_search (and related semantic retrieval functions)

UI Generation (3 tools)

ui_generate_component · ui_render_html · ui_preview_element

Context Management (7 tools)

auto_summarize_context · get_context_memory · search_context · context_summary · delete_context_entry · clear_context_memory · add_context_entry

Text Processing (4 tools)

text_transform · line_operations · text_extract · markdown_table_gen

Backup & Line Ops (Always Available)

create_backup · list_backups · delete_backup · line_operations


🚀 Quick Start

Installation

The plugin is installed as an LM Studio plugin. Ensure you have:

  • LM Studio (latest version)
  • Node.js 20+ installed on your system
  • GitHub CLI (gh) — required for remote GitHub operations (Issues, PRs). Install at https://cli.github.com/

First Use

  • Load the plugin in LM Studio's plugin settings
  • Configure tool access — individual tool categories can be toggled on/off via the Settings panel. Note that some tools (like Execution) are disabled by default for security.
  • Authenticate with GitHub: Run gh auth login in your terminal once to enable remote operations (gh_create_issue, gh_list_prs, etc.). The plugin will detect authentication status automatically.
  • Start a chat and the LLM can now use any of the ~108 available tools.

⚠️ GitHub Tools Require CLI: Local Git operations (status, commit, diff) work without gh. Remote API operations (create issues, list PRs, push to origin) require gh installed and authenticated on your system.


⚙️ Configuration

The plugin uses a comprehensive configuration schema (src/config.ts) which is exposed in LM Studio's settings UI. Key features include:

  • God Mode: Instantly enables all tool categories.
  • Granular Gating: Toggle individual categories (Git, Web, File System, etc.).
  • Execution Control: Separate toggles for JavaScript, Python, Terminal, and Shell execution.
  • ContextGuard: Configure token limits and summarization models to prevent context overflow.
  • Auto-Tracking: Enable background tracking of decisions and task completions.

🔒 Security

Comprehensive documentation of security features, threat models, and responsible disclosure of the AI Toolbox plugin. See SECURITY.md for details.


🏗️ Architecture

Deep dive into the AI Toolbox plugin's system architecture, design patterns, and internal workflows. See ARCHITECTURE.md for details.


👩‍💻 Development

Prerequisites

  • Node.js 20+
  • npm

Setup

# Install dependencies
npm install

# Build the project (ESM + CJS via Tsup)
npm run build

# Run type checking
npm run typecheck

# Run test suite
npm test

📜 Release History

[1.5.29] — 🔥 Major Performance Optimization Suite (P0–P3)

Comprehensive overhaul targeting disk I/O reduction, cache utilization, and event-loop contention.

  • ✅ P0: Debounced state saves (_queueSave() with 500ms coalescing → ~90% fewer writes during bulk ops)
  • ✅ P0: Key cache with invalidation (getAllKeys() O(1) cache hit vs. O(n) disk reads, 1s TTL + auto-invalidate on mutation)
  • ✅ P1: Conditional logging via AI_TOOLBOX_DEBUG env var (~80% less stderr I/O in production)
  • ✅ P1: Pre-resolved module imports in constructor (eliminates 5–10ms per-flush dynamic import overhead)
  • ✅ P2: Size estimation cache for complex objects (JSON.stringify() memoization via sizeValueCache)
  • ✅ P2: Project path TTL cache (5s staleness check on getProjectMemoryFilePath(), eliminates duplicate fs.stat())
  • ✅ P3: LRU fuzzy search cache (delete + re-insert on access; Map order ensures oldest entries evicted)
  • ✅ Zero breaking changes. 369 tests pass, TypeScript/ESLint clean, build succeeds.

[1.5.28] — refactor_code Full AST-Based extract_function Implementation


📦 Dependencies

PackageVersionPurpose
@lmstudio/sdk^1.5.0Core SDK for LM Studio plugin development
@dqbd/tiktoken^1.0.22Accurate token counting for ContextGuard
puppeteer^24.0.0Browser automation
isomorphic-git^1.38.6Pure JS Git operations (migrated from simple-git in v1.5.25)
sharp^0.33.5Image processing
tesseract.js^7.0.0OCR engine
pdf-parse^1.1.1PDF document parsing
mammoth^1.6.0DOCX document parsing
archiver^8.0.0ZIP archive creation
unzipper^0.12.3ZIP extraction
zod^3.25.0Runtime type validation

📄 License

MIT License. See LICENSE for details.