@warpmetrics/coder 0.2.2 → 0.2.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 (2) hide show
  1. package/bin/cli.js +21 -9
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -49,25 +49,37 @@ 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
 
56
- try {
57
- log('');
58
- log(' warp-coder — set up agent config');
59
- log('');
54
+ log('');
55
+ log(' warp-coder — set up agent config');
56
+ log('');
60
57
 
61
- // 1. Ensure gh has the right scopes
62
- log(' Ensuring GitHub CLI has required scopes (project, repo)...');
58
+ // 1. Ensure gh has the right scopes (before readline takes over stdin)
59
+ log(' Checking GitHub CLI scopes...');
60
+ try {
61
+ const authStatus = execSync('gh auth status', { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }).toLowerCase();
62
+ const hasScopes = authStatus.includes('project') && authStatus.includes('repo');
63
+ if (hasScopes) {
64
+ log(' \u2713 GitHub CLI scopes OK');
65
+ } else {
66
+ throw new Error('missing scopes');
67
+ }
68
+ } catch {
69
+ log(' Requesting required scopes (project, repo)...');
63
70
  try {
64
71
  execSync('gh auth refresh -s project,repo', { stdio: 'inherit' });
65
72
  log(' \u2713 GitHub CLI scopes updated');
66
73
  } catch {
67
74
  log(' \u26a0 Could not refresh gh scopes — run manually: gh auth refresh -s project,repo');
68
75
  }
69
- log('');
76
+ }
77
+ log('');
70
78
 
79
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
80
+ const ask = q => new Promise(resolve => rl.question(q, resolve));
81
+
82
+ try {
71
83
  // 2. WarpMetrics API key
72
84
  const wmKey = await ask(' ? WarpMetrics API key (get one at warpmetrics.com/app/api-keys): ');
73
85
  if (wmKey && !wmKey.startsWith('wm_')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warpmetrics/coder",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "description": "Local agent loop for implementing GitHub issues with Claude Code. Powered by WarpMetrics.",
6
6
  "bin": {