inboxd 1.0.2 ā 1.0.4
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/CLAUDE.md +9 -0
- package/README.md +6 -1
- package/images/banner.png +0 -0
- package/package.json +1 -1
- package/src/cli.js +38 -25
package/CLAUDE.md
CHANGED
|
@@ -71,3 +71,12 @@ All user data lives in `~/.config/inboxd/`:
|
|
|
71
71
|
- Gmail API requires OAuth consent screen with test users for external accounts
|
|
72
72
|
- Tokens auto-refresh; delete token file to force re-auth
|
|
73
73
|
- Credentials can be in project root (dev) or `~/.config/inboxd/` (installed)
|
|
74
|
+
|
|
75
|
+
## Release Process
|
|
76
|
+
|
|
77
|
+
1. Bump version in `package.json`
|
|
78
|
+
2. Commit changes
|
|
79
|
+
3. Create a GitHub Release (e.g., `gh release create v1.0.3`)
|
|
80
|
+
4. The `publish.yml` workflow will automatically test and publish to npm
|
|
81
|
+
- Note: `src/cli.js` dynamically imports version from `package.json` to ensure consistency
|
|
82
|
+
|
package/README.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Inboxd
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/inboxd)
|
|
4
|
+
[](https://www.npmjs.com/package/inboxd)
|
|
4
5
|
[](https://opensource.org/licenses/MIT)
|
|
5
6
|
|
|
7
|
+
<a href="https://buymeacoffee.com/dparedesi" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="50"></a>
|
|
8
|
+
|
|
6
9
|
A CLI tool for monitoring Gmail inboxes with multi-account support and macOS notifications.
|
|
7
10
|
|
|
11
|
+

|
|
12
|
+
|
|
8
13
|
## Features
|
|
9
14
|
|
|
10
15
|
- **Multi-account support** - Monitor multiple Gmail accounts from one command
|
|
Binary file
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -10,6 +10,7 @@ const readline = require('readline');
|
|
|
10
10
|
const path = require('path');
|
|
11
11
|
const os = require('os');
|
|
12
12
|
const fs = require('fs');
|
|
13
|
+
const pkg = require('../package.json');
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Prompts user for input
|
|
@@ -39,7 +40,7 @@ async function main() {
|
|
|
39
40
|
program
|
|
40
41
|
.name('inbox')
|
|
41
42
|
.description('Gmail monitoring CLI with multi-account support')
|
|
42
|
-
.version(
|
|
43
|
+
.version(pkg.version);
|
|
43
44
|
|
|
44
45
|
// Setup command - interactive wizard for first-time users
|
|
45
46
|
program
|
|
@@ -82,17 +83,22 @@ async function main() {
|
|
|
82
83
|
}
|
|
83
84
|
// Skip credentials step, go directly to auth
|
|
84
85
|
console.log(chalk.cyan('\nš Authenticate another Gmail account\n'));
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
rl.close();
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
86
|
+
let accountName = await prompt(rl, chalk.white(' What should we call this account? (Leave empty to use email): '));
|
|
87
|
+
const tempName = `temp_${Date.now()}`;
|
|
88
|
+
|
|
91
89
|
rl.close();
|
|
92
90
|
console.log(chalk.gray('\n A browser window will open for authorization...\n'));
|
|
93
|
-
await authorize(
|
|
94
|
-
const email = await getAccountEmail(
|
|
91
|
+
await authorize(tempName);
|
|
92
|
+
const email = await getAccountEmail(tempName);
|
|
93
|
+
|
|
95
94
|
if (email) {
|
|
95
|
+
if (accountName) {
|
|
96
|
+
renameTokenFile(tempName, accountName);
|
|
97
|
+
} else {
|
|
98
|
+
renameTokenFile(tempName, email);
|
|
99
|
+
accountName = email;
|
|
100
|
+
}
|
|
101
|
+
|
|
96
102
|
addAccount(accountName, email);
|
|
97
103
|
console.log(chalk.green(`\n ā Authenticated as ${email}\n`));
|
|
98
104
|
}
|
|
@@ -114,14 +120,18 @@ async function main() {
|
|
|
114
120
|
console.log(chalk.gray(' 4. Create credentials ā OAuth client ID ā Desktop app'));
|
|
115
121
|
console.log(chalk.gray(' 5. Download the JSON file\n'));
|
|
116
122
|
|
|
117
|
-
await prompt(rl, chalk.white('
|
|
123
|
+
const openConsole = await prompt(rl, chalk.white(' Open Google Cloud Console? (Y/n): '));
|
|
118
124
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
if (openConsole.toLowerCase() !== 'n' && openConsole.toLowerCase() !== 'no') {
|
|
126
|
+
try {
|
|
127
|
+
await open('https://console.cloud.google.com/apis/credentials');
|
|
128
|
+
console.log(chalk.green('\n ā Opened Google Cloud Console in your browser\n'));
|
|
129
|
+
} catch (_err) {
|
|
130
|
+
console.log(chalk.yellow('\n Could not open browser automatically.'));
|
|
131
|
+
console.log(chalk.white(' Please visit: https://console.cloud.google.com/apis/credentials\n'));
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
console.log(chalk.gray('\n Skipping browser open. URL: https://console.cloud.google.com/apis/credentials\n'));
|
|
125
135
|
}
|
|
126
136
|
|
|
127
137
|
// Step 2: Get credentials file
|
|
@@ -163,23 +173,26 @@ async function main() {
|
|
|
163
173
|
|
|
164
174
|
// Step 3: Authenticate
|
|
165
175
|
console.log(chalk.cyan('š Step 3: Authenticate your Gmail account\n'));
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
if (!accountName) {
|
|
169
|
-
console.log(chalk.yellow(' Using "default" as account name.'));
|
|
170
|
-
}
|
|
176
|
+
let accountName = await prompt(rl, chalk.white(' What should we call this account? (Leave empty to use email): '));
|
|
177
|
+
const tempName = `temp_${Date.now()}`;
|
|
171
178
|
|
|
172
|
-
const finalAccountName = accountName || 'default';
|
|
173
179
|
rl.close();
|
|
174
180
|
|
|
175
181
|
console.log(chalk.gray('\n A browser window will open for authorization...'));
|
|
176
182
|
console.log(chalk.gray(' Sign in and allow access to your Gmail.\n'));
|
|
177
183
|
|
|
178
|
-
await authorize(
|
|
179
|
-
const email = await getAccountEmail(
|
|
184
|
+
await authorize(tempName);
|
|
185
|
+
const email = await getAccountEmail(tempName);
|
|
180
186
|
|
|
181
187
|
if (email) {
|
|
182
|
-
|
|
188
|
+
if (accountName) {
|
|
189
|
+
renameTokenFile(tempName, accountName);
|
|
190
|
+
} else {
|
|
191
|
+
renameTokenFile(tempName, email);
|
|
192
|
+
accountName = email;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
addAccount(accountName, email);
|
|
183
196
|
console.log(chalk.green(` ā Authenticated as ${email}\n`));
|
|
184
197
|
} else {
|
|
185
198
|
console.log(chalk.yellow(' Warning: Could not verify email address.\n'));
|