inboxd 1.0.3 → 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.
Files changed (3) hide show
  1. package/CLAUDE.md +9 -0
  2. package/package.json +1 -1
  3. package/src/cli.js +36 -24
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inboxd",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
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
@@ -83,17 +83,22 @@ async function main() {
83
83
  }
84
84
  // Skip credentials step, go directly to auth
85
85
  console.log(chalk.cyan('\nšŸ” Authenticate another Gmail account\n'));
86
- const accountName = await prompt(rl, chalk.white(' What should we call this account? (e.g., work): '));
87
- if (!accountName) {
88
- console.log(chalk.yellow('Account name is required.'));
89
- rl.close();
90
- return;
91
- }
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
+
92
89
  rl.close();
93
90
  console.log(chalk.gray('\n A browser window will open for authorization...\n'));
94
- await authorize(accountName);
95
- const email = await getAccountEmail(accountName);
91
+ await authorize(tempName);
92
+ const email = await getAccountEmail(tempName);
93
+
96
94
  if (email) {
95
+ if (accountName) {
96
+ renameTokenFile(tempName, accountName);
97
+ } else {
98
+ renameTokenFile(tempName, email);
99
+ accountName = email;
100
+ }
101
+
97
102
  addAccount(accountName, email);
98
103
  console.log(chalk.green(`\n āœ“ Authenticated as ${email}\n`));
99
104
  }
@@ -115,14 +120,18 @@ async function main() {
115
120
  console.log(chalk.gray(' 4. Create credentials → OAuth client ID → Desktop app'));
116
121
  console.log(chalk.gray(' 5. Download the JSON file\n'));
117
122
 
118
- await prompt(rl, chalk.white(' Press Enter to open Google Cloud Console...'));
123
+ const openConsole = await prompt(rl, chalk.white(' Open Google Cloud Console? (Y/n): '));
119
124
 
120
- try {
121
- await open('https://console.cloud.google.com/apis/credentials');
122
- console.log(chalk.green('\n āœ“ Opened Google Cloud Console in your browser\n'));
123
- } catch (_err) {
124
- console.log(chalk.yellow('\n Could not open browser automatically.'));
125
- console.log(chalk.white(' Please visit: https://console.cloud.google.com/apis/credentials\n'));
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'));
126
135
  }
127
136
 
128
137
  // Step 2: Get credentials file
@@ -164,23 +173,26 @@ async function main() {
164
173
 
165
174
  // Step 3: Authenticate
166
175
  console.log(chalk.cyan('šŸ” Step 3: Authenticate your Gmail account\n'));
167
- const accountName = await prompt(rl, chalk.white(' What should we call this account? (e.g., personal, work): '));
168
-
169
- if (!accountName) {
170
- console.log(chalk.yellow(' Using "default" as account name.'));
171
- }
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()}`;
172
178
 
173
- const finalAccountName = accountName || 'default';
174
179
  rl.close();
175
180
 
176
181
  console.log(chalk.gray('\n A browser window will open for authorization...'));
177
182
  console.log(chalk.gray(' Sign in and allow access to your Gmail.\n'));
178
183
 
179
- await authorize(finalAccountName);
180
- const email = await getAccountEmail(finalAccountName);
184
+ await authorize(tempName);
185
+ const email = await getAccountEmail(tempName);
181
186
 
182
187
  if (email) {
183
- addAccount(finalAccountName, email);
188
+ if (accountName) {
189
+ renameTokenFile(tempName, accountName);
190
+ } else {
191
+ renameTokenFile(tempName, email);
192
+ accountName = email;
193
+ }
194
+
195
+ addAccount(accountName, email);
184
196
  console.log(chalk.green(` āœ“ Authenticated as ${email}\n`));
185
197
  } else {
186
198
  console.log(chalk.yellow(' Warning: Could not verify email address.\n'));