@mohitkumawat/warmup-cli 1.2.6 → 1.2.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohitkumawat/warmup-cli",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "Pre-warm your Claude rate limits while you sleep. One command, zero daily effort.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -1,16 +1,46 @@
1
1
  'use strict';
2
2
 
3
- if (process.env.npm_config_global !== 'true') {
3
+ const isGlobal = process.env.npm_config_global === 'true';
4
+
5
+ if (!isGlobal) {
4
6
  process.exit(0);
5
7
  }
6
8
 
7
- const message = [
8
- '',
9
- 'WarmUp installed successfully.',
10
- 'Run `warmup` to start the guided setup.',
11
- 'Run `warmup --help` to see all commands.',
12
- 'Claude Code must already be installed and authenticated.',
13
- '',
14
- ].join('\n');
9
+ // Simple color codes to avoid dependency issues during postinstall
10
+ const reset = '\x1b[0m';
11
+ const bright = '\x1b[1m';
12
+ const green = '\x1b[32m';
13
+ const yellow = '\x1b[33m';
14
+ const cyan = '\x1b[36m';
15
+
16
+ const message = `
17
+ ${bright}${green}WarmUp CLI has been installed successfully!${reset}
18
+ Starting initial setup...
19
+ `;
15
20
 
16
21
  process.stdout.write(message);
22
+
23
+ // Automatically trigger "warmup setup" if we are in an interactive terminal
24
+ if (process.stdout.isTTY) {
25
+ try {
26
+ const { execSync } = require('child_process');
27
+
28
+ // We run it synchronously so the user is immediately dropped into the setup prompt
29
+ execSync('warmup setup', { stdio: 'inherit' });
30
+ } catch (err) {
31
+ // If the warmup command isn't immediately available or fails, fallback to instructions
32
+ const fallbackMessage = `
33
+ ${bright}${yellow}Could not automatically start setup.${reset}
34
+ To finish the setup and start pre-warming Claude, please run:
35
+ ${bright}${cyan} warmup setup${reset}
36
+ `;
37
+ process.stdout.write(fallbackMessage);
38
+ }
39
+ } else {
40
+ // CI/CD or non-interactive environments
41
+ const fallbackMessage = `
42
+ To finish the setup and start pre-warming Claude, please run:
43
+ ${bright}${yellow} warmup setup${reset}
44
+ `;
45
+ process.stdout.write(fallbackMessage);
46
+ }