aixxai 1.6.8 → 1.7.0
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.
- package/aixxai-1.6.9.tgz +0 -0
- package/bin/aixx.js +139 -137
- package/package.json +38 -38
- package/src/commands/balance.js +193 -168
- package/src/commands/config.js +68 -68
- package/src/commands/help.js +46 -45
- package/src/commands/install.js +636 -636
- package/src/commands/market.js +16 -14
- package/src/commands/search.js +84 -96
- package/src/commands/status.js +120 -0
package/aixxai-1.6.9.tgz
ADDED
|
Binary file
|
package/bin/aixx.js
CHANGED
|
@@ -1,137 +1,139 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* AIXX CLI
|
|
5
|
-
* 让你的AI调用万物。
|
|
6
|
-
*
|
|
7
|
-
* 用法:
|
|
8
|
-
* npx aixxai install [推荐码/绑定码/S####] 安装AIXX skill;S编号=买断技能门禁安装
|
|
9
|
-
* npx aixxai install --yes 非交互安装(脚本/CI用,跳过确认)
|
|
10
|
-
* npx aixxai search <关键词> 搜索AIXX能力库(数据/技能,免key)
|
|
11
|
-
* npx aixxai installed 查看安装状态(skill/账号/版本)
|
|
12
|
-
* npx aixxai config 配置/查看AIXX
|
|
13
|
-
* npx aixxai test 测试AIXX是否可用
|
|
14
|
-
* npx aixxai balance 查询账户余额
|
|
15
|
-
* npx aixxai models 列出可用模型(分组)
|
|
16
|
-
* npx aixxai recharge [金额] 充值引导
|
|
17
|
-
* npx aixxai --version 查看版本
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import { readFileSync } from 'fs';
|
|
21
|
-
import { fileURLToPath } from 'url';
|
|
22
|
-
import { dirname, join } from 'path';
|
|
23
|
-
import { install } from '../src/commands/install.js';
|
|
24
|
-
import { search } from '../src/commands/search.js';
|
|
25
|
-
import { installed } from '../src/commands/installed.js';
|
|
26
|
-
import { config } from '../src/commands/config.js';
|
|
27
|
-
import { test } from '../src/commands/test.js';
|
|
28
|
-
import { balance } from '../src/commands/balance.js';
|
|
29
|
-
import { models } from '../src/commands/models.js';
|
|
30
|
-
import { recharge } from '../src/commands/recharge.js';
|
|
31
|
-
import { aci } from '../src/commands/aci.js';
|
|
32
|
-
import { market } from '../src/commands/market.js';
|
|
33
|
-
import { servers } from '../src/commands/servers.js';
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{ name: '
|
|
49
|
-
{ name: '
|
|
50
|
-
{ name: '
|
|
51
|
-
{ name: '
|
|
52
|
-
{ name: '
|
|
53
|
-
{ name: '
|
|
54
|
-
{ name: '
|
|
55
|
-
{ name: '
|
|
56
|
-
{ name: '
|
|
57
|
-
{ name: '
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
case 'version':
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
case 'help':
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
console.error('
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AIXX CLI
|
|
5
|
+
* 让你的AI调用万物。
|
|
6
|
+
*
|
|
7
|
+
* 用法:
|
|
8
|
+
* npx aixxai install [推荐码/绑定码/S####] 安装AIXX skill;S编号=买断技能门禁安装
|
|
9
|
+
* npx aixxai install --yes 非交互安装(脚本/CI用,跳过确认)
|
|
10
|
+
* npx aixxai search <关键词> 搜索AIXX能力库(数据/技能,免key)
|
|
11
|
+
* npx aixxai installed 查看安装状态(skill/账号/版本)
|
|
12
|
+
* npx aixxai config 配置/查看AIXX
|
|
13
|
+
* npx aixxai test 测试AIXX是否可用
|
|
14
|
+
* npx aixxai balance 查询账户余额
|
|
15
|
+
* npx aixxai models 列出可用模型(分组)
|
|
16
|
+
* npx aixxai recharge [金额] 充值引导
|
|
17
|
+
* npx aixxai --version 查看版本
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { readFileSync } from 'fs';
|
|
21
|
+
import { fileURLToPath } from 'url';
|
|
22
|
+
import { dirname, join } from 'path';
|
|
23
|
+
import { install } from '../src/commands/install.js';
|
|
24
|
+
import { search } from '../src/commands/search.js';
|
|
25
|
+
import { installed } from '../src/commands/installed.js';
|
|
26
|
+
import { config } from '../src/commands/config.js';
|
|
27
|
+
import { test } from '../src/commands/test.js';
|
|
28
|
+
import { balance } from '../src/commands/balance.js';
|
|
29
|
+
import { models } from '../src/commands/models.js';
|
|
30
|
+
import { recharge } from '../src/commands/recharge.js';
|
|
31
|
+
import { aci } from '../src/commands/aci.js';
|
|
32
|
+
import { market } from '../src/commands/market.js';
|
|
33
|
+
import { servers } from '../src/commands/servers.js';
|
|
34
|
+
import { status } from '../src/commands/status.js';
|
|
35
|
+
import { showHelp, showVersion } from '../src/commands/help.js';
|
|
36
|
+
|
|
37
|
+
// 版本号从 package.json 读(单一来源,别再硬编码)
|
|
38
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
39
|
+
const VERSION = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8')).version;
|
|
40
|
+
|
|
41
|
+
// 默认AIXX后端地址:统一走萬安云域名网关入口(详见 src/utils/env.js 注释)
|
|
42
|
+
// 改完后请全局搜索 "安全警告" 同步更新 env.js 与 templates/QUICKSTART.md 中的同名地址。
|
|
43
|
+
export const DEFAULT_BASE_URL = 'https://console.aixx.ai/v1';
|
|
44
|
+
|
|
45
|
+
// 命令表:所有子命令的单一来源(新增命令在这里加一行即可)。
|
|
46
|
+
// 未知命令的"你想用的是不是"近似匹配也从这张表取已知命令名,不另写一份。
|
|
47
|
+
const COMMANDS = [
|
|
48
|
+
{ name: 'install', aliases: ['i'], run: install },
|
|
49
|
+
{ name: 'search', run: search },
|
|
50
|
+
{ name: 'installed', run: installed },
|
|
51
|
+
{ name: 'config', aliases: ['c'], run: config },
|
|
52
|
+
{ name: 'test', aliases: ['t'], run: test },
|
|
53
|
+
{ name: 'balance', aliases: ['b'], run: balance },
|
|
54
|
+
{ name: 'models', aliases: ['m'], run: models },
|
|
55
|
+
{ name: 'recharge', aliases: ['r'], run: recharge },
|
|
56
|
+
{ name: 'market', run: market }, /* 1030产品版: 行情数据订阅(docs/PLAN_MARKET_API_1030.md), 不进help带外态 */
|
|
57
|
+
{ name: 'aci', run: aci }, /* 已并入market, 保留指路 */
|
|
58
|
+
{ name: 'servers', run: servers }, /* 1022版: 萬安云服务器货架 */
|
|
59
|
+
{ name: 'status', aliases: ['st'], run: status }, /* 1120 K哥令: 身份编号给到agent·一条命令看全貌 */
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
// help/version 不吃子参数(走 flag/无参分支),但命令名仍参与下面的近似匹配
|
|
63
|
+
const BUILTIN_NAMES = ['help', 'version'];
|
|
64
|
+
|
|
65
|
+
// 零依赖近似匹配的兜底:a 是否按顺序出现在 b 里(允许跳字,serch 也能对上 search)
|
|
66
|
+
function isSubsequence(a, b) {
|
|
67
|
+
let i = 0;
|
|
68
|
+
for (const ch of b) {
|
|
69
|
+
if (ch === a[i]) i++;
|
|
70
|
+
}
|
|
71
|
+
return i === a.length;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 未知命令 → 猜用户想输什么。小写比较;规则:前缀相同 / 互相包含 / 子序列。最多返回3个。
|
|
75
|
+
function didYouMean(input) {
|
|
76
|
+
const s = input.toLowerCase();
|
|
77
|
+
return [...COMMANDS.map(c => c.name), ...BUILTIN_NAMES]
|
|
78
|
+
.filter(n => {
|
|
79
|
+
const t = n.toLowerCase();
|
|
80
|
+
return t.startsWith(s) || s.startsWith(t) || t.includes(s) || s.includes(t) || isSubsequence(s, t);
|
|
81
|
+
})
|
|
82
|
+
.slice(0, 3);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async function main() {
|
|
86
|
+
const args = process.argv.slice(2);
|
|
87
|
+
const command = args[0];
|
|
88
|
+
const subArgs = args.slice(1);
|
|
89
|
+
|
|
90
|
+
// 裸命令即安装(1007 定版:命令越短越好)——npx aixxai 直接进安装,帮助走 help/--help
|
|
91
|
+
if (command === undefined) {
|
|
92
|
+
const installEntry = COMMANDS.find(c => c.name === 'install');
|
|
93
|
+
if (installEntry) {
|
|
94
|
+
await installEntry.run(subArgs);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const entry = COMMANDS.find(c => c.name === command || c.aliases?.includes(command));
|
|
100
|
+
if (entry) {
|
|
101
|
+
await entry.run(subArgs);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
switch (command) {
|
|
106
|
+
case '--version':
|
|
107
|
+
case '-v':
|
|
108
|
+
case 'version':
|
|
109
|
+
showVersion(VERSION);
|
|
110
|
+
break;
|
|
111
|
+
case '--help':
|
|
112
|
+
case '-h':
|
|
113
|
+
case 'help':
|
|
114
|
+
showHelp(VERSION);
|
|
115
|
+
break;
|
|
116
|
+
default: {
|
|
117
|
+
// 卡170(1011 定版"安装命令带唯一码"): 未知参数不再直接报错——当作码传给 install。
|
|
118
|
+
// 覆盖 npx aixxai <CODE>(不带 install 子命令)的用法;install 内部会先查云侧区分绑定码/推荐码。
|
|
119
|
+
const installEntry = COMMANDS.find(c => c.name === 'install');
|
|
120
|
+
if (installEntry && command && !command.startsWith('-')) {
|
|
121
|
+
await installEntry.run([command, ...subArgs]);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
console.error(`未知命令: ${command}`);
|
|
125
|
+
const guesses = didYouMean(command);
|
|
126
|
+
if (guesses.length > 0) {
|
|
127
|
+
console.error(`你想用的是不是: ${guesses.join(', ')}`);
|
|
128
|
+
} else {
|
|
129
|
+
console.error('运行 aixx help 查看全部命令');
|
|
130
|
+
}
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
main().catch(err => {
|
|
137
|
+
console.error('❌ 发生错误:', err.message);
|
|
138
|
+
process.exit(1);
|
|
139
|
+
});
|
package/package.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "aixxai",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "AIXX CLI - 让你的AI调用万物。One command, every AI model. By AIXX (Wanan Exchange), the verification-first compute exchange. 安装:npx aixxai",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"aixx": "./bin/aixx.js"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"test": "node bin/aixx.js --version"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"aixx",
|
|
14
|
-
"aixxai",
|
|
15
|
-
"ai",
|
|
16
|
-
"llm",
|
|
17
|
-
"gateway",
|
|
18
|
-
"openai",
|
|
19
|
-
"glm",
|
|
20
|
-
"kimi",
|
|
21
|
-
"skill",
|
|
22
|
-
"agent",
|
|
23
|
-
"mcp",
|
|
24
|
-
"claude",
|
|
25
|
-
"cursor",
|
|
26
|
-
"api-gateway",
|
|
27
|
-
"compute",
|
|
28
|
-
"gpu",
|
|
29
|
-
"marketplace",
|
|
30
|
-
"exchange",
|
|
31
|
-
"wanan"
|
|
32
|
-
],
|
|
33
|
-
"author": "AIXX (Wanan Exchange)",
|
|
34
|
-
"license": "ISC",
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": ">=18"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "aixxai",
|
|
3
|
+
"version": "1.7.0",
|
|
4
|
+
"description": "AIXX CLI - 让你的AI调用万物。One command, every AI model. By AIXX (Wanan Exchange), the verification-first compute exchange. 安装:npx aixxai",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"aixx": "./bin/aixx.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "node bin/aixx.js --version"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"aixx",
|
|
14
|
+
"aixxai",
|
|
15
|
+
"ai",
|
|
16
|
+
"llm",
|
|
17
|
+
"gateway",
|
|
18
|
+
"openai",
|
|
19
|
+
"glm",
|
|
20
|
+
"kimi",
|
|
21
|
+
"skill",
|
|
22
|
+
"agent",
|
|
23
|
+
"mcp",
|
|
24
|
+
"claude",
|
|
25
|
+
"cursor",
|
|
26
|
+
"api-gateway",
|
|
27
|
+
"compute",
|
|
28
|
+
"gpu",
|
|
29
|
+
"marketplace",
|
|
30
|
+
"exchange",
|
|
31
|
+
"wanan"
|
|
32
|
+
],
|
|
33
|
+
"author": "AIXX (Wanan Exchange)",
|
|
34
|
+
"license": "ISC",
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18"
|
|
37
|
+
}
|
|
38
|
+
}
|