inboxd 1.0.6 → 1.0.7

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.
@@ -64,6 +64,25 @@ This will guide you through:
64
64
  2. Authenticating your Gmail account
65
65
  ```
66
66
 
67
+ ### Optional: Automatic Background Monitoring
68
+
69
+ Users can enable automatic inbox checking with macOS notifications:
70
+
71
+ ```bash
72
+ inbox install-service # Check every 5 minutes
73
+ inbox install-service --interval 10 # Check every 10 minutes
74
+ ```
75
+
76
+ This installs and starts a background service that:
77
+ - Checks for new emails automatically
78
+ - Sends macOS notifications when new emails arrive
79
+ - Starts on login
80
+
81
+ To stop: `launchctl unload ~/Library/LaunchAgents/com.danielparedes.inboxd.plist`
82
+
83
+ > [!NOTE]
84
+ > This is macOS-only. Linux users can set up a cron job instead.
85
+
67
86
  ## Command Reference
68
87
 
69
88
  ### Status & Reading
package/CLAUDE.md CHANGED
@@ -64,7 +64,7 @@ All user data lives in `~/.config/inboxd/`:
64
64
  - `inbox check` marks emails as seen after notifying
65
65
  - `inbox delete` logs to `deletion-log.json` before trashing
66
66
  - `inbox restore` moves from Trash to Inbox, removes log entry
67
- - `install-service` generates launchd plist dynamically (macOS only, warns on other platforms)
67
+ - `install-service` creates and automatically enables launchd service (macOS only, warns on other platforms)
68
68
 
69
69
  ## OAuth Notes
70
70
 
package/README.md CHANGED
@@ -102,14 +102,14 @@ All configuration is stored in `~/.config/inboxd/`:
102
102
  Install as a macOS launchd service to check for new emails periodically:
103
103
 
104
104
  ```bash
105
- # Install with default 5-minute interval
105
+ # Install and start with default 5-minute interval
106
106
  inbox install-service
107
107
 
108
108
  # Or customize the interval
109
109
  inbox install-service --interval 10
110
110
  ```
111
111
 
112
- Manage the service:
112
+ The service starts automatically after installation. Manage it with:
113
113
 
114
114
  ```bash
115
115
  # Check status
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inboxd",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "CLI assistant for Gmail monitoring with multi-account support and AI-ready JSON output",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -785,13 +785,35 @@ async function main() {
785
785
  }
786
786
 
787
787
  fs.writeFileSync(plistPath, plistContent);
788
- console.log(chalk.green(`\nService configuration generated at: ${plistPath}`));
789
- console.log(chalk.white('To enable the background service, run:'));
790
- console.log(chalk.cyan(` launchctl unload ${plistPath} 2>/dev/null`));
791
- console.log(chalk.cyan(` launchctl load ${plistPath}`));
792
- console.log('');
788
+
789
+ // Automatically load the service
790
+ const { execSync } = require('child_process');
791
+
792
+ // Unload any existing service (ignore errors if not loaded)
793
+ try {
794
+ execSync(`launchctl unload "${plistPath}" 2>/dev/null`, { stdio: 'ignore' });
795
+ } catch {
796
+ // Ignore - service may not be loaded yet
797
+ }
798
+
799
+ // Load the new service
800
+ execSync(`launchctl load "${plistPath}"`);
801
+
802
+ console.log(chalk.green(`\n✓ Background service installed and running!`));
803
+ console.log(chalk.gray(` Config: ${plistPath}`));
804
+ console.log(chalk.gray(` Interval: every ${interval} minutes`));
805
+ console.log(chalk.gray(` Logs: /tmp/inboxd.log\n`));
806
+ console.log(chalk.white('The service will:'));
807
+ console.log(chalk.gray(' • Check your inbox automatically'));
808
+ console.log(chalk.gray(' • Send notifications for new emails'));
809
+ console.log(chalk.gray(' • Start on login\n'));
810
+ console.log(chalk.white('To stop the service:'));
811
+ console.log(chalk.cyan(` launchctl unload "${plistPath}"\n`));
793
812
  } catch (error) {
794
- console.error(chalk.red('Error creating service file:'), error.message);
813
+ console.error(chalk.red('Error installing service:'), error.message);
814
+ console.log(chalk.yellow('\nThe config file was created but could not be loaded.'));
815
+ console.log(chalk.white('Try running manually:'));
816
+ console.log(chalk.cyan(` launchctl load "${plistPath}"\n`));
795
817
  }
796
818
  });
797
819