### Local Installation and Setup Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Installs Claude Desktop Commander by cloning the repository locally and running the setup script. This method is useful for development or if direct installation fails. ```bash git clone https://github.com/wonderwhy-er/ClaudeComputerCommander.git cd ClaudeComputerCommander npm run setup ``` -------------------------------- ### Code Snippet Example: Development Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Example of how Claude can start and interact with a Node.js session for development tasks. ```Node.js "Start Node.js and test this API" → Claude runs interactive Node session ``` -------------------------------- ### Install Claude Desktop Commander Directly Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Installs the Claude Desktop Commander tool directly using npx. This command handles the setup and makes the tool available. ```bash npx @wonderwhy-er/desktop-commander setup ``` -------------------------------- ### JavaScript Configuration Examples Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Examples demonstrating how to use configuration functions in JavaScript. ```javascript // Get the entire config get_config({}); // Set a specific config value set_config_value({ "key": "defaultShell", "value": "/bin/zsh" }); // Set multiple config values using separate calls set_config_value({ "key": "defaultShell", "value": "/bin/bash" }); set_config_value({ "key": "allowedDirectories", "value": ["/Users/username/projects"] }); // Setting fileWriteLineLimit set_config_value({ "key": "fileWriteLineLimit", "value": 1000 }); set_config_value({ "key": "fileWriteLineLimit", "value": 25 }); ``` -------------------------------- ### Install Desktop Commander via Local Checkout Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Clones the Desktop Commander MCP repository locally and runs a setup script. This method requires manual updates and involves building the server. ```bash git clone https://github.com/wonderwhy-er/DesktopCommanderMCP.git cd DesktopCommanderMCP npm run setup ``` -------------------------------- ### Local Installation via Git and NPM Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/docs/index.html Installs Desktop Commander by cloning the repository from GitHub, navigating into the project directory, and running the setup script using npm. ```git git clone https://github.com/wonderwhy-er/DesktopCommanderMCP ``` ```shell cd DesktopCommanderMCP ``` ```shell npm run setup ``` -------------------------------- ### Debugging Setup Commands Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Commands to install and configure the desktop commander in debug mode. ```bash # Install and setup in debug mode using npx npx @wonderwhy-er/desktop-commander@latest setup --debug # Or if installed locally npm run setup:debug ``` -------------------------------- ### JavaScript Command Execution Examples Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Examples showing how to execute commands with different shell options. ```javascript // Using default shell (bash or system default) execute_command({ "command": "echo $SHELL" }); // Using zsh specifically execute_command({ "command": "echo $SHELL", "shell": "/bin/zsh" }); // Using bash specifically execute_command({ "command": "echo $SHELL", "shell": "/bin/bash" }); ``` -------------------------------- ### NPX Install Desktop Commander Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/docs/index.html Installs the latest version of Desktop Commander using npx. This command fetches and executes the setup script for the tool. ```shell npx @wonderwhy-er/desktop-commander@latest setup ``` -------------------------------- ### Bash Install for macOS Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/docs/index.html Automates the installation process on macOS. It downloads a script from GitHub and executes it, handling Node.js checks and dependency setup. ```bash curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh | bash ``` -------------------------------- ### Tool Usage Example: Specific Edit Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md A concrete example of using the search/replace block format to modify a file. ```APIDOC src/main.js <<<<<<< SEARCH console.log("old message"); ======= console.log("new message"); >>>>>>> REPLACE ``` -------------------------------- ### Install Claude Desktop Commander via Smithery Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Installs the Claude Desktop Commander tool using the Smithery CLI. This is a convenient method for users who have Smithery set up. ```bash npx -y @smithery/cli install @wonderwhy-er/desktop-commander --client claude ``` -------------------------------- ### Code Snippet Example: Data Analysis Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Example of how Claude can run Python code in memory to analyze data. ```Python "Analyze sales.csv and show top customers" → Claude runs Python code in memory ``` -------------------------------- ### Code Snippet Example: Remote Access Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Example of how Claude can maintain an SSH session to interact with a remote server. ```Shell "SSH to my server and check disk space" → Claude maintains SSH session ``` -------------------------------- ### Install Desktop Commander via Smithery Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Installs Desktop Commander for Claude Desktop using the Smithery CLI. This method supports automatic updates when Claude Desktop restarts. ```bash npx -y @smithery/cli install @wonderwhy-er/desktop-commander --client claude ``` -------------------------------- ### Tool Usage Example: Search/Replace Block Format Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Illustrates the format for specifying search and replace content for text editing operations. ```APIDOC filepath.ext <<<<<<< SEARCH content to find ======= new content >>>>>>> REPLACE ``` -------------------------------- ### Install Desktop Commander MCP via Bash Script (macOS) Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Automated bash installer for macOS users. It checks for Node.js, installs it if necessary, and configures Desktop Commander. This method requires manual updates by re-running the script. ```bash curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh | bash ``` -------------------------------- ### Smithery CLI Install Desktop Commander Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/docs/index.html Installs Desktop Commander via the Smithery CLI. This method specifies the 'claude' client for the installation. ```shell npx -y @smithery/cli install @wonderwhy-er/desktop-commander --client claude ``` -------------------------------- ### Install Desktop Commander MCP via npx Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Installs the latest version of Desktop Commander MCP using npx. This method supports automatic updates when the Claude Desktop app is restarted. ```shell npx @wonderwhy-er/desktop-commander@latest setup ``` -------------------------------- ### Project Navigation Structure Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/docs/index.html HTML structure for the main navigation of the project, including links to different sections like Use Cases, Installation, Testimonials, Resources, and Sponsors. ```html [![DesktopCommander Logo](optimized_images/logo.webp) DesktopCommander](#) * [Use Cases](#cases) * [Software Engineer](#cases-software) * [DevOps](#cases-devops) * [Technical Writer](#cases-writer) * [UX/UI Designer](#cases-uxui) * [Installation](#installation) * [Testimonials](#testimonials) * [Resources](#) * [Join Discord](https://discord.gg/kQ27sNnZr7) * [GITHUB](https://github.com/wonderwhy-er/DesktopCommanderMCP) * [Media](#media) * [FAQ](#faq) * [Sponsor](#sponsors) * [Use Cases](#cases) * [Installation](#installation) * [Testimonials](#testimonials) * [Join Discord](https://discord.gg/kQ27sNnZr7) * [Sponsor](#sponsors) ``` -------------------------------- ### Install Desktop Commander MCP via npx (Debug Mode) Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Installs Desktop Commander MCP in debug mode, allowing for Node.js inspector connections. This is useful for troubleshooting and development. ```shell npx @wonderwhy-er/desktop-commander@latest setup --debug ``` -------------------------------- ### Process Management Commands Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Commands for interacting with background processes started by `execute_command`. ```APIDOC read_output Description: Reads new output from a running process. Parameters: - pid (number): The Process ID (PID) of the command to read output from. Returns: - (string): Any new output generated by the process since the last read. force_terminate Description: Terminates a running process. Parameters: - pid (number): The Process ID (PID) of the command to terminate. Returns: - (boolean): True if the termination signal was sent successfully, false otherwise. ``` -------------------------------- ### Update Desktop Commander from Local Checkout Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Updates the locally checked out Desktop Commander MCP by pulling the latest changes from the repository and re-running the setup script. ```bash cd DesktopCommanderMCP && git pull && npm run setup ``` -------------------------------- ### Copy Button Styles (Installation) Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/docs/index.html CSS for styling a copy button specifically within the installation section, including its position, appearance, hover state, and a 'copied' state. ```css #installation .pre-container { position: relative; margin-top: 10px; margin-bottom: 10px; } #installation .copy-button { position: absolute; top: 5px; right: 5px; background-color: rgba(0, 0, 0, 0.1); color: #666; border: none; border-radius: 3px; padding: 4px 8px; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0.7; transition: all 0.2s ease; z-index: 10; } #installation .copy-button:hover { opacity: 1; background-color: rgba(0, 0, 0, 0.2); } #installation .copy-button.copied { background-color: #2ecc71; color: white; opacity: 1; } /* Style adjustments for pre elements inside the container */ #installation .pre-container > pre { padding-top: 30px !important; margin-top: 0 !important; margin-bottom: 0 !important; } ``` -------------------------------- ### Terminal Process Management Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Tools for managing terminal sessions and processes. This includes starting, interacting with, reading output from, and terminating processes. ```APIDOC Terminal Process Management: start_process(command: str, args: list = None, cwd: str = None) - Starts a program or command with smart detection for input readiness. - Parameters: - command: The command to execute. - args: Optional list of arguments for the command. - cwd: Optional current working directory for the process. - Returns: Information about the started process, including its session ID. interact_with_process(session_id: str, command: str) - Sends a command to a running process and retrieves its response. - Parameters: - session_id: The identifier of the running process session. - command: The command to send to the process. - Returns: The output or response from the process. read_process_output(session_id: str, lines: int = 100) - Reads output from a running process. - Parameters: - session_id: The identifier of the running process session. - lines: The maximum number of lines to read (default: 100). - Returns: The output from the process. force_terminate(session_id: str) - Forcefully terminates a running terminal session. - Parameters: - session_id: The identifier of the terminal session to terminate. - Returns: Status of the termination operation. list_sessions() - Lists all active terminal sessions. - Returns: A list of active terminal session identifiers. list_processes() - Lists all running processes with detailed information. - Returns: Detailed information about all running processes. kill_process(pid: int) - Terminates a running process by its Process ID (PID). - Parameters: - pid: The Process ID of the process to terminate. - Returns: Status of the termination operation. ``` -------------------------------- ### Check Node.js Version Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Verifies the installed Node.js version, which is a prerequisite for Claude Desktop Commander. Ensures the environment meets the minimum requirement of v18 or higher. ```shell node -v ``` -------------------------------- ### General Uninstall Command for Desktop Commander Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md A general command to uninstall Desktop Commander, potentially used when installed via npx directly or as a fallback. ```bash npx @wonderwhy-er/desktop-commander@latest setup --uninstall ``` -------------------------------- ### Uninstall Desktop Commander via Smithery Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Uninstalls Desktop Commander installed via Smithery using the Smithery CLI. ```bash npx -y @smithery/cli uninstall @wonderwhy-er/desktop-commander --client claude ``` -------------------------------- ### Execute Multi-line JavaScript in Node.js REPL Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/test/test_output/node_repl_debug.txt This snippet shows how to execute a block of JavaScript code within a Node.js REPL session. It defines a greeting function and then uses it in a loop to print personalized greetings. The output is captured and displayed. ```javascript function greet(name) { return `Hello, ${name}!`; } for (let i = 0; i < 3; i++) { console.log(greet(`User ${i}`)); } ``` -------------------------------- ### Uninstall Desktop Commander MCP Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Uninstalls Desktop Commander MCP by running the setup command with the --uninstall flag. This command removes the MCP server entry from the Claude config file and the cloned repository. ```shell npx @wonderwhy-er/desktop-commander@latest setup --uninstall ``` -------------------------------- ### Configuration Management Commands Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Tools for retrieving and setting server configuration values. Changes are persisted to config.json. ```APIDOC get_config Description: Retrieves the entire server configuration. Parameters: - (object): An empty object `{}` is passed to signify fetching all configuration. Returns: - (object): The current server configuration. set_config_value Description: Sets a specific configuration value or multiple values. Parameters: - key (string): The name of the configuration setting to modify. - value (any): The new value for the configuration setting. Can be a string, number, boolean, or array. Examples: - set_config_value({ "key": "defaultShell", "value": "/bin/zsh" }) - set_config_value({ "key": "allowedDirectories", "value": ["/Users/username/projects"] }) - set_config_value({ "key": "fileWriteLineLimit", "value": 1000 }) Notes: - Setting 'allowedDirectories' to an empty array `[]` grants broad filesystem access. - 'fileWriteLineLimit' controls lines written per operation, defaulting to 50. ``` -------------------------------- ### Manually Configure Claude Desktop MCP Server Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Adds the Claude Desktop Commander MCP server configuration to the Claude Desktop configuration file. This allows Claude Desktop to discover and use the tool. ```json { "mcpServers": { "desktop-commander": { "command": "npx", "args": [ "-y", "@wonderwhy-er/desktop-commander" ] } } } ``` -------------------------------- ### Filesystem Operations Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Tools for interacting with the local filesystem and URLs, including reading, writing, creating, listing, moving, and searching files. ```APIDOC Filesystem Operations: read_file(path: str, offset: int = 0, length: int = 1000) - Reads contents from a local filesystem path or a URL. - Supports line-based pagination with positive/negative offsets and length parameters. - Parameters: - path: The path to the file or URL. - offset: The starting line offset (can be negative). - length: The number of lines to read. - Returns: The content of the file or URL. read_multiple_files(paths: list[str]) - Reads contents from multiple files simultaneously. - Parameters: - paths: A list of file paths to read. - Returns: A dictionary mapping file paths to their content. write_file(path: str, content: str, mode: str = 'rewrite') - Writes content to a file with options for rewrite or append mode. - Uses configurable line limits for writing. - Parameters: - path: The path to the file to write. - content: The content to write to the file. - mode: 'rewrite' to overwrite, 'append' to add to the end. - Returns: Status of the write operation. create_directory(path: str) - Creates a new directory or ensures it exists. - Parameters: - path: The path of the directory to create. - Returns: Status of the directory creation. list_directory(path: str) - Gets a detailed listing of files and directories within a given path. - Parameters: - path: The directory path to list. - Returns: A list of file and directory entries with their metadata. move_file(source_path: str, destination_path: str) - Moves or renames files and directories. - Parameters: - source_path: The current path of the file or directory. - destination_path: The new path for the file or directory. - Returns: Status of the move operation. search_files(name: str, directory: str = '.', case_insensitive: bool = True) - Finds files by name using case-insensitive substring matching. - Parameters: - name: The name or pattern to search for. - directory: The directory to start the search from (defaults to current directory). - case_insensitive: Whether the search should be case-insensitive. - Returns: A list of paths matching the search criteria. search_code(pattern: str, file_path: str, case_insensitive: bool = True, whole_word: bool = False) - Searches for text or code patterns within file contents using ripgrep. - Parameters: - pattern: The text or code pattern to search for. - file_path: The path to the file or directory to search within. - case_insensitive: Whether the search should be case-insensitive. - whole_word: Whether to match whole words only. - Returns: A list of matches found within the file content. get_file_info(path: str) - Retrieves detailed metadata about a file or directory. - Parameters: - path: The path to the file or directory. - Returns: Metadata object containing information like size, modification date, permissions, etc. ``` -------------------------------- ### Codebase Exploration and Analysis Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Facilitates understanding complex codebases by navigating files, reading code, generating diagrams, summarizing functionalities, and identifying architectural patterns. ```APIDOC codebase_exploration: description: Assists in understanding and navigating codebases. capabilities: - Navigate through folders and files. - Read and understand code. - Generate diagrams showing component relationships. - Create summaries of key functionalities. - Identify patterns and architecture. - Explain complex code sections. benefits: - Useful for onboarding to new projects. - Aids in reviewing unfamiliar repositories. ``` -------------------------------- ### Feedback System Tool Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md The `give_feedback_to_desktop_commander` tool facilitates sending feedback to the development team. It opens a browser-based feedback form and pre-fills basic usage statistics for context, which users can modify. ```APIDOC Tool: give_feedback_to_desktop_commander Description: Opens a browser-based feedback form to send suggestions and feedback to the development team. Details: - Pre-fills basic usage statistics (tool call count, days using, platform) for context. - Users can remove pre-filled information. Usage: Invoke the tool to provide feedback about Desktop Commander. ``` -------------------------------- ### Configuration Management Tools Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Tools for retrieving and modifying server configuration settings. This includes managing blocked commands, default shell, allowed directories, file limits, and telemetry. ```APIDOC Configuration Tools: get_config() - Retrieves the complete server configuration as a JSON object. - Includes settings like blockedCommands, defaultShell, allowedDirectories, fileReadLineLimit, fileWriteLineLimit, and telemetryEnabled. - Returns: JSON string representing the server configuration. set_config_value(key: str, value: any) - Sets a specific configuration value by its key. - Available keys: - blockedCommands: Array of shell commands that cannot be executed. - defaultShell: The shell to use for commands (e.g., 'bash', 'zsh', 'powershell'). - allowedDirectories: Array of filesystem paths the server can access for file operations. - fileReadLineLimit: Maximum lines to read at once (default: 1000). - fileWriteLineLimit: Maximum lines to write at once (default: 50). - telemetryEnabled: Boolean to enable/disable telemetry. - Parameters: - key: The configuration setting to modify. - value: The new value for the configuration setting. - Returns: Status of the operation (e.g., success or failure message). ``` -------------------------------- ### General Automation and System Tasks Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Beyond coding, the tool handles various system tasks including file management, media processing, system monitoring, and running terminal-based tools. ```APIDOC automation_and_system_tasks: description: Supports a wide range of non-coding system and automation tasks. capabilities: - File organization and management. - Media processing (video compression, image conversion). - System monitoring and maintenance. - Running and managing any terminal-based tools. - Data processing and analysis. ``` -------------------------------- ### Remote Server and Process Interaction Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Enables establishing and interacting with remote servers via SSH, databases, or other programs. It supports sending multiple commands to a running process, maintaining context throughout the session. ```APIDOC remote_connection: description: Starts and manages connections to remote servers or services. examples: - SSH connections - Database connections features: - Can send multiple commands to a running process. - Maintains conversational context throughout the session. ``` -------------------------------- ### Manual Configuration for Claude Desktop Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/docs/index.html Adds Desktop Commander configuration to the 'claude_desktop_config.json' file. This allows Claude Desktop to recognize and run the commander. ```json { "mcpServers": { "desktop-commander": { "command": "npx", "args": [ "-y", "@wonderwhy-er/desktop-commander" ] } } } ``` -------------------------------- ### Responsive Menu Styles Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/docs/index.html CSS for managing desktop and mobile navigation, including hiding desktop navigation on small screens and showing mobile navigation when toggled. ```css /* Desktop/Mobile Menu Styles */ .mobile-nav { display: none; /* Hidden by default */ } /* Title display controls */ .mobile-title { display: none; /* Hidden on desktop */ } .desktop-title { display: block; /* Shown on desktop */ } /* Media queries for responsive menu */ @media (max-width: 768px) { .desktop-nav { display: none; /* Hide desktop nav on mobile */ } .mobile-nav { display: none; /* Hidden until toggled */ } /* Mobile menu button styling */ .mobile-menu-btn { display: block; cursor: pointer; color: white; } /* Switch title display on mobile */ .desktop-title { display: none; } .mobile-title { display: block; text-align: center; margin-top: 40px; } .mobile-title .dynamic-title { text-align: center; margin-top: 0; padding-top: 30px; font-size: 2.2rem; line-height: 1.4; } .hero-content { width: 100%; text-align: center; padding: 0 15px; margin-top: 30px; } .hero-content .badges, .hero-content .badge-row { justify-content: center; } .hero-content .hero-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; } .hero-content .hero-btns .btn { flex: 1; min-width: 140px; text-align: center; } /* Mobile menu when active */ .mobile-nav.active { display: block; position: fixed; top: 80px; left: 0; width: 100%; background: #0A0A0A; padding: 20px 0; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); z-index: 1000; } /* Style mobile nav links */ .mobile-nav ul li a { display: block; padding: 12px 20px; color: white; } } ``` -------------------------------- ### Command Management and File I/O Functions Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Details functions for managing command execution and writing to files. `block_command` and `unblock_command` are used to control which commands Claude can execute, with recommendations to block potentially destructive commands. `write_file` allows writing content to a specified path, supporting 'rewrite' mode for initial writes and 'append' mode for subsequent additions. ```APIDOC block_command(command: str) - Description: Blocks a specific command from execution. - Usage: Recommended for potentially destructive commands like 'rm -rf' or 'format'. unblock_command(command: str) - Description: Unblocks a previously blocked command. write_file(path: str, content: str, options?: { mode: 'rewrite' | 'append' }) - Description: Writes content to a file at the specified path. - Parameters: - path: The path to the file. - content: The string content to write. - options.mode: 'rewrite' to overwrite the file, 'append' to add to the end. ``` -------------------------------- ### Update Claude Desktop Commander Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Instructions on how to update the Claude Desktop Commander to the latest version. Restarting Claude Desktop usually suffices due to npx's automatic checks. ```bash # Restart Claude Desktop to automatically check for and install updates. # If issues persist, re-run the installation command: npx @wonderwhy-er/desktop-commander setup ``` -------------------------------- ### Configure Desktop Commander Manually in claude_desktop_config.json Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Manually adds Desktop Commander as an MCP server by modifying the Claude Desktop configuration file. This method requires manual updates. ```json { "mcpServers": { "desktop-commander": { "command": "npx", "args": [ "-y", "@wonderwhy-er/desktop-commander" ] } } } ``` -------------------------------- ### Analytics and Feedback Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Tools for accessing usage statistics and providing feedback to the Desktop Commander team. ```APIDOC Analytics and Feedback: get_usage_stats() - Retrieves usage statistics for user insight. - Returns: Usage statistics data. give_feedback_to_desktop_commander() - Opens a feedback form in the browser to provide feedback to the Desktop Commander Team. - Returns: N/A (initiates browser action). ``` -------------------------------- ### Usage Analytics Tool Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md The `get_usage_stats` tool allows users to view their personal usage patterns, success rates, and performance metrics locally. This data is collected and stored on the user's machine for functionality and insights, and is not sent externally. ```APIDOC Tool: get_usage_stats Description: Retrieves and displays local usage statistics for Desktop Commander. Details: - Collects local usage statistics (tool call count, days using, platform). - Data is stored locally on your machine. - This data is NOT sent anywhere. Usage: Invoke the tool to view your personal usage patterns, success rates, and performance metrics. ``` -------------------------------- ### Manage Fuzzy Search Logs with npm Scripts Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Provides npm scripts for viewing, analyzing, exporting, and clearing fuzzy search logs. These scripts facilitate log management outside the MCP environment, offering insights into search performance and issues. ```bash # View recent fuzzy search logs npm run logs:view -- --count 20 ``` ```bash # Analyze patterns and performance npm run logs:analyze -- --threshold 0.8 ``` ```bash # Export logs to CSV or JSON npm run logs:export -- --format json --output analysis.json ``` ```bash # Clear all logs (with confirmation) npm run logs:clear ``` -------------------------------- ### Enhanced Edit Block Features Summary Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Details on the advanced capabilities of the `edit_block` tool, including fuzzy search, character-level diffs, and multiple occurrence handling. ```APIDOC Enhanced Edit Block Features: 1. Improved Prompting: Emphasizes small, focused edits. 2. Fuzzy Search Fallback: Provides detailed feedback on closest matches when exact matches fail. 3. Character-level Diffs: Displays changes using `{-removed-}{+added+}` format. 4. Multiple Occurrence Support: Can replace multiple instances using the `expected_replacements` parameter. 5. Comprehensive Logging: Logs all fuzzy searches for analysis and debugging. ``` -------------------------------- ### Google Analytics Initialization Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/docs/index.html This JavaScript code snippet initializes Google Analytics by dynamically creating a script tag and appending it to the document's head. It includes a delay before loading the analytics script. ```javascript document.addEventListener('DOMContentLoaded', function() { setTimeout(function() { var analyticsScript = document.createElement('script'); analyticsScript.async = true; analyticsScript.src = 'https://www.googletagmanager.com/gtag/js?id=G-HXL4Y3Y62N'; document.head.appendChild(analyticsScript); window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-HXL4Y3Y62N'); }, 3000); // 3 second delay }); ``` -------------------------------- ### File Editing and Writing Operations Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Provides methods for modifying files. `edit_block` is suitable for small changes using a specific search-and-replace format, while `write_file` is for complete file content replacement. Both are crucial for code maintenance and updates. ```APIDOC edit_block: description: Performs surgical text replacements within a file. best_for: Small changes (<20% of file size). format: filepath.ext <<<<<<< SEARCH existing code to replace ======= new code to insert >>>>>>> REPLACE parameters: - filepath: The path to the file to edit. - SEARCH: The existing text to find. - REPLACE: The new text to insert. write_file: description: Replaces the entire content of a file. best_for: Large changes (>20% of file size) or when edit_block fails. parameters: - filepath: The path to the file to overwrite. - content: The new content for the file. read_file: description: Fetches content from a specified resource, including URLs. parameters: - filepath: The path or URL of the resource. - isUrl: Boolean, set to true if filepath is a URL. notes: - Supports text and image content from URLs. - Includes a 30-second timeout for URL retrieval. ``` -------------------------------- ### Basic CSS Styling Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/docs/index.html This CSS block defines basic styles for the application's UI, including color variables, body margins, container dimensions, header styles, hero section layout, and button appearances. ```css :root { --text-color-high-contrast: #f8f9fa; --section-text-color: #121212; --primary-color: #0A0A0A; --light-text: #ffffff; --accent-color: #0078D7; --super-black: #0A0A0A; } body { margin: 0; padding: 0; font-family: 'Poppins', 'Roboto', Helvetica, Arial, sans-serif; overflow-x: hidden; width: 100%; max-width: 100vw; font-weight: 300; } .container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 15px; box-sizing: border-box; overflow-x: hidden; } header { background: #000000; color: #ffffff; padding: 20px 0; position: fixed; width: 100%; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); height: 80px; box-sizing: border-box; overflow: visible; } .header-cta-btn { background-color: #0078D7; color: white; padding: 8px 15px; border-radius: 5px; text-decoration: none; font-weight: 300; } .header-cta-btn:hover { color: white; background-color: #0056a0; } .header-consultation-btn { background-color: #ff6b35; color: white; padding: 8px 15px; border-radius: 5px; text-decoration: none; font-weight: 500; margin-right: 10px; text-transform: uppercase; font-size: 14px; letter-spacing: 0.5px; } .header-consultation-btn:hover { color: white; background-color: #e55a2b; transform: translateY(-1px); } .header-container { display: flex; align-items: center; justify-content: space-between; padding: 0; height: 40px; overflow: visible; } .hero { background: #000000; min-height: 90vh; margin-top: 0; padding: 40px 0 60px 0; display: flex; align-items: center; box-sizing: border-box; } .hero-wrapper { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; width: 100%; gap: 30px; } .hero-image-container { flex: 1; display: flex; justify-content: flex-end; align-items: center; min-height: 600px; padding-top: 80px; position: relative; z-index: 1; } .hero-header-video { width: 960px; height: auto; max-width: 100%; border-radius: 12px; display: block; object-fit: cover; } .video-glow-wrapper { position: relative; display: inline-block; border-radius: 12px; overflow: hidden; max-width: 100%; } .video-glow-wrapper::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 12px; z-index: -1; } .hero-content { flex: 1; max-width: 650px; } .hero p { font-size: 1.1rem; margin-bottom: 25px; line-height: 1.5; } .primary-btn, .secondary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 300; padding: 12px 24px; color: white; text-decoration: none; border-radius: 10px; } .primary-btn { background-color: #0078D7; border: none; box-shadow: 0 4px 6px rgba(0, 120, 215, 0.25); font-weight: 300; } .primary-btn:hover { background-color: #0056a0; box-shadow: 0 6px 12px rgba(0, 120, 215, 0.35); } .secondary-btn { background-color: transparent; border: 2px solid #ffffff; font-weight: 300; } .contact-btn:hover { background-color: #0056a0 !important; } ``` -------------------------------- ### Command Execution with Shell Selection Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md Execute system commands, with the option to specify the shell interpreter. ```APIDOC execute_command Description: Executes a given command in the system. Parameters: - command (string): The command to execute. - shell (string, optional): The specific shell to use for execution (e.g., "/bin/zsh", "/bin/bash"). If omitted, the system's default shell is used. Returns: - (object): An object containing initial output and a process ID (PID). Notes: - The command execution is asynchronous. The function returns after a timeout with initial output. - The command continues to run in the background. - Use `read_output` with the PID to get subsequent output. - Use `force_terminate` with the PID to stop the process. Examples: - execute_command({ "command": "echo $SHELL" }) - execute_command({ "command": "echo $SHELL", "shell": "/bin/zsh" }) - execute_command({ "command": "echo $SHELL", "shell": "/bin/bash" }) ``` -------------------------------- ### Text Editing with Enhanced Features Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/README.md The `edit_block` tool allows for targeted text replacements with advanced features like fuzzy search, character-level diffs, and multiple occurrence support. ```APIDOC Text Editing Tool: edit_block(filepath: str, search_content: str, replace_content: str, expected_replacements: int = 1) - Applies targeted text replacements within a specified file. - Enhancements include improved prompting, fuzzy search fallback, character-level diffs, and support for multiple occurrences. - When a search fails, detailed information about the closest match is provided. - Parameters: - filepath: The path to the file to edit. - search_content: The content to find within the file. - replace_content: The content to replace the found text with. - expected_replacements: The expected number of replacements to make. - Returns: Status of the edit operation and details of changes made or fuzzy match information. ``` -------------------------------- ### Promotion Bar Styles Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/docs/index.html Styles the promotion bar, including its background color, padding, text color, alignment, and top margin. It ensures the bar is visually distinct and positioned correctly relative to the header. ```css .promotion-bar { background-color: #0078D7; padding: 8px 0; color: white; text-align: center; margin-top: 80px; /* Same as header height */ } ``` -------------------------------- ### File Search with Timeout Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Supports searching for files and code across directories with built-in timeout protection to prevent indefinite hangs on large codebases. The timeout duration can be customized. ```APIDOC search_operations: description: Performs searches across files and code with timeout protection. commands: - search_files - search_code parameters: - timeoutMs: Custom timeout duration in milliseconds (default 30000). behavior: - Searches have a default 30-second timeout. - If a search times out, a clear message is provided. purpose: - Prevents searches from hanging indefinitely on large codebases. ``` -------------------------------- ### Configure fileWriteLineLimit Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/FAQ.md Demonstrates how to set the `fileWriteLineLimit` configuration value. This setting controls the maximum number of lines an AI can write in a single operation, intended to manage token usage and AI UX message limits by encouraging smaller, chunked edits. The default is 50 lines, but it can be set to thousands. ```javascript set_config_value({ "key": "fileWriteLineLimit", "value": 2000 }) // Or keep it small to force efficient behavior set_config_value({ "key": "fileWriteLineLimit", "value": 25 }) ``` -------------------------------- ### Navigation and Dropdown Styles Source: https://github.com/wonderwhy-er/desktopcommandermcp/blob/main/docs/index.html Defines styles for the main navigation menu, including list item spacing, link appearance, and dropdown menu behavior. It specifies positioning, visibility transitions, and styling for dropdown items to create an interactive navigation experience. ```css /* Pre-set dimensions for nav menu to prevent shifts */ nav ul { display: flex; list-style: none; margin: 0; padding: 0; } nav ul li { margin-left: 30px; position: relative; } nav ul li a { color: white; text-decoration: none; font-weight: 300; display: flex; align-items: center; } /* Dropdown styles */ .dropdown-toggle svg { margin-left: 5px; transition: transform 0.3s ease; } .dropdown:hover .dropdown-toggle svg { transform: rotate(180deg); } nav .dropdown { position: relative; } .dropdown-menu { position: absolute; top: 100%; left: 0; background: var(--super-black); min-width: 180px; border-radius: 5px; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s ease; padding: 10px 0; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); z-index: 100; display: block; margin-top: 5px; } .dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); } .dropdown-menu li { margin: 0 !important; width: 100%; padding: 0; } .dropdown-menu li a { padding: 8px 15px; display: block; color: white; font-weight: 300; transition: all 0.2s ease; white-space: nowrap; } .dropdown-menu li a:hover { backgro ```