inboxd 1.0.3 ā 1.0.5
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 +22 -0
- package/package.json +1 -1
- 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/README.md
CHANGED
|
@@ -141,6 +141,28 @@ Or use the `analyze` command for structured output:
|
|
|
141
141
|
inbox analyze --count 20
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
+
## Uninstalling
|
|
145
|
+
|
|
146
|
+
To remove the package:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
npm uninstall -g inboxd
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
To also remove all account data and tokens:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
inbox logout --all
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
To completely remove all data including credentials:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
rm -rf ~/.config/inboxd
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Note:** `npm uninstall` only removes the package itself. Your OAuth credentials and account data in `~/.config/inboxd/` are preserved so you can reinstall without reconfiguring. Use the commands above if you want to remove that data.
|
|
165
|
+
|
|
144
166
|
## Troubleshooting
|
|
145
167
|
|
|
146
168
|
**"credentials.json not found"**
|
package/package.json
CHANGED
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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(
|
|
95
|
-
const email = await getAccountEmail(
|
|
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('
|
|
123
|
+
const openConsole = await prompt(rl, chalk.white(' Open Google Cloud Console? (Y/n): '));
|
|
119
124
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
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(
|
|
180
|
-
const email = await getAccountEmail(
|
|
184
|
+
await authorize(tempName);
|
|
185
|
+
const email = await getAccountEmail(tempName);
|
|
181
186
|
|
|
182
187
|
if (email) {
|
|
183
|
-
|
|
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'));
|