@snapcommit/cli 3.0.0 → 3.0.1

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.
@@ -302,8 +302,24 @@ async function executeGitHubCommand(intent) {
302
302
  break;
303
303
  case 'ci_check':
304
304
  console.log(chalk_1.default.blue('\nšŸ” Checking CI status...'));
305
- // TODO: Implement CI status check
306
- console.log(chalk_1.default.gray(' CI checks (coming soon)\n'));
305
+ try {
306
+ const ciStatus = await github.getCommitStatus();
307
+ const state = ciStatus.status.state;
308
+ const totalChecks = ciStatus.checks.length;
309
+ const failedChecks = ciStatus.checks.filter((c) => c.conclusion === 'failure').length;
310
+ if (state === 'success' || (totalChecks > 0 && failedChecks === 0)) {
311
+ console.log(chalk_1.default.green(`āœ“ All checks passed (${totalChecks} checks)\n`));
312
+ }
313
+ else if (state === 'pending') {
314
+ console.log(chalk_1.default.yellow(`ā³ Checks running (${totalChecks} checks)\n`));
315
+ }
316
+ else {
317
+ console.log(chalk_1.default.red(`āŒ ${failedChecks}/${totalChecks} checks failed\n`));
318
+ }
319
+ }
320
+ catch (error) {
321
+ console.log(chalk_1.default.gray(' No CI checks found\n'));
322
+ }
307
323
  break;
308
324
  case 'issue_create':
309
325
  console.log(chalk_1.default.blue('\nšŸ”„ Creating issue...'));
@@ -1,7 +1,4 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.getCurrentRepo = getCurrentRepo;
7
4
  exports.getCurrentBranch = getCurrentBranch;
@@ -18,12 +15,8 @@ exports.closeIssue = closeIssue;
18
15
  exports.createRelease = createRelease;
19
16
  exports.getRepoInfo = getRepoInfo;
20
17
  const child_process_1 = require("child_process");
21
- const chalk_1 = __importDefault(require("chalk"));
22
- const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
18
+ const github_connect_1 = require("../commands/github-connect");
23
19
  const GITHUB_API = 'https://api.github.com';
24
- if (!GITHUB_TOKEN) {
25
- console.warn(chalk_1.default.yellow('āš ļø GitHub token not found. GitHub features will be disabled.'));
26
- }
27
20
  /**
28
21
  * Get current repository info from git remote
29
22
  */
@@ -64,15 +57,16 @@ function getCurrentBranch() {
64
57
  }
65
58
  }
66
59
  /**
67
- * GitHub API request helper
60
+ * GitHub API request helper - uses locally stored token
68
61
  */
69
62
  async function githubRequest(endpoint, options = {}) {
70
- if (!GITHUB_TOKEN) {
71
- throw new Error('GitHub token not configured. Please set GITHUB_TOKEN in your .env file.');
63
+ const token = (0, github_connect_1.getGitHubToken)();
64
+ if (!token) {
65
+ throw new Error('GitHub not connected. Run: snap github connect');
72
66
  }
73
67
  const url = `${GITHUB_API}${endpoint}`;
74
68
  const headers = {
75
- Authorization: `Bearer ${GITHUB_TOKEN}`,
69
+ Authorization: `Bearer ${token}`,
76
70
  Accept: 'application/vnd.github+json',
77
71
  'X-GitHub-Api-Version': '2022-11-28',
78
72
  'Content-Type': 'application/json',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapcommit/cli",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Instant AI commits. Beautiful progress tracking. Never write commit messages again.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {