aixxai 1.4.2 → 1.4.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.
@@ -1,68 +1,68 @@
1
- /**
2
- * AIXX CLI - config 命令
3
- * 查看或修改AIXX配置
4
- */
5
-
6
- import { existsSync, readFileSync } from 'fs';
7
- import { homedir } from 'os';
8
- import { join } from 'path';
9
- import { DEFAULT_BASE_URL } from '../../bin/aixx.js';
10
- import { loadApiKey, maskKey } from '../utils/env.js';
11
-
12
- export async function config(subArgs) {
13
- console.log('╔══════════════════════════════════════════╗');
14
- console.log('║ AIXX 配置 ║');
15
- console.log('╚══════════════════════════════════════════╝\n');
16
-
17
- // 统一配置链:环境变量 → ~/.aixx/config.json → ~/.aixx/account.json
18
- const apiKey = loadApiKey();
19
- const baseUrl = process.env.AIXX_BASE_URL || DEFAULT_BASE_URL;
20
-
21
- console.log('当前配置:');
22
- console.log(` AIXX_API_KEY : ${apiKey ? maskKey(apiKey) : '❌ 未配置'}`);
23
- console.log(` AIXX_BASE_URL: ${baseUrl}`);
24
-
25
- // 本地配置文件(key脱敏显示,绝不打印完整key)
26
- const configFile = join(homedir(), '.aixx', 'config.json');
27
- if (existsSync(configFile)) {
28
- console.log('\n本地配置文件:');
29
- try {
30
- const conf = JSON.parse(readFileSync(configFile, 'utf-8'));
31
- if (conf.AIXX_API_KEY) conf.AIXX_API_KEY = maskKey(conf.AIXX_API_KEY);
32
- console.log(` 位置: ${configFile}`);
33
- console.log(` 内容: ${JSON.stringify(conf, null, 2)}`);
34
- } catch (e) {
35
- console.log(` (配置文件解析失败: ${e.message})`);
36
- }
37
- }
38
-
39
- // 推荐码
40
- const refFile = join(homedir(), '.aixx', 'referral.json');
41
- if (existsSync(refFile)) {
42
- console.log('\n推荐归因:');
43
- try {
44
- const ref = JSON.parse(readFileSync(refFile, 'utf-8'));
45
- console.log(` 推荐码: ${ref.refCode}`);
46
- console.log(` 安装时间: ${ref.installedAt}`);
47
- } catch (e) {}
48
- }
49
-
50
- // skill位置
51
- const skillDirs = [
52
- join(homedir(), '.zcode', 'skills', 'aixx'),
53
- join(homedir(), '.agents', 'skills', 'aixx'),
54
- join(homedir(), '.claude', 'skills', 'aixx'),
55
- join(homedir(), '.aixx', 'skills', 'aixx'),
56
- ].filter(existsSync);
57
-
58
- console.log('\nskill安装位置:');
59
- if (skillDirs.length > 0) {
60
- skillDirs.forEach(d => console.log(` ✅ ${d}`));
61
- } else {
62
- console.log(' ❌ 未检测到已安装的skill(运行 aixx install 安装)');
63
- }
64
-
65
- console.log('\n修改配置:');
66
- console.log(' 重新运行: npx aixxai install');
67
- console.log(' (配置读取顺序:环境变量 AIXX_API_KEY → ~/.aixx/config.json → ~/.aixx/account.json)\n');
68
- }
1
+ /**
2
+ * AIXX CLI - config 命令
3
+ * 查看或修改AIXX配置
4
+ */
5
+
6
+ import { existsSync, readFileSync } from 'fs';
7
+ import { homedir } from 'os';
8
+ import { join } from 'path';
9
+ import { DEFAULT_BASE_URL } from '../../bin/aixx.js';
10
+ import { loadApiKey, maskKey } from '../utils/env.js';
11
+
12
+ export async function config(subArgs) {
13
+ console.log('╔══════════════════════════════════════════╗');
14
+ console.log('║ AIXX 配置 ║');
15
+ console.log('╚══════════════════════════════════════════╝\n');
16
+
17
+ // 统一配置链:环境变量 → ~/.aixx/config.json → ~/.aixx/account.json
18
+ const apiKey = loadApiKey();
19
+ const baseUrl = process.env.AIXX_BASE_URL || DEFAULT_BASE_URL;
20
+
21
+ console.log('当前配置:');
22
+ console.log(` AIXX_API_KEY : ${apiKey ? maskKey(apiKey) : '❌ 未配置'}`);
23
+ console.log(` AIXX_BASE_URL: ${baseUrl}`);
24
+
25
+ // 本地配置文件(key脱敏显示,绝不打印完整key)
26
+ const configFile = join(homedir(), '.aixx', 'config.json');
27
+ if (existsSync(configFile)) {
28
+ console.log('\n本地配置文件:');
29
+ try {
30
+ const conf = JSON.parse(readFileSync(configFile, 'utf-8'));
31
+ if (conf.AIXX_API_KEY) conf.AIXX_API_KEY = maskKey(conf.AIXX_API_KEY);
32
+ console.log(` 位置: ${configFile}`);
33
+ console.log(` 内容: ${JSON.stringify(conf, null, 2)}`);
34
+ } catch (e) {
35
+ console.log(` (配置文件解析失败: ${e.message})`);
36
+ }
37
+ }
38
+
39
+ // 推荐码
40
+ const refFile = join(homedir(), '.aixx', 'referral.json');
41
+ if (existsSync(refFile)) {
42
+ console.log('\n推荐归因:');
43
+ try {
44
+ const ref = JSON.parse(readFileSync(refFile, 'utf-8'));
45
+ console.log(` 推荐码: ${ref.refCode}`);
46
+ console.log(` 安装时间: ${ref.installedAt}`);
47
+ } catch (e) {}
48
+ }
49
+
50
+ // skill位置
51
+ const skillDirs = [
52
+ join(homedir(), '.zcode', 'skills', 'aixx'),
53
+ join(homedir(), '.agents', 'skills', 'aixx'),
54
+ join(homedir(), '.claude', 'skills', 'aixx'),
55
+ join(homedir(), '.aixx', 'skills', 'aixx'),
56
+ ].filter(existsSync);
57
+
58
+ console.log('\nskill安装位置:');
59
+ if (skillDirs.length > 0) {
60
+ skillDirs.forEach(d => console.log(` ✅ ${d}`));
61
+ } else {
62
+ console.log(' ❌ 未检测到已安装的skill(运行 aixx install 安装)');
63
+ }
64
+
65
+ console.log('\n修改配置:');
66
+ console.log(' 重新运行: npx aixxai install');
67
+ console.log(' (配置读取顺序:环境变量 AIXX_API_KEY → ~/.aixx/config.json → ~/.aixx/account.json)\n');
68
+ }
@@ -1,43 +1,43 @@
1
- /**
2
- * AIXX CLI - 帮助信息
3
- */
4
-
5
- export function showHelp(version) {
6
- console.log(`
7
- ╔══════════════════════════════════════════╗
8
- ║ AIXX CLI v${version} ║
9
- ║ 让你的AI调用万物 ║
10
- ╚══════════════════════════════════════════╝
11
-
12
- 用法:
13
- aixx install [推荐码] 安装AIXX skill到本地agent(含零配置)
14
- aixx install --yes 非交互安装(脚本/CI用,跳过确认)
15
- aixx config 配置或查看AIXX设置
16
- aixx test 测试AIXX是否可用
17
- aixx balance 查询账户余额(还剩多少钱)
18
- aixx models 列出可用模型(国产/海外分组)
19
- aixx recharge [金额] 充值引导(默认$5)
20
- aixx --version 查看版本
21
- aixx --help 显示此帮助
22
-
23
- 安装示例:
24
- npx aixxai install 普通安装(自动注册,送¥5额度)
25
- npx aixxai install zhangsan 通过张三的推荐码安装(张三获分润)
26
-
27
- 账户示例:
28
- aixx balance 查看余额
29
- aixx balance 20 (金额参数对balance无效,仅recharge用)
30
- aixx models 看有哪些模型可调
31
- aixx recharge 10 充 $10
32
-
33
- 关于AIXX:
34
- AIXX = "AI的谷歌"。装一个skill,agent就能调用全世界的AI能力。
35
- 永远不用碰key、参数、文档,一切通过对话。
36
-
37
- 文档:https://gitee.com/kk0803/token-hub
38
- `);
39
- }
40
-
41
- export function showVersion(version) {
42
- console.log(`AIXX CLI v${version}`);
43
- }
1
+ /**
2
+ * AIXX CLI - 帮助信息
3
+ */
4
+
5
+ export function showHelp(version) {
6
+ console.log(`
7
+ ╔══════════════════════════════════════════╗
8
+ ║ AIXX CLI v${version} ║
9
+ ║ 让你的AI调用万物 ║
10
+ ╚══════════════════════════════════════════╝
11
+
12
+ 用法:
13
+ aixx install [推荐码] 安装AIXX skill到本地agent(含零配置)
14
+ aixx install --yes 非交互安装(脚本/CI用,跳过确认)
15
+ aixx config 配置或查看AIXX设置
16
+ aixx test 测试AIXX是否可用
17
+ aixx balance 查询账户余额(还剩多少钱)
18
+ aixx models 列出可用模型(国产/海外分组)
19
+ aixx recharge [金额] 充值引导(默认$5)
20
+ aixx --version 查看版本
21
+ aixx --help 显示此帮助
22
+
23
+ 安装示例:
24
+ npx aixxai install 普通安装(自动注册,送¥5额度)
25
+ npx aixxai install zhangsan 通过张三的推荐码安装(张三获分润)
26
+
27
+ 账户示例:
28
+ aixx balance 查看余额
29
+ aixx balance 20 (金额参数对balance无效,仅recharge用)
30
+ aixx models 看有哪些模型可调
31
+ aixx recharge 10 充 $10
32
+
33
+ 关于AIXX:
34
+ AIXX = "AI的谷歌"。装一个skill,agent就能调用全世界的AI能力。
35
+ 永远不用碰key、参数、文档,一切通过对话。
36
+
37
+ 文档:https://gitee.com/kk0803/token-hub
38
+ `);
39
+ }
40
+
41
+ export function showVersion(version) {
42
+ console.log(`AIXX CLI v${version}`);
43
+ }