@warpmetrics/coder 0.2.2 → 0.2.3
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/bin/cli.js +15 -14
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -49,25 +49,26 @@ if (command === 'watch') {
|
|
|
49
49
|
// ---------------------------------------------------------------------------
|
|
50
50
|
|
|
51
51
|
async function runInit() {
|
|
52
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
53
|
-
const ask = q => new Promise(resolve => rl.question(q, resolve));
|
|
54
52
|
const log = msg => console.log(msg);
|
|
55
53
|
|
|
54
|
+
log('');
|
|
55
|
+
log(' warp-coder — set up agent config');
|
|
56
|
+
log('');
|
|
57
|
+
|
|
58
|
+
// 1. Ensure gh has the right scopes (before readline takes over stdin)
|
|
59
|
+
log(' Ensuring GitHub CLI has required scopes (project, repo)...');
|
|
56
60
|
try {
|
|
57
|
-
|
|
58
|
-
log('
|
|
59
|
-
|
|
61
|
+
execSync('gh auth refresh -s project,repo', { stdio: 'inherit' });
|
|
62
|
+
log(' \u2713 GitHub CLI scopes updated');
|
|
63
|
+
} catch {
|
|
64
|
+
log(' \u26a0 Could not refresh gh scopes — run manually: gh auth refresh -s project,repo');
|
|
65
|
+
}
|
|
66
|
+
log('');
|
|
60
67
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
try {
|
|
64
|
-
execSync('gh auth refresh -s project,repo', { stdio: 'inherit' });
|
|
65
|
-
log(' \u2713 GitHub CLI scopes updated');
|
|
66
|
-
} catch {
|
|
67
|
-
log(' \u26a0 Could not refresh gh scopes — run manually: gh auth refresh -s project,repo');
|
|
68
|
-
}
|
|
69
|
-
log('');
|
|
68
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
69
|
+
const ask = q => new Promise(resolve => rl.question(q, resolve));
|
|
70
70
|
|
|
71
|
+
try {
|
|
71
72
|
// 2. WarpMetrics API key
|
|
72
73
|
const wmKey = await ask(' ? WarpMetrics API key (get one at warpmetrics.com/app/api-keys): ');
|
|
73
74
|
if (wmKey && !wmKey.startsWith('wm_')) {
|