@mockingbird_konwlage_cli/cli 1.2.4 → 1.2.6

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 +1 -35
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -5,6 +5,7 @@ const fs = require('fs');
5
5
  const path = require('path');
6
6
  const axios = require('axios');
7
7
  const chalk = require('chalk');
8
+ const os = require('os');
8
9
 
9
10
  const program = new Command();
10
11
 
@@ -28,41 +29,6 @@ program
28
29
  // Configuration discovery logic
29
30
  let apiBaseUrl = process.env.MOCKINGBIRD_API_URL;
30
31
 
31
- if (!apiBaseUrl) {
32
- // Priority 1: .mockingbirdrc
33
- const rcPath = path.join(process.cwd(), '.mockingbirdrc');
34
- if (fs.existsSync(rcPath)) {
35
- try {
36
- const rc = JSON.parse(fs.readFileSync(rcPath, 'utf8'));
37
- apiBaseUrl = isRemote ? rc.RemoteApiBaseUrl : rc.ApiBaseUrl;
38
- } catch (e) {
39
- console.warn(chalk.yellow(`[Warning] Failed to parse .mockingbirdrc: ${e.message}`));
40
- }
41
- }
42
- }
43
-
44
- if (!apiBaseUrl) {
45
- // Priority 2: appsettings.Production.json (useful for server environments)
46
- const prodSettingsPath = path.join(process.cwd(), 'appsettings.Production.json');
47
- if (fs.existsSync(prodSettingsPath)) {
48
- try {
49
- const settings = JSON.parse(fs.readFileSync(prodSettingsPath, 'utf8'));
50
- apiBaseUrl = settings.ApiBaseUrl;
51
- } catch (e) { }
52
- }
53
- }
54
-
55
- if (!apiBaseUrl) {
56
- // Priority 3: appsettings.json
57
- const appSettingsPath = path.join(process.cwd(), 'appsettings.json');
58
- if (fs.existsSync(appSettingsPath)) {
59
- try {
60
- const settings = JSON.parse(fs.readFileSync(appSettingsPath, 'utf8'));
61
- apiBaseUrl = settings.ApiBaseUrl;
62
- } catch (e) { }
63
- }
64
- }
65
-
66
32
  // Final fallback to production API
67
33
  const API_BASE_URL = apiBaseUrl || 'https://api.aigcclub.com.cn';
68
34
  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.4",
3
+ "version": "1.2.6",
4
4
  "description": "Mockingbird AI Developer Client CLI",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -19,4 +19,4 @@
19
19
  "chalk": "^4.1.2",
20
20
  "commander": "^14.0.3"
21
21
  }
22
- }
22
+ }