@warpmetrics/coder 0.2.3 → 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 +15 -4
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -56,12 +56,23 @@ async function runInit() {
56
56
  log('');
57
57
 
58
58
  // 1. Ensure gh has the right scopes (before readline takes over stdin)
59
- log(' Ensuring GitHub CLI has required scopes (project, repo)...');
59
+ log(' Checking GitHub CLI scopes...');
60
60
  try {
61
- execSync('gh auth refresh -s project,repo', { stdio: 'inherit' });
62
- log(' \u2713 GitHub CLI scopes updated');
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
+ }
63
68
  } catch {
64
- log(' \u26a0 Could not refresh gh scopes — run manually: gh auth refresh -s project,repo');
69
+ log(' Requesting required scopes (project, repo)...');
70
+ try {
71
+ execSync('gh auth refresh -s project,repo', { stdio: 'inherit' });
72
+ log(' \u2713 GitHub CLI scopes updated');
73
+ } catch {
74
+ log(' \u26a0 Could not refresh gh scopes — run manually: gh auth refresh -s project,repo');
75
+ }
65
76
  }
66
77
  log('');
67
78
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warpmetrics/coder",
3
- "version": "0.2.3",
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": {