@girardmedia/bootspring 2.1.2 → 2.2.0

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/cli/dashboard.js DELETED
@@ -1,123 +0,0 @@
1
- /**
2
- * Bootspring Dashboard Command
3
- *
4
- * Opens the cloud dashboard at bootspring.com/dashboard.
5
- * The local dashboard has been removed in favor of the cloud version.
6
- *
7
- * @package bootspring
8
- * @command dashboard
9
- */
10
-
11
- const { exec } = require('child_process');
12
- const auth = require('../core/auth');
13
-
14
- // ANSI colors
15
- const colors = {
16
- reset: '\x1b[0m',
17
- bold: '\x1b[1m',
18
- dim: '\x1b[2m',
19
- green: '\x1b[32m',
20
- yellow: '\x1b[33m',
21
- cyan: '\x1b[36m'
22
- };
23
-
24
- const DASHBOARD_URL = 'https://bootspring.com/dashboard';
25
-
26
- /**
27
- * Open URL in default browser
28
- */
29
- function openBrowser(url) {
30
- const platform = process.platform;
31
-
32
- let command;
33
- if (platform === 'darwin') {
34
- command = `open "${url}"`;
35
- } else if (platform === 'win32') {
36
- command = `start "" "${url}"`;
37
- } else {
38
- command = `xdg-open "${url}"`;
39
- }
40
-
41
- exec(command, (error) => {
42
- if (error) {
43
- console.log(`${colors.dim}Could not open browser automatically.${colors.reset}`);
44
- console.log(`${colors.dim}Please visit: ${url}${colors.reset}`);
45
- }
46
- });
47
- }
48
-
49
- /**
50
- * Open cloud dashboard
51
- */
52
- function openDashboard() {
53
- console.log(`\n${colors.cyan}${colors.bold}⚡ Bootspring Dashboard${colors.reset}`);
54
-
55
- // Check authentication
56
- if (!auth.isAuthenticated()) {
57
- console.log(`\n${colors.yellow}You are not logged in.${colors.reset}`);
58
- console.log(`${colors.dim}Run 'bootspring auth login' first to access the dashboard.${colors.reset}\n`);
59
- console.log(`${colors.dim}Opening login page...${colors.reset}`);
60
- openBrowser('https://bootspring.com/login');
61
- return;
62
- }
63
-
64
- const user = auth.getUser();
65
- console.log(`\n${colors.dim}Opening dashboard for ${user.email}...${colors.reset}`);
66
-
67
- // Get token for SSO
68
- const token = auth.getToken();
69
- let url = DASHBOARD_URL;
70
-
71
- if (token) {
72
- // Add token as query parameter for seamless SSO
73
- url = `${DASHBOARD_URL}?token=${encodeURIComponent(token)}`;
74
- }
75
-
76
- openBrowser(url);
77
-
78
- console.log(`\n${colors.green}✓ Dashboard opened in browser${colors.reset}`);
79
- console.log(`${colors.dim}URL: ${DASHBOARD_URL}${colors.reset}\n`);
80
- }
81
-
82
- /**
83
- * Show help
84
- */
85
- function showHelp() {
86
- console.log(`
87
- ${colors.cyan}${colors.bold}⚡ Bootspring Dashboard${colors.reset}
88
- ${colors.dim}Cloud-based project dashboard${colors.reset}
89
-
90
- ${colors.bold}Usage:${colors.reset}
91
- bootspring dashboard
92
-
93
- ${colors.bold}Description:${colors.reset}
94
- Opens the Bootspring cloud dashboard in your browser.
95
-
96
- The dashboard provides:
97
- - Real-time project context sync
98
- - Usage analytics and billing
99
- - Team management (Team tier)
100
- - API key management
101
-
102
- ${colors.bold}Notes:${colors.reset}
103
- - You must be logged in (bootspring auth login)
104
- - Dashboard is available at https://bootspring.com/dashboard
105
- - Pro tier required for full dashboard features
106
- `);
107
- }
108
-
109
- /**
110
- * Run dashboard command
111
- */
112
- async function run(args) {
113
- const subcommand = args[0];
114
-
115
- if (subcommand === 'help' || subcommand === '-h' || subcommand === '--help') {
116
- showHelp();
117
- return;
118
- }
119
-
120
- openDashboard();
121
- }
122
-
123
- module.exports = { run };