maoda-commander-tt 0.0.61 → 0.0.63

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 CHANGED
@@ -60,7 +60,7 @@ tt-cli/
60
60
  │ ├── modules/ # 领域逻辑:不依赖 commander,返回 Result<T>
61
61
  │ │ ├── ark/ git/ pippit/ static-deploy/ video-generation/ xyq/ xyq-tasks/
62
62
  │ ├── bedrock/ # 与业务无关的基础设施
63
- │ │ ├── config/ cross-app-settings/ download/ pkg/ process/ uuid/
63
+ │ │ ├── cross-app-settings/ download/ process/ uuid/
64
64
  │ └── constants/ # 兼容性常量(已弃用的内置回退值)
65
65
  ├── scripts/release.mjs # 发布脚本
66
66
  ├── ops/static-deploy/ # 服务器侧部署说明
@@ -92,6 +92,26 @@ pnpm test
92
92
  pnpm build && pnpm test:dist
93
93
  ```
94
94
 
95
+ ## 读写配置
96
+
97
+ ```bash
98
+ tt tool set-config -k example.key -v 'hello world'
99
+ tt tool set-config -k example.key -v '' --label '标签' --description '说明'
100
+ tt tool get-config example.key
101
+ ```
102
+
103
+ `set-config` 的 key、value 必填,value 原样按字符串保存。label、description 省略时
104
+ 写入空字符串,更新已有配置也一样。共用 `~/.cli_settings/settings.json`,环境变量
105
+ `TT_CROSS_APP_SETTINGS_FILE` 可覆盖路径;文件不存在时安全创建,已有文件只覆盖指定 key,
106
+ 保留其他配置。无效文件或检测到写入冲突时失败并保留原内容。成功返回 key、configured、
107
+ revision,不回显 value。
108
+
109
+ ## 抖音视频解析
110
+
111
+ `tt pippit douyin-video '<抖音链接或完整分享文案>'` 返回解析后的视频地址。
112
+ 鉴权与 XYQ 共用配置中的 `sessionid_pippitcn_web` Cookie,并自动获取 UID;
113
+ 只需提供有效 Cookie,无需另外配置 token、UID 或 workspace。
114
+
95
115
  ## 后台启动 Codex
96
116
 
97
117
  `tt codex`、`tt ai run` 和本地图片 worker 共用可执行文件查找顺序:
@@ -265,20 +285,17 @@ tt deploy --delete demo
265
285
 
266
286
  ### 本机配置与接口鉴权
267
287
 
268
- 在 `~/.config/maoda-commander-tt/maoda-commander-tt.json` 的已有配置中增加
269
- `staticDeploy` 字段,保留其他字段。将示例 token 替换为已配置到服务器的固定 token:
288
+ 部署与 `tt tool get-config` / `tt tool set-config` 使用同一份跨应用设置,默认文件为
289
+ `~/.cli_settings/settings.json`;环境变量 `TT_CROSS_APP_SETTINGS_FILE` 可覆盖路径。
290
+ 配置以下两个独立的字符串键,点号是键名的一部分,不使用嵌套的 `staticDeploy` 对象:
270
291
 
271
- ```json
272
- {
273
- "staticDeploy": {
274
- "apiUrl": "https://www.imaoda.com/api/tt",
275
- "token": "<你的固定部署 token>"
276
- }
277
- }
278
- ```
292
+ | 键 | 值 |
293
+ | --- | --- |
294
+ | `staticDeploy.apiUrl` | `https://www.imaoda.com/api/tt` |
295
+ | `staticDeploy.token` | 与服务器一致的固定部署 token |
279
296
 
280
- `apiUrl` 指向部署 API,命令自动为请求添加 `Authorization: Bearer <token>`。
281
- 固定 token 只保存在本机配置中,不打包到 npm,也不放进命令行参数、公开目录或
297
+ `staticDeploy.apiUrl` 指向部署 API,命令自动为请求添加 `Authorization: Bearer <token>`。
298
+ 固定 token 只保存在跨应用设置中,不打包到 npm,也不放进部署命令参数、公开目录或
282
299
  返回结果。部署不需要本机 SSH 权限;换电脑时配置同一 API 地址及 token 即可。
283
300
  本机需要 Node.js 22.13.0 或更高版本和 `tar`。API 只接受 HTTPS(本机测试的
284
301
  loopback HTTP 除外),客户端不跟随重定向,以免将 token 发送到其他地址。
@@ -286,7 +303,7 @@ loopback HTTP 除外),客户端不跟随重定向,以免将 token 发送
286
303
  服务器使用 `TT_DEPLOY_TOKEN` 验证部署、删除和目录查询请求;`TT_DEPLOY_ROOT` 和
287
304
  `TT_DEPLOY_BASE_URL` 决定落盘根目录和公开 URL,不由调用端任意指定。
288
305
  当前限制为每次归档 50 MiB、最多 2 个并发操作。收到 token 的人可以部署、覆盖或删除
289
- 这个根目录下的项目;需要更换时同时更新服务器和本机配置。
306
+ 这个根目录下的项目;需要更换时同时更新服务器和跨应用设置。
290
307
 
291
308
  服务器需要预先配置 API 和 nginx 路由,参见 [部署运维说明](ops/static-deploy/README.md)。
292
309
  当前服务器在静态入口上