@wonderwhy-er/desktop-commander 0.2.7 → 0.2.9

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.
package/README.md CHANGED
@@ -20,12 +20,11 @@ Work with code and text, run processes, and automate tasks, going far beyond oth
20
20
 
21
21
  ## Table of Contents
22
22
  - [Features](#features)
23
- - [Installation](#installation)
23
+ - [How to install](#how-to-install)
24
24
  - [Usage](#usage)
25
- - [Docker Support](#docker-support)
26
25
  - [Handling Long-Running Commands](#handling-long-running-commands)
27
- - [Work in Progress and TODOs](#work-in-progress-and-todos)
28
- - [Sponsors and Supporters](#sponsors-and-supporters)
26
+ - [Work in Progress and TODOs](#roadmap)
27
+ - [Sponsors and Supporters](#support-desktop-commander)
29
28
  - [Website](#website)
30
29
  - [Media](#media)
31
30
  - [Testimonials](#testimonials)
@@ -69,12 +68,13 @@ Execute long-running terminal commands on your computer and manage processes thr
69
68
  - Log rotation with 10MB size limit
70
69
  - Detailed timestamps and arguments
71
70
 
72
- ## Installation
73
- First, ensure you've downloaded and installed the [Claude Desktop app](https://claude.ai/download) and you have [npm installed](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
71
+ ## How to install
74
72
 
75
- > **📋 Update & Uninstall Information:** Before choosing an installation option, note that **only Options 1 and 3 have automatic updates**. Options 2, 4, and 5 require manual updates. See the sections below for update and uninstall instructions for each option.
73
+ Desktop Commander offers multiple installation methods to fit different user needs and technical requirements.
76
74
 
77
- ### Option 1: Install through npx **Auto-Updates**
75
+ > **📋 Update & Uninstall Information:** Before choosing an installation option, note that **only Options 1, 2, 3, and 6 have automatic updates**. Options 4 and 5 require manual updates. See the sections below for update and uninstall instructions for each option.
76
+
77
+ ### Option 1: Install through npx ⭐ **Auto-Updates** **Requires Node.js**
78
78
  Just run this in terminal:
79
79
  ```
80
80
  npx @wonderwhy-er/desktop-commander@latest setup
@@ -88,9 +88,9 @@ Restart Claude if running.
88
88
 
89
89
  **✅ Auto-Updates:** Yes - automatically updates when you restart Claude
90
90
  **🔄 Manual Update:** Run the setup command again
91
- **🗑️ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest setup --uninstall`
91
+ **🗑️ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest remove`
92
92
 
93
- ### Option 2: Using bash script installer (macOS) ⭐ **Auto-Updates**
93
+ ### Option 2: Using bash script installer (macOS) ⭐ **Auto-Updates** **Installs Node.js if needed**
94
94
  For macOS users, you can use our automated bash installer which will check your Node.js version, install it if needed, and automatically configure Desktop Commander:
95
95
  ```
96
96
  curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh | bash
@@ -99,21 +99,24 @@ This script handles all dependencies and configuration automatically for a seaml
99
99
 
100
100
  **✅ Auto-Updates:** Yes - requires manual updates
101
101
  **🔄 Manual Update:** Re-run the bash installer command above
102
- **🗑️ Uninstall:** Remove the MCP server entry from your Claude config file and delete the cloned repository if it exists
102
+ **🗑️ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest remove`
103
103
 
104
- ### Option 3: Installing via Smithery ⭐ **Auto-Updates**
104
+ ### Option 3: Installing via Smithery ⭐ **Auto-Updates** **Requires Node.js**
105
105
 
106
- To install Desktop Commander for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@wonderwhy-er/desktop-commander):
106
+ To install Desktop Commander for Claude Desktop via [Smithery](https://smithery.ai/server/@wonderwhy-er/desktop-commander):
107
107
 
108
- ```bash
109
- npx -y @smithery/cli install @wonderwhy-er/desktop-commander --client claude
110
- ```
108
+ 1. **Visit the Smithery page:** https://smithery.ai/server/@wonderwhy-er/desktop-commander
109
+ 2. **Login to Smithery** if you haven't already
110
+ 3. **Select your client** (Claude Desktop) on the right side
111
+ 4. **Install with the provided key** that appears after selecting your client
112
+ 5. **Restart Claude Desktop**
113
+
114
+ The old command-line installation method is no longer supported. Please use the web interface above for the most reliable installation experience.
111
115
 
112
116
  **✅ Auto-Updates:** Yes - automatically updates when you restart Claude
113
- **🔄 Manual Update:** Re-run the Smithery install command
114
- **🗑️ Uninstall:** `npx -y @smithery/cli uninstall @wonderwhy-er/desktop-commander --client claude`
117
+ **🔄 Manual Update:** Visit the Smithery page and reinstall
115
118
 
116
- ### Option 4: Add to claude_desktop_config manually **Manual Updates**
119
+ ### Option 4: Add to claude_desktop_config manually **Auto-Updates** **Requires Node.js**
117
120
  Add this entry to your claude_desktop_config.json:
118
121
 
119
122
  - On Mac: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
@@ -135,11 +138,11 @@ Add this entry to your claude_desktop_config.json:
135
138
  ```
136
139
  Restart Claude if running.
137
140
 
138
- **❌ Auto-Updates:** No - uses npx but config might not update automatically
139
- **🔄 Manual Update:** Usually automatic via npx, but if issues occur, update your config file or re-add the entry
140
- **🗑️ Uninstall:** Remove the "desktop-commander" entry from your claude_desktop_config.json file
141
+ **✅ Auto-Updates:** Yes - automatically updates when you restart Claude
142
+ **🔄 Manual Update:** Run the setup command again
143
+ **🗑️ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest remove` or remove the "desktop-commander" entry from your claude_desktop_config.json file
141
144
 
142
- ### Option 5: Checkout locally ❌ **Manual Updates**
145
+ ### ### Option 5: Checkout locally ❌ **Manual Updates** **Requires Node.js** ❌ **Manual Updates** **Requires Node.js**
143
146
  1. Clone and build:
144
147
  ```bash
145
148
  git clone https://github.com/wonderwhy-er/DesktopCommanderMCP.git
@@ -156,26 +159,223 @@ The setup command will:
156
159
 
157
160
  **❌ Auto-Updates:** No - requires manual git updates
158
161
  **🔄 Manual Update:** `cd DesktopCommanderMCP && git pull && npm run setup`
159
- **🗑️ Uninstall:** Remove the cloned directory and remove MCP server entry from Claude config
162
+ **🗑️ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest remove` or remove the cloned directory and remove MCP server entry from Claude config
163
+
164
+ ### Option 6: Docker Installation 🐳 ⭐ **Auto-Updates** **No Node.js Required**
165
+
166
+ Perfect for users who want complete or partial isolation or don't have Node.js installed. Desktop Commander runs in a sandboxed Docker container with a persistent work environment.
167
+
168
+ #### Prerequisites
169
+ - [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed **and running**
170
+ - Claude Desktop app installed
171
+
172
+ **Important:** Make sure Docker Desktop is fully started before running the installer.
173
+
174
+ #### Automated Installation (Recommended)
175
+
176
+ **macOS/Linux:**
177
+ ```bash
178
+ bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh)
179
+ ```
180
+
181
+ **Windows PowerShell:**
182
+ ```powershell
183
+ # Download and run the installer (one-liner)
184
+ iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'))
185
+ ```
186
+
187
+ The automated installer will:
188
+ - Check Docker installation
189
+ - Pull the latest Docker image
190
+ - Prompt you to select folders for mounting
191
+ - Configure Claude Desktop automatically
192
+ - Restart Claude if possible
193
+
194
+ #### How Docker Persistence Works
195
+ Desktop Commander creates a persistent work environment that remembers everything between sessions:
196
+ - **Your development tools**: Any software you install (Node.js, Python, databases, etc.) stays installed
197
+ - **Your configurations**: Git settings, SSH keys, shell preferences, and other personal configs are preserved
198
+ - **Your work files**: Projects and files in the workspace area persist across restarts
199
+ - **Package caches**: Downloaded packages and dependencies are cached for faster future installs
200
+
201
+ Think of it like having your own dedicated development computer that never loses your setup, but runs safely isolated from your main system.
202
+
203
+ #### Manual Docker Configuration
204
+
205
+ If you prefer manual setup, add this to your claude_desktop_config.json:
206
+
207
+ **Basic setup (no file access):**
208
+ ```json
209
+ {
210
+ "mcpServers": {
211
+ "desktop-commander-in-docker": {
212
+ "command": "docker",
213
+ "args": [
214
+ "run",
215
+ "-i",
216
+ "--rm",
217
+ "mcp/desktop-commander:latest"
218
+ ]
219
+ }
220
+ }
221
+ }
222
+ ```
223
+
224
+ **With folder mounting:**
225
+ ```json
226
+ {
227
+ "mcpServers": {
228
+ "desktop-commander-in-docker": {
229
+ "command": "docker",
230
+ "args": [
231
+ "run",
232
+ "-i",
233
+ "--rm",
234
+ "-v", "/Users/username/Desktop:/mnt/desktop",
235
+ "-v", "/Users/username/Documents:/mnt/documents",
236
+ "mcp/desktop-commander:latest"
237
+ ]
238
+ }
239
+ }
240
+ }
241
+ ```
242
+
243
+ **Advanced folder mounting:**
244
+ ```json
245
+ {
246
+ "mcpServers": {
247
+ "desktop-commander-in-docker": {
248
+ "command": "docker",
249
+ "args": [
250
+ "run", "-i", "--rm",
251
+ "-v", "dc-system:/usr",
252
+ "-v", "dc-home:/root",
253
+ "-v", "dc-workspace:/workspace",
254
+ "-v", "dc-packages:/var",
255
+ "-v", "/Users/username/Projects:/mnt/Projects",
256
+ "-v", "/Users/username/Downloads:/mnt/Downloads",
257
+ "mcp/desktop-commander:latest"
258
+ ]
259
+ }
260
+ }
261
+ }
262
+ ```
263
+
264
+ #### Docker Benefits
265
+ ✅ **Controlled Isolation:** Runs in sandboxed environment with persistent development state
266
+ ✅ **No Node.js Required:** Everything included in the container
267
+ ✅ **Cross-Platform:** Same experience on all operating systems
268
+ ✅ **Persistent Environment:** Your tools, files, configs, and work survives restarts
269
+
270
+ **✅ Auto-Updates:** Yes - `latest` tag automatically gets newer versions
271
+ **🔄 Manual Update:** `docker pull mcp/desktop-commander:latest` then restart Claude
272
+
273
+ #### Docker Management Commands
274
+
275
+ **macOS/Linux:**
276
+
277
+ Check installation status:
278
+ ```bash
279
+ bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh) --status
280
+ ```
281
+
282
+ Reset all persistent data (removes all installed tools and configs):
283
+ ```bash
284
+ bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh) --reset
285
+ ```
286
+
287
+ **Windows PowerShell:**
288
+
289
+ Check status:
290
+ ```powershell
291
+ $script = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'); & ([ScriptBlock]::Create("$script")) -Status
292
+ ```
293
+
294
+ Reset all data:
295
+ ```powershell
296
+ $script = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'); & ([ScriptBlock]::Create("$script")) -Reset
297
+ ```
298
+
299
+ Show help:
300
+ ```powershell
301
+ $script = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'); & ([ScriptBlock]::Create("$script")) -Help
302
+ ```
303
+
304
+ Verbose output:
305
+ ```powershell
306
+ $script = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'); & ([ScriptBlock]::Create("$script")) -VerboseOutput
307
+ ```
308
+
309
+ #### Troubleshooting Docker Installation
310
+ If you broke the Docker container or need a fresh start:
311
+ ```bash
312
+ # Reset and reinstall from scratch
313
+ bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh) --reset && bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh)
314
+ ```
315
+ This will completely reset your persistent environment and reinstall everything fresh with exception of not touching mounted folders
160
316
 
161
317
  ## Updating & Uninstalling Desktop Commander
162
318
 
163
- ### Automatic Updates (Options 1 & 3 only)
164
- **Options 1 (npx) and 3 (Smithery)** automatically update to the latest version whenever you restart Claude. No manual intervention needed.
319
+ ### Automatic Updates (Options 1, 2, 3, 4 & 6)
320
+ **Options 1 (npx), Option 2 (bash installer), 3 (Smithery), 4 (manual config), and 6 (Docker)** automatically update to the latest version whenever you restart Claude. No manual intervention needed.
165
321
 
166
- ### Manual Updates (Options 2, 4 & 5)
167
- - **Option 2 (bash installer):** Re-run the curl command
168
- - **Option 4 (manual config):** Usually automatic via npx, but re-add config entry if issues occur
322
+ ### Manual Updates (Option 5)
169
323
  - **Option 5 (local checkout):** `cd DesktopCommanderMCP && git pull && npm run setup`
170
324
 
171
325
  ### Uninstalling Desktop Commander
172
- - **Option 1:** `npx @wonderwhy-er/desktop-commander@latest setup --uninstall`
173
- - **Option 2:** Remove MCP server entry from Claude config and delete any cloned repositories
174
- - **Option 3:** `npx -y @smithery/cli uninstall @wonderwhy-er/desktop-commander --client claude`
175
- - **Option 4:** Remove the "desktop-commander" entry from your claude_desktop_config.json file
176
- - **Option 5:** Delete the cloned directory and remove MCP server entry from Claude config
326
+ #### 🤖 Automatic Uninstallation (Recommended)
327
+
328
+ The easiest way to completely remove Desktop Commander:
329
+
330
+ ```bash
331
+ npx @wonderwhy-er/desktop-commander@latest remove
332
+ ```
333
+
334
+ This automatic uninstaller will:
335
+ - ✅ Remove Desktop Commander from Claude's MCP server configuration
336
+ - ✅ Create a backup of your Claude config before making changes
337
+ - ✅ Provide guidance for complete package removal
338
+ - ✅ Restore from backup if anything goes wrong
339
+
340
+ #### 🔧 Manual Uninstallation
341
+
342
+ If the automatic uninstaller doesn't work or you prefer manual removal:
343
+
344
+ ##### Remove from Claude Configuration
345
+
346
+ 1. **Locate your Claude Desktop config file:**
347
+ - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
348
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
349
+ - **Linux:** `~/.config/Claude/claude_desktop_config.json`
350
+
351
+ 2. **Edit the config file:**
352
+ - Open the file in a text editor
353
+ - Find and remove the `"desktop-commander"` entry from the `"mcpServers"` section
354
+ - Save the file
355
+
356
+ **Example - Remove this section:**
357
+ ```json
358
+ {
359
+ "desktop-commander": {
360
+ "command": "npx",
361
+ "args": ["@wonderwhy-er/desktop-commander@latest"]
362
+ }
363
+ }
364
+ ```
365
+
366
+ Close and restart Claude Desktop to complete the removal.
367
+
368
+ #### 🆘 Troubleshooting
369
+
370
+ **If automatic uninstallation fails:**
371
+ - Use manual uninstallation as a fallback
372
+
373
+ **If Claude won't start after uninstalling:**
374
+ - Restore the backup config file created by the uninstaller
375
+ - Or manually fix the JSON syntax in your claude_desktop_config.json
177
376
 
178
- After uninstalling, restart Claude Desktop to complete the removal.
377
+ **Need help?**
378
+ - Join our Discord community: https://discord.com/invite/kQ27sNnZr7
179
379
 
180
380
  ## Usage
181
381
 
@@ -502,7 +702,7 @@ Terminal still can access files ignoring allowed directories.
502
702
  - **28-03-2025 Fixed "Watching /" JSON error** - Implemented custom stdio transport to handle non-JSON messages and prevent server crashes
503
703
  - **25-03-2025 Better code search** ([merged](https://github.com/wonderwhy-er/ClaudeServerCommander/pull/17)) - Enhanced code exploration with context-aware results
504
704
 
505
- ## Work in Progress/TODOs/Roadmap
705
+ ## Roadmap
506
706
 
507
707
  The following features are currently being explored:
508
708
 
@@ -514,7 +714,7 @@ The following features are currently being explored:
514
714
  - **Interactive shell support** - ssh, node/python repl
515
715
  - **Improve large file reading and writing**
516
716
 
517
- ## ❤️ Support Desktop Commander
717
+ ## Support Desktop Commander
518
718
 
519
719
  <div align="center">
520
720
  <h3>📢 SUPPORT THIS PROJECT</h3>
@@ -533,7 +733,7 @@ The following features are currently being explored:
533
733
  </div>
534
734
 
535
735
 
536
- ### Supporters Hall of Fame
736
+ ### ❤️ Supporters Hall of Fame
537
737
 
538
738
  Generous supporters are featured here. Thank you for helping make this project possible!
539
739
 
package/dist/server.js CHANGED
@@ -14,6 +14,7 @@ import { getUsageStats } from './tools/usage.js';
14
14
  import { giveFeedbackToDesktopCommander } from './tools/feedback.js';
15
15
  import { trackToolCall } from './utils/trackTools.js';
16
16
  import { usageTracker } from './utils/usageTracker.js';
17
+ import { processDockerPrompt } from './utils/dockerPrompt.js';
17
18
  import { VERSION } from './version.js';
18
19
  import { capture, capture_call_tool } from "./utils/capture.js";
19
20
  console.error("Loading server.ts");
@@ -739,6 +740,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
739
740
  // Mark that we've prompted (to prevent spam)
740
741
  await usageTracker.markFeedbackPrompted();
741
742
  }
743
+ // Check if should prompt about Docker environment
744
+ result = await processDockerPrompt(result, name);
742
745
  }
743
746
  return result;
744
747
  }
@@ -1,4 +1,6 @@
1
1
  import { homedir, platform } from 'os';
2
+ import fs from 'fs/promises';
3
+ import path from 'path';
2
4
  import { join } from 'path';
3
5
  import { readFileSync, writeFileSync, existsSync, appendFileSync, mkdirSync } from 'fs';
4
6
  import { fileURLToPath } from 'url';
@@ -29,6 +31,96 @@ try {
29
31
  let setupSteps = []; // Track setup progress
30
32
  let setupStartTime = Date.now();
31
33
 
34
+ /**
35
+ * Initialize configuration - load from disk or create default
36
+ */
37
+ async function initConfigFile() {
38
+ const USER_HOME = homedir();
39
+ const CONFIG_DIR = path.join(USER_HOME, '.claude-server-commander');
40
+
41
+ // Paths relative to the config directory
42
+ const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
43
+ try {
44
+ // Ensure config directory exists
45
+ const configDir = path.dirname(CONFIG_FILE);
46
+ if (!existsSync(configDir)) {
47
+ await mkdir(configDir, { recursive: true });
48
+ }
49
+
50
+ // Check if config file exists
51
+ try {
52
+ await fs.access(CONFIG_FILE);
53
+ // Load existing config
54
+ const configData = await fs.readFile(CONFIG_FILE, 'utf8');
55
+ } catch (error) {
56
+ const defaultConfig = {
57
+ blockedCommands: [
58
+
59
+ // Disk and partition management
60
+ "mkfs", // Create a filesystem on a device
61
+ "format", // Format a storage device (cross-platform)
62
+ "mount", // Mount a filesystem
63
+ "umount", // Unmount a filesystem
64
+ "fdisk", // Manipulate disk partition tables
65
+ "dd", // Convert and copy files, can write directly to disks
66
+ "parted", // Disk partition manipulator
67
+ "diskpart", // Windows disk partitioning utility
68
+
69
+ // System administration and user management
70
+ "sudo", // Execute command as superuser
71
+ "su", // Substitute user identity
72
+ "passwd", // Change user password
73
+ "adduser", // Add a user to the system
74
+ "useradd", // Create a new user
75
+ "usermod", // Modify user account
76
+ "groupadd", // Create a new group
77
+ "chsh", // Change login shell
78
+ "visudo", // Edit the sudoers file
79
+
80
+ // System control
81
+ "shutdown", // Shutdown the system
82
+ "reboot", // Restart the system
83
+ "halt", // Stop the system
84
+ "poweroff", // Power off the system
85
+ "init", // Change system runlevel
86
+
87
+ // Network and security
88
+ "iptables", // Linux firewall administration
89
+ "firewall", // Generic firewall command
90
+ "netsh", // Windows network configuration
91
+
92
+ // Windows system commands
93
+ "sfc", // System File Checker
94
+ "bcdedit", // Boot Configuration Data editor
95
+ "reg", // Windows registry editor
96
+ "net", // Network/user/service management
97
+ "sc", // Service Control manager
98
+ "runas", // Execute command as another user
99
+ "cipher", // Encrypt/decrypt files or wipe data
100
+ "takeown" // Take ownership of files
101
+ ],
102
+ clientId: uniqueUserId, // Use the generated UUID as client ID
103
+ defaultShell: platform() === 'win32' ? 'powershell.exe' : '/bin/sh',
104
+ allowedDirectories: [],
105
+ telemetryEnabled: true, // Default to opt-out approach (telemetry on by default)
106
+ fileWriteLineLimit: 50, // Default line limit for file write operations (changed from 100)
107
+ fileReadLineLimit: 1000 // Default line limit for file read operations (changed from character-based)
108
+ };
109
+ logToFile('User id ' + uniqueUserId);
110
+ try {
111
+ await fs.writeFile(CONFIG_FILE, JSON.stringify(defaultConfig, null, 2), 'utf8');
112
+ } catch (error) {
113
+ console.error('Failed to save config:', error);
114
+ throw error;
115
+ }
116
+ }
117
+
118
+ } catch (error) {
119
+ console.error('Failed to initialize config:', error);
120
+ }
121
+ }
122
+
123
+
32
124
 
33
125
  // Function to get npm version
34
126
  async function getNpmVersion() {
@@ -488,7 +580,17 @@ async function restartClaude() {
488
580
  logToFile('\nThe server is available as "desktop-commander" in Claude\'s MCP server list');
489
581
 
490
582
  logToFile("Future updates will install automatically — no need to run this setup again.\n\n");
491
- logToFile("💬 Need help or found an issue? Join our community: https://discord.com/invite/kQ27sNnZr7\n\n")
583
+ logToFile("🤔 Need help or have feedback? Happy to jump on a quick call: \n\n")
584
+ logToFile("https://calendar.app.google/SHMNZN5MJznJWC5A7 \n\n")
585
+ logToFile("or join our community: https://discord.com/invite/kQ27sNnZr7\n\n")
586
+
587
+
588
+
589
+
590
+
591
+
592
+
593
+
492
594
  updateSetupStep(restartStep, 'completed');
493
595
  await trackEvent('npx_setup_restart_claude_success', { platform });
494
596
  } catch (startError) {
@@ -532,6 +634,7 @@ export default async function setup() {
532
634
  }
533
635
 
534
636
  try {
637
+ await initConfigFile();
535
638
  // Check if config directory exists and create it if necessary
536
639
  const configDirStep = addSetupStep('check_config_directory');
537
640
  const configDir = dirname(claudeConfigPath);
@@ -141,7 +141,7 @@ export class TerminalManager {
141
141
  // Store completed session before removing active session
142
142
  this.completedSessions.set(childProcess.pid, {
143
143
  pid: childProcess.pid,
144
- output: output + session.lastOutput, // Combine all output
144
+ output: output, // Use only the main output variable
145
145
  exitCode: code,
146
146
  startTime: session.startTime,
147
147
  endTime: new Date()
@@ -172,9 +172,15 @@ export class TerminalManager {
172
172
  // Then check completed sessions
173
173
  const completedSession = this.completedSessions.get(pid);
174
174
  if (completedSession) {
175
- // Format completion message with exit code and runtime
175
+ // Format with output first, then completion info
176
176
  const runtime = (completedSession.endTime.getTime() - completedSession.startTime.getTime()) / 1000;
177
- return `Process completed with exit code ${completedSession.exitCode}\nRuntime: ${runtime}s\nFinal output:\n${completedSession.output}`;
177
+ const output = completedSession.output.trim();
178
+ if (output) {
179
+ return `${output}\n\nProcess completed with exit code ${completedSession.exitCode}\nRuntime: ${runtime}s`;
180
+ }
181
+ else {
182
+ return `Process completed with exit code ${completedSession.exitCode}\nRuntime: ${runtime}s\n(No output produced)`;
183
+ }
178
184
  }
179
185
  return null;
180
186
  }
@@ -22,6 +22,7 @@ export async function getConfig() {
22
22
  isWindows: systemInfo.isWindows,
23
23
  isMacOS: systemInfo.isMacOS,
24
24
  isLinux: systemInfo.isLinux,
25
+ docker: systemInfo.docker,
25
26
  examplePaths: systemInfo.examplePaths
26
27
  }
27
28
  };
@@ -97,8 +97,19 @@ export async function readProcessOutput(args) {
97
97
  const { pid, timeout_ms = 5000 } = parsed.data;
98
98
  const session = terminalManager.getSession(pid);
99
99
  if (!session) {
100
+ // Check if this is a completed session
101
+ const completedOutput = terminalManager.getNewOutput(pid);
102
+ if (completedOutput) {
103
+ return {
104
+ content: [{
105
+ type: "text",
106
+ text: completedOutput
107
+ }],
108
+ };
109
+ }
110
+ // Neither active nor completed session found
100
111
  return {
101
- content: [{ type: "text", text: `No active session found for PID ${pid}` }],
112
+ content: [{ type: "text", text: `No session found for PID ${pid}` }],
102
113
  isError: true,
103
114
  };
104
115
  }
@@ -55,8 +55,8 @@ export declare const ReadFileArgsSchema: z.ZodObject<{
55
55
  offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
56
56
  length: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
57
57
  }, "strip", z.ZodTypeAny, {
58
- path: string;
59
58
  length: number;
59
+ path: string;
60
60
  isUrl: boolean;
61
61
  offset: number;
62
62
  }, {