@mockingbird_konwlage_cli/cli 1.2.5 → 1.2.7

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/index.js +25 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -30,18 +30,40 @@ program
30
30
  let apiBaseUrl = process.env.MOCKINGBIRD_API_URL;
31
31
 
32
32
  if (!apiBaseUrl) {
33
- // Priority 1: ~/.mockingbirdrc (Global config)
34
- const rcPath = path.join(os.homedir(), '.mockingbirdrc');
33
+ // Priority 1: .mockingbirdrc
34
+ const rcPath = path.join(process.cwd(), '.mockingbirdrc');
35
35
  if (fs.existsSync(rcPath)) {
36
36
  try {
37
37
  const rc = JSON.parse(fs.readFileSync(rcPath, 'utf8'));
38
38
  apiBaseUrl = isRemote ? rc.RemoteApiBaseUrl : rc.ApiBaseUrl;
39
39
  } catch (e) {
40
- console.warn(chalk.yellow(`[Warning] Failed to parse ~/.mockingbirdrc: ${e.message}`));
40
+ console.warn(chalk.yellow(`[Warning] Failed to parse .mockingbirdrc: ${e.message}`));
41
41
  }
42
42
  }
43
43
  }
44
44
 
45
+ if (!apiBaseUrl) {
46
+ // Priority 2: appsettings.Production.json (useful for server environments)
47
+ const prodSettingsPath = path.join(process.cwd(), 'appsettings.Production.json');
48
+ if (fs.existsSync(prodSettingsPath)) {
49
+ try {
50
+ const settings = JSON.parse(fs.readFileSync(prodSettingsPath, 'utf8'));
51
+ apiBaseUrl = settings.ApiBaseUrl;
52
+ } catch (e) { }
53
+ }
54
+ }
55
+
56
+ if (!apiBaseUrl) {
57
+ // Priority 3: appsettings.json
58
+ const appSettingsPath = path.join(process.cwd(), 'appsettings.json');
59
+ if (fs.existsSync(appSettingsPath)) {
60
+ try {
61
+ const settings = JSON.parse(fs.readFileSync(appSettingsPath, 'utf8'));
62
+ apiBaseUrl = settings.ApiBaseUrl;
63
+ } catch (e) { }
64
+ }
65
+ }
66
+
45
67
  // Final fallback to production API
46
68
  const API_BASE_URL = apiBaseUrl || 'https://api.aigcclub.com.cn';
47
69
  const apiUrl = `${API_BASE_URL}/api/public/skills/raw/${slug}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mockingbird_konwlage_cli/cli",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "Mockingbird AI Developer Client CLI",
5
5
  "main": "index.js",
6
6
  "bin": {