diff --git a/README.md b/README.md index 100c0619..19804946 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,11 @@ For debugging mode (allows Node.js inspector connection): ``` npx @wonderwhy-er/desktop-commander@latest setup --debug ``` + +**Command line options during setup:** +- `--debug`: Enable debugging mode for Node.js inspector +- `--no-onboarding`: Disable onboarding prompts for new users + Restart Claude if running. **✅ Auto-Updates:** Yes - automatically updates when you restart Claude @@ -652,6 +657,44 @@ set_config_value({ "key": "fileWriteLineLimit", "value": 25 }) 4. **Always verify configuration after changes**: Use `get_config({})` to confirm your changes were applied correctly. +## Command Line Options + +Desktop Commander supports several command line options for customizing behavior: + +### Disable Onboarding + +By default, Desktop Commander shows helpful onboarding prompts to new users (those with fewer than 10 tool calls). You can disable this behavior: + +```bash +# Disable onboarding for this session +node dist/index.js --no-onboarding + +# Or if using npm scripts +npm run start:no-onboarding + +# For npx installations, modify your claude_desktop_config.json: +{ + "mcpServers": { + "desktop-commander": { + "command": "npx", + "args": [ + "-y", + "@wonderwhy-er/desktop-commander@latest", + "--no-onboarding" + ] + } + } +} +``` + +**When onboarding is automatically disabled:** +- When the MCP client name is set to "desktop-commander" +- When using the `--no-onboarding` flag +- After users have used onboarding prompts or made 10+ tool calls + +**Debug information:** +The server will log when onboarding is disabled: `"Onboarding disabled via --no-onboarding flag"` + ## Using Different Shells You can specify which shell to use for command execution: diff --git a/src/index.ts b/src/index.ts index 155bf51c..9545dbf3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,6 +23,15 @@ async function runServer() { return; } + // Parse command line arguments for onboarding control + const DISABLE_ONBOARDING = process.argv.includes('--no-onboarding'); + if (DISABLE_ONBOARDING) { + logToStderr('info', 'Onboarding disabled via --no-onboarding flag'); + } + + // Set global flag for onboarding control + (global as any).disableOnboarding = DISABLE_ONBOARDING; + try { logToStderr('info', 'Loading configuration...'); await configManager.loadConfig(); diff --git a/src/types.ts b/src/types.ts index dee40988..d023f464 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3,6 +3,7 @@ import { FilteredStdioServerTransport } from './custom-stdio.js'; declare global { var mcpTransport: FilteredStdioServerTransport | undefined; + var disableOnboarding: boolean | undefined; } export interface ProcessInfo { diff --git a/src/utils/usageTracker.ts b/src/utils/usageTracker.ts index 2325e83d..4ee3a472 100644 --- a/src/utils/usageTracker.ts +++ b/src/utils/usageTracker.ts @@ -382,6 +382,22 @@ class UsageTracker { * Check if user should see onboarding invitation - SIMPLE VERSION */ async shouldShowOnboarding(): Promise { + // Check if onboarding is disabled via command line argument + if ((global as any).disableOnboarding) { + return false; + } + + // Check if client is desktop-commander (disable for this client) + try { + const { currentClient } = await import('../server.js'); + if (currentClient?.name === 'desktop-commander') { + return false; + } + } catch (error) { + // If we can't import server, continue with other checks + console.log('[ONBOARDING DEBUG] Could not check client name, continuing...'); + } + const stats = await this.getStats(); const onboardingState = await this.getOnboardingState(); const now = Date.now();