add-ai-tools 1.2.4 → 1.2.5

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/dist/index.mjs +16 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -6,6 +6,7 @@ import * as os from "os";
6
6
  import { homedir } from "os";
7
7
  import * as path from "path";
8
8
  import { join } from "path";
9
+ import { execSync } from "node:child_process";
9
10
  import { parse } from "yaml";
10
11
  import { basename, dirname, join as join$1 } from "node:path";
11
12
  import { exec } from "child_process";
@@ -492,7 +493,21 @@ var GitHubFetcher = class {
492
493
  concurrencyLimit = 10;
493
494
  constructor() {
494
495
  this.parser = new ResourceParser();
495
- this.token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
496
+ this.token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN || this.getGhCliToken();
497
+ }
498
+ /**
499
+ * gh CLI에서 인증 토큰을 가져옵니다
500
+ */
501
+ getGhCliToken() {
502
+ try {
503
+ return execSync("gh auth token", { stdio: [
504
+ "pipe",
505
+ "pipe",
506
+ "ignore"
507
+ ] }).toString().trim() || void 0;
508
+ } catch {
509
+ return;
510
+ }
496
511
  }
497
512
  /**
498
513
  * 인증 헤더를 포함한 공통 헤더를 반환합니다
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "add-ai-tools",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Universal AI agent resource installer CLI",
5
5
  "type": "module",
6
6
  "bin": {