aixxai 1.6.7 → 1.6.9
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/README.md +4 -2
- package/aixxai-1.6.9.tgz +0 -0
- package/bin/aixx.js +9 -7
- package/package.json +38 -33
- package/src/commands/aci.js +11 -145
- package/src/commands/balance.js +6 -4
- package/src/commands/config.js +68 -68
- package/src/commands/help.js +4 -3
- package/src/commands/install.js +636 -636
- package/src/commands/market.js +232 -0
- package/src/commands/models.js +2 -2
- package/src/commands/recharge.js +1 -1
- package/src/commands/servers.js +122 -122
- package/src/commands/status.js +120 -0
- package/src/commands/test.js +1 -1
- package/src/utils/agentconfig.js +374 -375
- package/src/utils/download.js +147 -147
- package/src/utils/env.js +136 -136
- package/templates/QUICKSTART.md +1 -1
- package/templates/SKILL.md +5 -5
- package/templates/references/account.md +1 -1
- package/templates/references/aixx-shared.md +59 -59
- package/templates/references/apps.md +1 -1
- package/templates/references/chat.md +2 -2
- package/templates/references/data.md +1 -1
- package/templates/references/notify.md +1 -1
- package/templates/references/search.md +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
> 让你的AI调用万物。一个命令,agent就能调用全世界的AI能力。
|
|
4
4
|
|
|
5
|
+
**AIXX** 由 [萬安算交所 (AIXX Exchange)](https://www.aixx.vip) 出品——全球首个"验证式"算力交易所:每一台在售 GPU 与整机均经平台上门实地验货(编号可查、真机实拍),每一位买家均经实名认证与资金验资。同门生态:[算力行情](https://www.aixx.vip/static/market/index.html) · [算力百科](https://aixx.ai/wiki/) · [萬安云](https://aixx.ai/cloud.html) · [萬安资讯](https://aixx.ai/news.html)。
|
|
6
|
+
|
|
5
7
|
## 安装
|
|
6
8
|
|
|
7
9
|
```bash
|
|
@@ -46,7 +48,7 @@ npx aixxai zhangsan
|
|
|
46
48
|
|
|
47
49
|
## 文档
|
|
48
50
|
|
|
49
|
-
完整文档:https://
|
|
51
|
+
完整文档:https://aixx.ai
|
|
50
52
|
|
|
51
53
|
---
|
|
52
|
-
|
|
54
|
+
维护者:AIXX 团队 | 2026-08-08
|
package/aixxai-1.6.9.tgz
ADDED
|
Binary file
|
package/bin/aixx.js
CHANGED
|
@@ -29,16 +29,16 @@ import { balance } from '../src/commands/balance.js';
|
|
|
29
29
|
import { models } from '../src/commands/models.js';
|
|
30
30
|
import { recharge } from '../src/commands/recharge.js';
|
|
31
31
|
import { aci } from '../src/commands/aci.js';
|
|
32
|
+
import { market } from '../src/commands/market.js';
|
|
32
33
|
import { servers } from '../src/commands/servers.js';
|
|
34
|
+
import { status } from '../src/commands/status.js';
|
|
33
35
|
import { showHelp, showVersion } from '../src/commands/help.js';
|
|
34
36
|
|
|
35
37
|
// 版本号从 package.json 读(单一来源,别再硬编码)
|
|
36
38
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
37
39
|
const VERSION = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8')).version;
|
|
38
40
|
|
|
39
|
-
// 默认AIXX
|
|
40
|
-
// 会话16换门:统一走域名网关入口(详见 src/utils/env.js 注释)
|
|
41
|
-
// 卡170(1011)换门二: baodan.run网关的/api/*全归爆单后端(CLI注册/login/token 404断链39天)——账号管理与模型调用统一走萬安云自有域名console.aixx.ai
|
|
41
|
+
// 默认AIXX后端地址:统一走萬安云域名网关入口(详见 src/utils/env.js 注释)
|
|
42
42
|
// 改完后请全局搜索 "安全警告" 同步更新 env.js 与 templates/QUICKSTART.md 中的同名地址。
|
|
43
43
|
export const DEFAULT_BASE_URL = 'https://console.aixx.ai/v1';
|
|
44
44
|
|
|
@@ -53,8 +53,10 @@ const COMMANDS = [
|
|
|
53
53
|
{ name: 'balance', aliases: ['b'], run: balance },
|
|
54
54
|
{ name: 'models', aliases: ['m'], run: models },
|
|
55
55
|
{ name: 'recharge', aliases: ['r'], run: recharge },
|
|
56
|
-
{ name: '
|
|
57
|
-
{ name: '
|
|
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·一条命令看全貌 */
|
|
58
60
|
];
|
|
59
61
|
|
|
60
62
|
// help/version 不吃子参数(走 flag/无参分支),但命令名仍参与下面的近似匹配
|
|
@@ -85,7 +87,7 @@ async function main() {
|
|
|
85
87
|
const command = args[0];
|
|
86
88
|
const subArgs = args.slice(1);
|
|
87
89
|
|
|
88
|
-
// 裸命令即安装(1007
|
|
90
|
+
// 裸命令即安装(1007 定版:命令越短越好)——npx aixxai 直接进安装,帮助走 help/--help
|
|
89
91
|
if (command === undefined) {
|
|
90
92
|
const installEntry = COMMANDS.find(c => c.name === 'install');
|
|
91
93
|
if (installEntry) {
|
|
@@ -112,7 +114,7 @@ async function main() {
|
|
|
112
114
|
showHelp(VERSION);
|
|
113
115
|
break;
|
|
114
116
|
default: {
|
|
115
|
-
// 卡170(1011
|
|
117
|
+
// 卡170(1011 定版"安装命令带唯一码"): 未知参数不再直接报错——当作码传给 install。
|
|
116
118
|
// 覆盖 npx aixxai <CODE>(不带 install 子命令)的用法;install 内部会先查云侧区分绑定码/推荐码。
|
|
117
119
|
const installEntry = COMMANDS.find(c => c.name === 'install');
|
|
118
120
|
if (installEntry && command && !command.startsWith('-')) {
|
package/package.json
CHANGED
|
@@ -1,33 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "aixxai",
|
|
3
|
-
"version": "1.6.
|
|
4
|
-
"description": "AIXX CLI - 让你的AI
|
|
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
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "aixxai",
|
|
3
|
+
"version": "1.6.9",
|
|
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
|
+
}
|
package/src/commands/aci.js
CHANGED
|
@@ -1,150 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* AIXX CLI - aci
|
|
3
|
-
*
|
|
4
|
-
* 算力行情(ACI)查询:
|
|
5
|
-
* aixx aci tickers [--usd] 全标的快照(价格+出身+评分)
|
|
6
|
-
* aixx aci scorecard <SYMBOL> 单标的记分卡明细
|
|
7
|
-
* aixx aci ticker <SYMBOL> 单标的快照
|
|
8
|
-
* aixx aci history <SYMBOL> [days] 历史点位(免费档最多7天)
|
|
9
|
-
*
|
|
10
|
-
* 内测纪律(BULLETIN 1021任务书):凭内测令牌访问,未持令牌服务端一律404不预告;
|
|
11
|
-
* 本命令不进 npm 正式版发布,全部通过(QA+K哥验收)后才对外。
|
|
12
|
-
*
|
|
13
|
-
* 令牌来源:环境变量 AIXX_ACI_TOKEN → ~/.aixx/config.json 的 aciBetaToken 字段。
|
|
2
|
+
* AIXX CLI - aci 命令(已并入 market,1030)
|
|
3
|
+
* 保留命令名只为老用户指路;全部能力在 aixx market 命令组。
|
|
14
4
|
*/
|
|
15
5
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (process.env.AIXX_ACI_TOKEN) return process.env.AIXX_ACI_TOKEN;
|
|
25
|
-
try {
|
|
26
|
-
const f = join(homedir(), '.aixx', 'config.json');
|
|
27
|
-
if (existsSync(f)) {
|
|
28
|
-
const conf = JSON.parse(readFileSync(f, 'utf-8'));
|
|
29
|
-
if (conf.aciBetaToken) return conf.aciBetaToken;
|
|
30
|
-
}
|
|
31
|
-
} catch (e) { /* 忽略,走未配置路径 */ }
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async function aciFetch(path) {
|
|
36
|
-
const token = loadBetaToken();
|
|
37
|
-
if (!token) {
|
|
38
|
-
console.error('❌ 未配置ACI内测令牌(该能力为内测态)');
|
|
39
|
-
console.error(' 请设置环境变量 AIXX_ACI_TOKEN 后重试');
|
|
40
|
-
process.exit(1);
|
|
41
|
-
}
|
|
42
|
-
const ctrl = new AbortController();
|
|
43
|
-
const timer = setTimeout(() => ctrl.abort(), FETCH_TIMEOUT);
|
|
44
|
-
try {
|
|
45
|
-
const res = await fetch(`${ACI_BASE}${path}`, {
|
|
46
|
-
headers: { Authorization: `Bearer ${token}` },
|
|
47
|
-
signal: ctrl.signal,
|
|
48
|
-
});
|
|
49
|
-
if (res.status === 404) {
|
|
50
|
-
console.error('该能力暂不可用');
|
|
51
|
-
process.exit(1);
|
|
52
|
-
}
|
|
53
|
-
if (!res.ok) {
|
|
54
|
-
console.error(`查询失败 (HTTP ${res.status})`);
|
|
55
|
-
process.exit(1);
|
|
56
|
-
}
|
|
57
|
-
return await res.json();
|
|
58
|
-
} catch (err) {
|
|
59
|
-
console.error(err?.name === 'AbortError' || err?.name === 'TimeoutError'
|
|
60
|
-
? '连接超时,请检查网络' : `查询失败: ${err?.message || err}`);
|
|
61
|
-
process.exit(1);
|
|
62
|
-
} finally {
|
|
63
|
-
clearTimeout(timer);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function srcBadge(src) {
|
|
68
|
-
// 出身三色标:real=实抓 / der=推算 / est=估算(口径与算交所产出契约一致)
|
|
69
|
-
if (src === 'real') return '实抓';
|
|
70
|
-
if (src === 'der') return '推算';
|
|
71
|
-
if (src === 'est') return '估算';
|
|
72
|
-
return src || '?';
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function fmtWan(v) {
|
|
76
|
-
if (typeof v !== 'number') return '-';
|
|
77
|
-
return v >= 1 ? `${v.toFixed(1)}万` : `${(v * 10000).toFixed(0)}元`;
|
|
6
|
+
export async function aci() {
|
|
7
|
+
console.log('该命令已升级并入 aixx market,请改用:');
|
|
8
|
+
console.log(' aixx market tickers 全标的快照');
|
|
9
|
+
console.log(' aixx market ticker <SYMBOL> 单标的快照');
|
|
10
|
+
console.log(' aixx market score <SYMBOL> 标的记分卡');
|
|
11
|
+
console.log(' aixx market history <SYMBOL> 历史点位');
|
|
12
|
+
console.log(' aixx market detail <SYMBOL> 大宗详情数据包');
|
|
13
|
+
console.log(' aixx market consumer <型号> 消费级详情数据包');
|
|
78
14
|
}
|
|
79
15
|
|
|
80
|
-
|
|
81
|
-
const cur = usd ? '$' : '¥';
|
|
82
|
-
const lo = usd ? c.listing?.lo_usd : c.listing?.lo;
|
|
83
|
-
const hi = usd ? c.listing?.hi_usd : c.listing?.hi;
|
|
84
|
-
const lines = [
|
|
85
|
-
` ${c.symbol} ${c.category || ''} 评分 ${c.score?.raw ?? '-'} (${c.score?.grade ?? '-'})`,
|
|
86
|
-
` 在售: ${cur}${lo ?? '-'} ~ ${cur}${hi ?? '-'} (${c.listing?.count ?? 0}台, 出身:${srcBadge(c.listing?.src)})`,
|
|
87
|
-
` 租赁: ¥${c.rental?.cn_hr ?? '-'}/时 (USD $${c.rental?.usd_hr ?? '-'}/时)`,
|
|
88
|
-
];
|
|
89
|
-
if (usd && c.msrp_usd_wan != null) lines.push(` 发售价: $${c.msrp_usd_wan}万`);
|
|
90
|
-
console.log(lines.join('\n') + '\n');
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export async function aci(subArgs) {
|
|
94
|
-
const sub = subArgs[0] || 'help';
|
|
95
|
-
const rest = subArgs.slice(1);
|
|
96
|
-
|
|
97
|
-
if (sub === 'tickers') {
|
|
98
|
-
const usd = rest.includes('--usd');
|
|
99
|
-
const d = await aciFetch(`/v1/aci/tickers${usd ? '?currency=USD' : ''}`);
|
|
100
|
-
console.log(`╔══════════════════════════════════════════╗`);
|
|
101
|
-
console.log(`║ AIXX 算力行情 ACI (内测) ║`);
|
|
102
|
-
console.log(`╚══════════════════════════════════════════╝`);
|
|
103
|
-
console.log(`更新: ${d.generated} | 标的: ${d.count} 个 | 币种: ${d.currency}\n`);
|
|
104
|
-
for (const c of d.cards || []) printTickerRow(c, usd);
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (sub === 'ticker' || sub === 'scorecard') {
|
|
109
|
-
const sym = (rest[0] || '').toUpperCase();
|
|
110
|
-
if (!sym) {
|
|
111
|
-
console.error(`用法: aixx aci ${sub} <SYMBOL> 例: aixx aci ${sub} B300`);
|
|
112
|
-
process.exit(1);
|
|
113
|
-
}
|
|
114
|
-
const d = await aciFetch(`/v1/aci/${sub}/${sym}`);
|
|
115
|
-
if (sub === 'ticker') {
|
|
116
|
-
console.log(`AIXX 算力行情 (内测) — ${d.generated}\n`);
|
|
117
|
-
printTickerRow(d.ticker, d.currency === 'USD');
|
|
118
|
-
} else {
|
|
119
|
-
const s = d.scorecard || {};
|
|
120
|
-
console.log(`AIXX 记分卡 (内测) — ${d.symbol}`);
|
|
121
|
-
console.log(` 总分: ${s.raw ?? '-'} 等级: ${s.grade ?? '-'}`);
|
|
122
|
-
console.log(` 回本分 sR: ${s.dims?.sR ?? '-'} (权重40)`);
|
|
123
|
-
console.log(` 涨价分 sA: ${s.dims?.sA ?? '-'} (权重30)`);
|
|
124
|
-
console.log(` 售罄分 sS: ${s.dims?.sS ?? '-'} (权重30)`);
|
|
125
|
-
console.log(` 口径: ${d.formula || ''}`);
|
|
126
|
-
}
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (sub === 'history') {
|
|
131
|
-
const sym = (rest[0] || '').toUpperCase();
|
|
132
|
-
const days = parseInt(rest[1] || '7', 10) || 7;
|
|
133
|
-
if (!sym) {
|
|
134
|
-
console.error('用法: aixx aci history <SYMBOL> [days]');
|
|
135
|
-
process.exit(1);
|
|
136
|
-
}
|
|
137
|
-
const d = await aciFetch(`/v1/aci/history/${sym}?days=${days}`);
|
|
138
|
-
console.log(`AIXX 历史点位 (内测) — ${d.symbol} 近${d.days}天${d.capped ? '(免费档上限7天)' : ''}\n`);
|
|
139
|
-
for (const p of d.points || []) {
|
|
140
|
-
console.log(` ${p.generated} 在售 ¥${p.listing?.lo ?? '-'}~¥${p.listing?.hi ?? '-'} 评分 ${p.score_raw ?? '-'}`);
|
|
141
|
-
}
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
console.log('用法: aixx aci <子命令>');
|
|
146
|
-
console.log(' tickers [--usd] 全标的快照');
|
|
147
|
-
console.log(' ticker <SYMBOL> 单标的快照');
|
|
148
|
-
console.log(' scorecard <SYMBOL> 记分卡明细');
|
|
149
|
-
console.log(' history <SYMBOL> [days] 历史点位(≤7天)');
|
|
150
|
-
}
|
|
16
|
+
export { aci as default };
|
package/src/commands/balance.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* 2. GET /v1/dashboard/billing/usage → 已用量(可能多种格式,做兜底)
|
|
9
9
|
*
|
|
10
10
|
* 展示时换算成人民币(按 1 USD ≈ 7 元,只是给用户一个直观感受)。
|
|
11
|
-
* "还剩约N次对话":按每次对话约 ¥0.01
|
|
11
|
+
* "还剩约N次对话":按每次对话约 ¥0.01 预估(最便宜模型单次几厘到几分)。
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { DEFAULT_BASE_URL } from '../../bin/aixx.js';
|
|
@@ -16,7 +16,7 @@ import { loadApiKey, maskKey } from '../utils/env.js';
|
|
|
16
16
|
|
|
17
17
|
// 美元→人民币换算(仅用于展示,给用户一个直观感受)
|
|
18
18
|
const USD_TO_CNY = 7;
|
|
19
|
-
//
|
|
19
|
+
// 预估单次对话成本(元),用于"还能聊多少次"
|
|
20
20
|
const COST_PER_CHAT_CNY = 0.01;
|
|
21
21
|
// 所有对外请求统一 15 秒超时
|
|
22
22
|
const FETCH_TIMEOUT = 15000;
|
|
@@ -148,7 +148,9 @@ export async function balance(subArgs) {
|
|
|
148
148
|
// billing接口拿不到真实账户余额(它对unlimited token只返回1亿标记),
|
|
149
149
|
// 所以这里如实告知用户,引导去后台查精确余额。
|
|
150
150
|
console.log(`💰 计费方式:按账户余额扣费(注册送$0.5试用额度,用完需充值)`);
|
|
151
|
-
|
|
151
|
+
// 1120 WorkBuddy实测: unlimited档下dashboard/billing/usage返回的单位不可信(曾显示¥58969虚惊)
|
|
152
|
+
// 按账户余额扣费时"已用"以账户维度为准——这里不再展示误算值, 引导官方端点
|
|
153
|
+
console.log(`📊 已用额度:以账户维度计(请用下方官方入口查看精确值)`);
|
|
152
154
|
console.log(`💡 精确余额请登录AIXX后台查看:${baseUrl.replace(/\/v1$/, '')}`);
|
|
153
155
|
} else {
|
|
154
156
|
// 正常有限额度
|
|
@@ -163,6 +165,6 @@ export async function balance(subArgs) {
|
|
|
163
165
|
console.log('────────────────────────────────────');
|
|
164
166
|
console.log('\n💡 提示:');
|
|
165
167
|
console.log(' - 新用户注册送 $0.5 试用额度');
|
|
166
|
-
console.log(' -
|
|
168
|
+
console.log(' - glm-4-air 便宜,省着用能聊很久');
|
|
167
169
|
console.log(' - 余额不足时运行 aixx recharge 查看充值方式\n');
|
|
168
170
|
}
|
package/src/commands/config.js
CHANGED
|
@@ -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(`
|
|
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
|
+
}
|
package/src/commands/help.js
CHANGED
|
@@ -10,13 +10,14 @@ export function showHelp(version) {
|
|
|
10
10
|
╚══════════════════════════════════════════╝
|
|
11
11
|
|
|
12
12
|
用法:
|
|
13
|
-
aixx install [
|
|
13
|
+
aixx install [身份码] 安装AIXX skill到本地agent(含零配置)
|
|
14
14
|
aixx install --yes 非交互安装(脚本/CI用,跳过确认)
|
|
15
15
|
aixx search <关键词> 搜索AIXX能力库(数据/技能,免key)
|
|
16
16
|
aixx installed 查看安装状态(skill/账号/版本)
|
|
17
17
|
aixx config 配置或查看AIXX设置
|
|
18
18
|
aixx test 测试AIXX是否可用
|
|
19
19
|
aixx balance 查询账户余额(还剩多少钱)
|
|
20
|
+
aixx status 一条命令看全貌(身份编号·余额·数据API额度)
|
|
20
21
|
aixx models 列出可用模型(国产/海外分组)
|
|
21
22
|
aixx recharge [金额] 充值引导(默认$5)
|
|
22
23
|
aixx --version 查看版本
|
|
@@ -24,7 +25,7 @@ export function showHelp(version) {
|
|
|
24
25
|
|
|
25
26
|
安装示例:
|
|
26
27
|
npx aixxai install 普通安装(自动注册,送$0.5试用额度)
|
|
27
|
-
npx aixxai install zhangsan
|
|
28
|
+
npx aixxai install zhangsan 通过张三的身份码安装(绑定安装身份·非推荐码·无分润)
|
|
28
29
|
|
|
29
30
|
账户示例:
|
|
30
31
|
aixx balance 查看余额
|
|
@@ -36,7 +37,7 @@ export function showHelp(version) {
|
|
|
36
37
|
AIXX = "AI的谷歌"。装一个skill,agent就能调用全世界的AI能力。
|
|
37
38
|
永远不用碰key、参数、文档,一切通过对话。
|
|
38
39
|
|
|
39
|
-
文档:
|
|
40
|
+
文档:npx aixxai --help
|
|
40
41
|
`);
|
|
41
42
|
}
|
|
42
43
|
|