wind-alice
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesewind-alice
wind-alice
一个 CLI:把用户问题 + 指定的 Alice Skill(中文或英文名均可) 送到万得 Alice Agent 接口,按 SSE 流式拉取并打印。agentResult.value
A CLI tool that sends user questions + specified Alice Skills (both Chinese and English names are supported) to the Wind Alice Agent interface, pulls and printsin SSE streaming mode.agentResult.value
关键机制(必读)
Key Mechanisms (Must Read)
实测:Alice 服务端不是通过 / 来选择 Skill 的,而是通过 prompt 文本前缀:
selectedSkillIdsactivatedSkillstext
Using "<英文 Skill 名>" skill:<原 prompt>同时把 切到 、 设为 ,且不携带 。本 CLI 已在 里封装这套行为;外部只需要传 。
chatMode"12"originalChatMode"4"metadata.agentCardbuildBody--skill "<Skill 名>"因此:
- 同时支持中文名和英文名,不是 id。例如下列写法等价:
--skill- (中文 nameZh)
--skill "上市公司调研问题清单" - (英文 nameEn)
--skill "Stock DD List" - (英文模糊:忽略大小写/空格/
--skill "stock-dd-list")-_
- 命中后 CLI 统一回填英文名拼入文本前缀(服务端按英文识别 Skill)。
- 未在 中登记的名称会以
KNOWN_SKILLS提示,但仍按字面值拼接前缀提交(portal 上新建/改名的 Skill 也能立刻使用)。[warn]
Actual test shows that the Alice server does NOT select Skills via / , but through prompt text prefix:
selectedSkillIdsactivatedSkillstext
Using "<English Skill Name>" skill:<original prompt>At the same time, switch to , set to , and do not carry . This CLI has encapsulated this behavior in ; external users only need to pass .
chatMode"12"originalChatMode"4"metadata.agentCardbuildBody--skill "<Skill Name>"Therefore:
- supports both Chinese and English names, not IDs. The following examples are equivalent:
--skill- (Chinese nameZh)
--skill "上市公司调研问题清单" - (English nameEn)
--skill "Stock DD List" - (English fuzzy match: ignore case/spaces/
--skill "stock-dd-list")-_
- After matching, the CLI unifiedly fills in the English name into the text prefix (the server recognizes Skills by English names).
- Names not registered in will prompt with
KNOWN_SKILLS, but still submit with the literal prefix (newly created/renamed Skills on the portal can be used immediately).[warn]
何时使用本技能
When to Use This Tool
满足任一条件就用:
- 用户明确说:"用 Alice 跑 / 调 / 执行 …"、"用 Wind 的 XX 技能跑 …"。
- 用户点名 Alice 的某个专业子 Skill(如「上市公司调研问题清单」「公司一页纸」「事实核验」「按主题选股」等)。
- 用户的问题与某个 Skill 的能力高度匹配,且希望走专业链路而不是 auto 路由。
不要用本技能的场景:用户只是普通金融问答、不在意走哪个子 Skill — 让 Alice 自己 auto 路由即可(不传 )。
--skillUse it if any of the following conditions are met:
- Users explicitly say: "Run/call/execute ... with Alice", "Run ... with Wind's XX Skill".
- Users specify a professional sub-Skill of Alice (such as "Listed Company Research Question List", "Company One-Page Memo", "Fact Verification", "Stock Selection by Theme", etc.).
- Users' questions highly match the capabilities of a certain Skill, and they expect to use the professional link instead of auto-routing.
Scenarios where this tool should NOT be used: Users only ask ordinary financial questions and don't care which sub-Skill is used — let Alice handle auto-routing (do not pass ).
--skill调用方式(Agent 工作流)
Invocation Method (Agent Workflow)
- 拿到用户问题 → 决定 Skill:
- 用户点名 Skill → 直接传该 Skill 的中文名或英文名到 (脚本会自动归一化并回填英文名);
--skill - 用户没点名但问题明显属于某 Skill(如「核查事实」「公司调研问题清单」「财报点评」)→ 可建议并征询后再指定;
- 否则不传 ,走 auto。
--skill
- 用户点名 Skill → 直接传该 Skill 的中文名或英文名到
- 发起调用前用一句话告知用户:Alice 专业 Skill 耗时常为 数分钟到十几分钟(复杂研报、一页纸、可比分析等更久),属正常现象,请耐心等待,不要中途取消命令或重复发起相同请求。
- 先定位本 skill 目录:下面命令里的 是相对当前
scripts/wind-alice.mjs所在的SKILL.md目录。若当前工作目录不是该目录,先wind-alice到该目录再执行。cd - 执行(任一种写法都可以):
bash
node scripts/wind-alice.mjs --prompt "<USER_QUESTION>" --skill "<中文 Skill 名>"
node scripts/wind-alice.mjs --prompt "<USER_QUESTION>" --skill "<英文 Skill 名>"- 等流式输出结束后,基于 汇总回复给用户。等待期间若终端长时间无新输出,仍应继续等至进程退出,勿误判为卡死。
agentResult.value
也可以先列已知 Skill 给用户挑:bashnode scripts/wind-alice.mjs list-skills
- Receive user question → determine the Skill:
- If the user specifies a Skill → directly pass the Chinese or English name of the Skill to (the script will automatically normalize and fill in the English name);
--skill - If the user does not specify a Skill but the question clearly belongs to a certain Skill (such as "Verify Facts", "Company Research Question List", "Financial Report Review") → suggest and confirm with the user before specifying;
- Otherwise, do not pass and use auto-routing.
--skill
- If the user specifies a Skill → directly pass the Chinese or English name of the Skill to
- Before initiating the call, inform the user with one sentence: Alice professional Skills usually take several minutes to over ten minutes (complex research reports, one-page memos, comparable analysis, etc. take longer), which is normal. Please wait patiently, do not cancel the command midway or repeatedly initiate the same request.
- Locate this tool's directory first: In the commands below, is relative to the
scripts/wind-alice.mjsdirectory where thiswind-aliceis located. If the current working directory is not this directory, runSKILL.mdto enter it first.cd - Execute (any of the following works):
bash
node scripts/wind-alice.mjs --prompt "<USER_QUESTION>" --skill "<Chinese Skill Name>"
node scripts/wind-alice.mjs --prompt "<USER_QUESTION>" --skill "<English Skill Name>"- After the streaming output ends, summarize and reply to the user based on . If there is no new output in the terminal for a long time during waiting, continue to wait until the process exits, do not misjudge it as stuck.
agentResult.value
You can also list known Skills for users to choose first:bashnode scripts/wind-alice.mjs list-skills
一次性配置
One-Time Configuration
- Node.js 18+(自带 )。
fetch - 配置 WIND_API_KEY:
- 优先级:环境变量 > 本 skill 目录
WIND_API_KEY(config.json) >{"wind_api_key":"..."}(dotenv:%USERPROFILE%\.wind-aifinmarket\config)。WIND_API_KEY=... - Key 获取入口:https://aifinmarket.wind.com.cn/#/user/overview。
- 优先级:
- 可选:覆盖默认接口地址。
WIND_ALICE_API_URL
- Node.js 18+ (comes with ).
fetch - Configure WIND_API_KEY:
- Priority: environment variable >
WIND_API_KEYin this tool's directory (config.json) >{"wind_api_key":"..."}(dotenv:%USERPROFILE%\.wind-aifinmarket\config).WIND_API_KEY=... - Key acquisition entry: https://aifinmarket.wind.com.cn/#/user/overview.
- Priority:
- Optional: Override the default interface address with .
WIND_ALICE_API_URL
安全要求
Security Requirements
- 绝不要输出真实 、Bearer token、
WIND_API_KEY内容或config.json内容。%USERPROFILE%\.wind-aifinmarket\config - 若需要说明下载方式,只展示 这种占位格式;不要拼出含真实 Key 的 curl、PowerShell 或 HTTP 示例。
Authorization: Bearer <WIND_API_KEY> - Alice 返回的报告 URL 可以在当前用户会话中用于交付和下载;写入 README、示例、工单、提交信息等长期材料时使用占位 URL。
- Never output the real , Bearer token, content of
WIND_API_KEYorconfig.json.%USERPROFILE%\.wind-aifinmarket\config - If you need to explain the download method, only show the placeholder format like ; do not create curl, PowerShell or HTTP examples with real Keys.
Authorization: Bearer <WIND_API_KEY> - The report URL returned by Alice can be used for delivery and download in the current user session; use placeholder URLs when writing to READMEs, examples, work orders, submission information and other long-term materials.
文件下载处理
File Download Handling
许多 Skill(公司一页纸 / 调研问题清单 / 季报点评 / 市场规模测算 / 可比公司分析 等)的 末尾会附一个可下载文件链接。
agentResult.valueCLI 在每次调用结束时会自动扫描 value 中的可下载文件链接,直接用 作 Bearer Token 下载到当前工作目录,并把下载结果(已保存路径或失败原因)打到 stderr:
WIND_API_KEYtext
=== 检测到 1 个可下载文件,正在下载到当前目录:<cwd> ===
- <文件名>
已保存:<cwd>\<文件名>重要事实:
- 文件接口与 Agent 接口 共用同一份 (即万得 AIFin Market 提供的 apiKey),CLI 内部自带
WIND_API_KEY走 HTTP GET 下载。Authorization: Bearer <WIND_API_KEY> - 下载目标目录是用户当前命令执行所在目录();同名文件冲突会自动追加
process.cwd()、(1)等后缀,不会覆盖已有文件。(2) - CLI 不会把 Key 打印到日志;下载结果只出现在 stderr,不会污染 stdout 的 主体。
agentResult.value - 下载失败(401 / 403 / 网络异常等)只会打印失败原因 + 原始 URL,不影响主流程退出码。
调用结束后无需再向用户解释"如何下载",直接告诉用户文件已保存到哪里即可;只有当 CLI 报"下载失败"时才需要把 URL 与失败原因转告用户排查。
Many Skills (Company One-Page Memo / Research Question List / Quarterly Report Review / Market Size Estimation / Comparable Company Analysis, etc.) will attach a downloadable file link at the end of .
agentResult.valueAt the end of each call, the CLI will automatically scan for downloadable file links in the value, directly use as the Bearer Token to download to the current working directory, and print the download result (saved path or failure reason) to stderr:
WIND_API_KEYtext
=== Detected 1 downloadable file, downloading to current directory: <cwd> ===
- <File Name>
Saved to: <cwd>\<File Name>Important Facts:
- The file interface and Agent interface share the same (i.e., the apiKey provided by Wind AIFin Market). The CLI internally uses
WIND_API_KEYfor HTTP GET downloads.Authorization: Bearer <WIND_API_KEY> - The download target directory is the current directory where the user executes the command (); if there is a conflict with existing files of the same name, suffixes like
process.cwd(),(1)will be automatically added, and existing files will not be overwritten.(2) - The CLI will not print the Key to logs; download results only appear in stderr and will not pollute the main body of in stdout.
agentResult.value - Download failures (401 / 403 / network exceptions, etc.) will only print the failure reason + original URL, and will not affect the exit code of the main process.
After the call ends, there is no need to explain "how to download" to the user; directly tell the user where the file is saved. Only when the CLI reports "download failed" do you need to inform the user of the URL and failure reason for troubleshooting.
硬性要求
Mandatory Requirements
- PowerShell 下读取本文档必须显式使用 UTF-8:例如 ;若看到中文乱码,先按 UTF-8 重新读取,不能基于乱码内容执行。
Get-Content -Encoding UTF8 skills\wind-alice\SKILL.md - 接受中文或英文 Skill 名(与
--skill/ portal 一致)。脚本会按 nameEn → nameZh → normalize(nameEn) → normalize(nameZh) 顺序匹配;命中后统一以KNOWN_SKILLS拼入文本前缀提交,服务端必须看到英文名才识别。中文别名/缩写/口语表述不会自动翻译,请勿擅自意译;不确定时先nameEn。list-skills - Prompt 必须非空:空白或缺失时直接退出码 2,不发请求。
- 不得把 Key 打印到日志:脚本仅在 头里使用,不会输出到 stdout/stderr。
Authorization - 流式必须等到结束:CLI 已在父子进程间 子进程退出;切勿改成"发完即返"。
await - 耗时预期与耐心提示:调用前须提醒用户 Alice Skill 可能较慢;执行中不得因等待过久而中断 CLI、改走其它工具或并行重复调用同一任务。
- 不要凭空构造 /
selectedSkillIds之类的旧字段去指定 Skill — 已实测不生效,必须走文本前缀。agentCard
- Must explicitly use UTF-8 when reading this document in PowerShell: For example, ; if you see garbled Chinese characters, re-read it in UTF-8 first, do not execute based on garbled content.
Get-Content -Encoding UTF8 skills\wind-alice\SKILL.md - accepts Chinese or English Skill names (consistent with
--skill/ portal). The script will match in the order of nameEn → nameZh → normalize(nameEn) → normalize(nameZh); after matching, it will unifiedly useKNOWN_SKILLSto fill in the text prefix for submission, and the server must see the English name to recognize it. Chinese aliases/abbreviations/spoken expressions will not be automatically translated; do not translate arbitrarily; runnameEnif unsure.list-skills - Prompt must not be empty: If it is blank or missing, exit directly with code 2 without sending a request.
- Do not print the Key to logs: The script only uses it in the header and will not output it to stdout/stderr.
Authorization - Must wait for streaming to end: The CLI has already the child process exit between parent and child processes; do not change it to "return immediately after sending".
await - Time-consuming expectation and patience reminder: Must remind the user that Alice Skills may be slow before calling; do not interrupt the CLI, switch to other tools or repeatedly call the same task in parallel due to long waiting time.
- Do not arbitrarily construct old fields like /
selectedSkillIdsto specify Skills — it has been tested to be ineffective, must use the text prefix.agentCard
更新提示处理
Update Notification Handling
每次调用 wind-alice.mjs 后,留意 stderr 是否包含 前缀的提示。
[wind-skills]- 检测到新版():同一会话首次看到时必须转告用户一次(同会话再次调用不重复);把清单和
检测到新版可用那一行完整带给用户。命令是否带升级命令:由脚本按 lock 来源自动决定(global 装的带-g,project 装的不带;Gitee 源会改成-g重装),直接照搬即可,不要自行加减npx skills add ...。-g - 检查失败()或无法确认(
检查更新失败):只是更新检查提醒,不影响当前 Alice 调用;同一会话首次看到时简要告知用户一次即可,不可重复提示,也不能当作主调用失败。遇到版本相关错误,可建议用户升级 skill(命令以实际 stderr 输出的无法确认是否最新为准)。升级命令:
After each call to wind-alice.mjs, check if stderr contains prompts prefixed with .
[wind-skills]- New version detected (): Must inform the user once when seeing it for the first time in the same session (do not repeat in subsequent calls in the same session); bring the list and the full line of
New version availableto the user. Whether the command includesUpgrade command:is automatically determined by the script based on the lock source (global installations include-g, project installations do not; Gitee source will be changed to-gfor reinstallation), directly copy it without adding or removingnpx skills add ...by yourself.-g - Update check failed () or Cannot confirm (
Failed to check for updates): This is just an update check reminder and does not affect the current Alice call; briefly inform the user once when seeing it for the first time in the same session, do not repeat the prompt, and do not treat it as a main call failure. If you encounter version-related errors, you can suggest the user upgrade the tool (the command is subject to theCannot confirm if it is the latest versionoutput in the actual stderr).Upgrade command: