shell-mirror 1.2.0 → 1.2.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.
package/lib/auto-start.js CHANGED
@@ -16,8 +16,8 @@ class AutoStart {
16
16
  // Shell Mirror OAuth App credentials (production)
17
17
  this.oauthConfig = {
18
18
  clientId: '804759223392-i5nv5csn1o6siqr760c99l2a9k4sammp.apps.googleusercontent.com',
19
- clientSecret: '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',
20
- redirectUri: 'http://localhost:3000/auth/google/callback'
19
+ clientSecret: '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',
20
+ redirectUri: 'http://localhost:8080/auth/google/callback'
21
21
  };
22
22
  }
23
23
 
@@ -193,7 +193,7 @@ class AutoStart {
193
193
  }
194
194
  });
195
195
 
196
- serverInstance = app.listen(3000, (err) => {
196
+ serverInstance = app.listen(8080, (err) => {
197
197
  if (err) {
198
198
  reject(err);
199
199
  } else {
@@ -208,8 +208,8 @@ class AutoStart {
208
208
  const envContent = `# Shell Mirror Configuration
209
209
  # Auto-generated on ${new Date().toISOString()}
210
210
 
211
- BASE_URL=http://localhost:3000
212
- PORT=3000
211
+ BASE_URL=http://localhost:8080
212
+ PORT=8080
213
213
  HOST=0.0.0.0
214
214
  GOOGLE_CLIENT_ID=${this.oauthConfig.clientId}
215
215
  GOOGLE_CLIENT_SECRET=${this.oauthConfig.clientSecret}
@@ -224,16 +224,21 @@ NODE_ENV=development
224
224
  console.log('🔄 Starting Shell Mirror server...');
225
225
  console.log('');
226
226
 
227
+ // Find the package root directory (where server.js is located)
228
+ const packageRoot = path.resolve(__dirname, '..');
229
+ const serverPath = path.join(packageRoot, 'server.js');
230
+
227
231
  // Start the server in background
228
- const serverProcess = spawn('node', ['server.js'], {
232
+ const serverProcess = spawn('node', [serverPath], {
229
233
  stdio: 'pipe',
230
- cwd: path.dirname(this.envFile)
234
+ cwd: path.dirname(this.envFile),
235
+ env: { ...process.env }
231
236
  });
232
237
 
233
238
  // Wait a moment for server to start
234
239
  setTimeout(() => {
235
240
  this.displayLoginInstructions();
236
- this.openBrowser('http://localhost:3000');
241
+ this.openBrowser('http://localhost:8080');
237
242
  }, 2000);
238
243
 
239
244
  // Handle Ctrl+C gracefully
@@ -255,7 +260,7 @@ NODE_ENV=development
255
260
 
256
261
  displayLoginInstructions() {
257
262
  console.log('✅ Shell Mirror server is running');
258
- console.log('🌐 Local server: http://localhost:3000');
263
+ console.log('🌐 Local server: http://localhost:8080');
259
264
  console.log('📱 Access from phone: https://shellmirror.app');
260
265
  console.log('');
261
266
  console.log('🔐 First-time setup:');
@@ -377,10 +382,15 @@ NODE_ENV=development
377
382
  console.log('🔄 Starting server...');
378
383
  console.log('');
379
384
 
385
+ // Find the package root directory (where server.js is located)
386
+ const packageRoot = path.resolve(__dirname, '..');
387
+ const serverPath = path.join(packageRoot, 'server.js');
388
+
380
389
  // Start the main server process
381
- const serverProcess = spawn('node', ['server.js'], {
390
+ const serverProcess = spawn('node', [serverPath], {
382
391
  stdio: 'inherit',
383
- cwd: path.dirname(this.envFile)
392
+ cwd: path.dirname(this.envFile),
393
+ env: { ...process.env }
384
394
  });
385
395
 
386
396
  // Display status information
@@ -407,8 +417,8 @@ NODE_ENV=development
407
417
  const envContent = `# Shell Mirror Configuration
408
418
  # Auto-generated on ${new Date().toISOString()}
409
419
 
410
- BASE_URL=http://localhost:3000
411
- PORT=3000
420
+ BASE_URL=http://localhost:8080
421
+ PORT=8080
412
422
  HOST=0.0.0.0
413
423
  GOOGLE_CLIENT_ID=${this.oauthConfig.clientId}
414
424
  GOOGLE_CLIENT_SECRET=${this.oauthConfig.clientSecret}
@@ -427,7 +437,7 @@ ACCESS_TOKEN=${authInfo.accessToken}
427
437
  displayStatus(authInfo) {
428
438
  console.log('✅ Shell Mirror is running');
429
439
  console.log(`👤 Logged in as: ${authInfo.email}`);
430
- console.log('🌐 Local server: http://localhost:3000');
440
+ console.log('🌐 Local server: http://localhost:8080');
431
441
  console.log('📱 Access from phone: https://shellmirror.app');
432
442
  console.log('');
433
443
  console.log('â„šī¸ To use from your phone:');
@@ -446,10 +456,15 @@ ACCESS_TOKEN=${authInfo.accessToken}
446
456
  // Create .env file with authentication
447
457
  await this.createEnvFile(authInfo);
448
458
 
459
+ // Find the package root directory (where server.js is located)
460
+ const packageRoot = path.resolve(__dirname, '..');
461
+ const serverPath = path.join(packageRoot, 'server.js');
462
+
449
463
  // Start the main server process
450
- const serverProcess = spawn('node', ['server.js'], {
464
+ const serverProcess = spawn('node', [serverPath], {
451
465
  stdio: 'inherit',
452
- cwd: path.dirname(this.envFile)
466
+ cwd: path.dirname(this.envFile),
467
+ env: { ...process.env }
453
468
  });
454
469
 
455
470
  // Display status information
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shell-mirror",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Access your Mac shell from any device securely. Perfect for mobile coding with Claude Code CLI, Gemini CLI, and any shell tool.",
5
5
  "main": "server.js",
6
6
  "bin": {
package/public/index.html CHANGED
@@ -729,7 +729,7 @@
729
729
  // Check if local server is running
730
730
  async function checkLocalServer() {
731
731
  try {
732
- const response = await fetch('http://localhost:3000/api/auth/status', {
732
+ const response = await fetch('http://localhost:8080/api/auth/status', {
733
733
  method: 'GET',
734
734
  timeout: 2000
735
735
  });
@@ -749,7 +749,7 @@
749
749
  }
750
750
 
751
751
  // Redirect to Google OAuth
752
- window.location.href = 'http://localhost:3000/auth/google';
752
+ window.location.href = 'http://localhost:8080/auth/google';
753
753
  }
754
754
 
755
755
  // Show installation reminder modal