ultrastiching-cli 0.2.0 → 0.2.1
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 +3 -3
- package/package.json +1 -1
- package/src/prompt.js +13 -4
package/README.md
CHANGED
|
@@ -18,20 +18,20 @@ ultrastiching auth configure
|
|
|
18
18
|
|
|
19
19
|
`auth status` 只输出是否配置及来源。`auth sync` 由安装器自动调用:环境变量没有值时,从已有凭据文件同步到当前进程和持久环境。`auth configure` 已有 Key 时不重复输入;缺失时在本机终端隐藏输入一次,同时保存私有文件和持久环境。`--replace` 确认一次后更换两处的 Key。macOS 更新 Shell、launchd 环境和登录恢复任务;Windows 更新用户环境;Linux 更新 Shell 和用户 environment.d,有会话总线时同步服务启动环境。含 Key 的 POSIX 配置使用 0600,Windows 凭据文件使用私有 ACL。保存后完全退出并重启客户端。不要在 Agent 对话中填写 Key。`ultrastiching mcp headers` 只供 MCP 客户端调用,stdout 含鉴权头,Agent 不应执行或打印该命令的输出。
|
|
20
20
|
|
|
21
|
-
本版为 0.2.
|
|
21
|
+
本版为 0.2.1,支持共享凭据配置和安装器自动同步;输入 API Key 时回显星号,退格同步擦除,实际 Key 不回显。
|
|
22
22
|
|
|
23
23
|
## 安装与离线发现
|
|
24
24
|
|
|
25
25
|
从 npm 安装指定版本:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
npm install -g ultrastiching-cli@0.2.
|
|
28
|
+
npm install -g ultrastiching-cli@0.2.1
|
|
29
29
|
ultrastiching --help
|
|
30
30
|
ultrastiching list --search 交易日历
|
|
31
31
|
ultrastiching info plasma_trade_cal
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
`list` 和 `info` 使用随包携带的目录,不需要 API Key,不发送业务请求。也可安装维护者提供的包:`npm install -g ./ultrastiching-cli-0.2.
|
|
34
|
+
`list` 和 `info` 使用随包携带的目录,不需要 API Key,不发送业务请求。也可安装维护者提供的包:`npm install -g ./ultrastiching-cli-0.2.1.tgz`。源码环境使用下面的安装方式:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
cd meridian-cli
|
package/package.json
CHANGED
package/src/prompt.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { emitKeypressEvents } from "node:readline";
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* 本机输入 Key 时仅回显星号,让输入和粘贴都有可见反馈,退格同步擦除一个星号。
|
|
5
|
+
* 确认或取消时移除输入监听并恢复终端状态;真实凭据不回显,也不进入参数或 Shell 历史。
|
|
6
|
+
*/
|
|
4
7
|
export function hiddenKey(input = process.stdin, output = process.stdout) {
|
|
5
8
|
emitKeypressEvents(input);
|
|
6
9
|
const previousRaw = input.isRaw;
|
|
@@ -15,11 +18,17 @@ export function hiddenKey(input = process.stdin, output = process.stdout) {
|
|
|
15
18
|
const onKey = (text, key = {}) => {
|
|
16
19
|
if (key.ctrl && key.name === "c") return finish(new Error("已取消,未保存。"));
|
|
17
20
|
if (key.name === "return" || key.name === "enter") return finish();
|
|
18
|
-
if (key.name === "backspace")
|
|
19
|
-
|
|
21
|
+
if (key.name === "backspace") {
|
|
22
|
+
if (!value) return;
|
|
23
|
+
value = Array.from(value).slice(0, -1).join("");
|
|
24
|
+
output.write("\b \b");
|
|
25
|
+
} else if (text && !key.ctrl && !key.meta && !/[\x00-\x1f\x7f]/u.test(text)) {
|
|
26
|
+
value += text;
|
|
27
|
+
output.write("*".repeat(Array.from(text).length));
|
|
28
|
+
}
|
|
20
29
|
};
|
|
21
30
|
input.on("keypress", onKey);
|
|
22
|
-
output.write("粘贴 ultrastiching 数据 API Key
|
|
31
|
+
output.write("粘贴 ultrastiching 数据 API Key(Enter 确认,Ctrl+C 取消):");
|
|
23
32
|
});
|
|
24
33
|
}
|
|
25
34
|
|