@alphafox/cli 0.3.4 → 0.3.6

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.
Files changed (39) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +27 -6
  3. package/dist/auth/loopback-callback.js +3 -3
  4. package/dist/commands/run.js +26 -2
  5. package/dist/index.d.ts +4 -0
  6. package/dist/index.js +20 -1
  7. package/dist/install/types.d.ts +8 -1
  8. package/dist/install/types.js +1 -0
  9. package/dist/install/wizard.js +91 -53
  10. package/dist/keychain/windows-credential.d.ts +1 -1
  11. package/dist/keychain/windows-credential.js +1 -1
  12. package/dist/skills/manager.d.ts +96 -0
  13. package/dist/skills/manager.js +445 -0
  14. package/dist/skills/run-command.d.ts +22 -0
  15. package/dist/skills/run-command.js +143 -0
  16. package/dist/skills-manifest.json +141 -0
  17. package/dist/update/notify.d.ts +24 -0
  18. package/dist/update/notify.js +109 -0
  19. package/dist/update/run-command.d.ts +41 -0
  20. package/dist/update/run-command.js +204 -0
  21. package/dist/version.d.ts +1 -1
  22. package/dist/version.js +1 -1
  23. package/docs/agents/issue-tracker.md +2 -2
  24. package/docs/agents/triage-labels.md +1 -1
  25. package/docs/alphafox-cli-installation-guide.md +15 -16
  26. package/docs/index.html +11 -11
  27. package/docs/release-supply-chain.md +11 -6
  28. package/package.json +2 -2
  29. package/skills/account/SKILL.md +1 -1
  30. package/skills/admin/SKILL.md +1 -1
  31. package/skills/alphafox/SKILL.md +26 -4
  32. package/skills/alphafox-shared/SKILL.md +24 -4
  33. package/skills/auth/SKILL.md +2 -2
  34. package/skills/engine-backtest/SKILL.md +1 -1
  35. package/skills/exchange/SKILL.md +1 -1
  36. package/skills/market/SKILL.md +1 -1
  37. package/skills/notification/SKILL.md +1 -1
  38. package/skills/strategy/SKILL.md +1 -1
  39. package/skills/trading/SKILL.md +1 -1
package/docs/index.html CHANGED
@@ -3,10 +3,10 @@
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>Alphafox CLI</title>
6
+ <title>AlphaFox CLI</title>
7
7
  <meta
8
8
  name="description"
9
- content="仅需一行指令,在任意 Agent 操作 Alphafox。安装 CLI 与 Skills,用 Public Application API 做回测、策略与交易。"
9
+ content="仅需一行指令,在任意 Agent 操作 AlphaFox。安装 CLI 与 Skills,用 Public Application API 做回测、策略与交易。"
10
10
  />
11
11
  <meta name="theme-color" content="#FF991F" />
12
12
  <link rel="icon" href="favicon.svg" type="image/svg+xml" />
@@ -491,7 +491,7 @@
491
491
  <body>
492
492
  <header class="site-header">
493
493
  <div class="site-header-inner">
494
- <a class="brand" href="./" aria-label="Alphafox CLI">
494
+ <a class="brand" href="./" aria-label="AlphaFox CLI">
495
495
  <img class="mark" src="logo/alphafox-mark.svg" alt="" width="36" height="36" />
496
496
  <img
497
497
  class="wordmark wordmark-light"
@@ -544,8 +544,8 @@
544
544
 
545
545
  <main class="wrap">
546
546
  <section class="hero">
547
- <p class="kicker">Alphafox CLI</p>
548
- <h1 class="headline" data-i18n="headline">仅需一行指令,在任意 Agent 操作 Alphafox</h1>
547
+ <p class="kicker">AlphaFox CLI</p>
548
+ <h1 class="headline" data-i18n="headline">仅需一行指令,在任意 Agent 操作 AlphaFox</h1>
549
549
  <p class="lede" data-i18n="lede">
550
550
  安装 CLI 与 Skills,用 Public Application API 做回测、策略与交易。
551
551
  </p>
@@ -576,7 +576,7 @@
576
576
  <section class="panel" id="panel-agent" role="tabpanel" aria-labelledby="tab-agent" hidden>
577
577
  <p class="hint" data-i18n="agentHint">把下面这段话发给任意 AI Agent,它会按安装指南完成配置:</p>
578
578
  <div class="cmd">
579
- <code id="agent-cmd">帮我安装 Alphafox CLI:https://github.com/alphafoxai/alphafox-cli/blob/main/docs/alphafox-cli-installation-guide.md</code>
579
+ <code id="agent-cmd">帮我安装 AlphaFox CLI:https://github.com/alphafoxai/alphafox-cli/blob/main/docs/alphafox-cli-installation-guide.md</code>
580
580
  <button class="copy" type="button" data-copy="agent-cmd">
581
581
  <svg viewBox="0 0 16 16" fill="none" aria-hidden="true">
582
582
  <rect x="5.5" y="5.5" width="8" height="8" rx="1.5" stroke="currentColor" />
@@ -604,7 +604,7 @@
604
604
  </main>
605
605
 
606
606
  <footer class="site-footer">
607
- <span>© 2026 Alphafox</span>
607
+ <span>© 2026 AlphaFox</span>
608
608
  ·
609
609
  <a href="https://www.alphafox.app">alphafox.app</a>
610
610
  </footer>
@@ -613,7 +613,7 @@
613
613
  const copyLabels = { zh: { idle: "复制", done: "已复制" }, en: { idle: "Copy", done: "Copied" } };
614
614
  const i18n = {
615
615
  zh: {
616
- headline: "仅需一行指令,在任意 Agent 操作 Alphafox",
616
+ headline: "仅需一行指令,在任意 Agent 操作 AlphaFox",
617
617
  lede: "安装 CLI 与 Skills,用 Public Application API 做回测、策略与交易。",
618
618
  tabManual: "手动安装",
619
619
  tabAgent: "通过 AI Agent 安装",
@@ -629,10 +629,10 @@
629
629
  themeAriaDark: "切换到浅色模式",
630
630
  langAria: "切换语言",
631
631
  agentCmd:
632
- "帮我安装 Alphafox CLI:https://github.com/alphafoxai/alphafox-cli/blob/main/docs/alphafox-cli-installation-guide.md",
632
+ "帮我安装 AlphaFox CLI:https://github.com/alphafoxai/alphafox-cli/blob/main/docs/alphafox-cli-installation-guide.md",
633
633
  },
634
634
  en: {
635
- headline: "One command to operate Alphafox from any Agent",
635
+ headline: "One command to operate AlphaFox from any Agent",
636
636
  lede: "Install the CLI and Skills, then run backtests, strategies, and trades through the Public Application API.",
637
637
  tabManual: "Manual install",
638
638
  tabAgent: "Install via AI Agent",
@@ -648,7 +648,7 @@
648
648
  themeAriaDark: "Switch to light mode",
649
649
  langAria: "Switch language",
650
650
  agentCmd:
651
- "Install Alphafox CLI for me: https://github.com/alphafoxai/alphafox-cli/blob/main/docs/alphafox-cli-installation-guide.md",
651
+ "Install AlphaFox CLI for me: https://github.com/alphafoxai/alphafox-cli/blob/main/docs/alphafox-cli-installation-guide.md",
652
652
  },
653
653
  };
654
654
 
@@ -58,12 +58,17 @@ OIDC-provenance release.
58
58
  - Skills major aligns with CLI major. There is no separate Skills registry
59
59
  in v1 and no silent download of a different Skills version at runtime.
60
60
  - `npm install -g @alphafox/cli` places `skills/` next to the binary only.
61
- Agents do not load that directory. `alphafox install` (and the Agent
62
- install guide) copy those files into Agent skill dirs via
63
- `npx skills add`:
64
- 1. the globally installed package path (co-versioned with the CLI)
65
- 2. the running package / checkout `skills/` tree
66
- 3. GitHub `alphafoxai/alphafox-cli` as a last-resort fallback
61
+ Agents do not load that directory. `alphafox install`, `alphafox update`,
62
+ and `alphafox skills sync` verify `dist/skills-manifest.json`, then copy
63
+ only from that exact package into global Agent skill dirs.
64
+ - GitHub `main` is not an update fallback. A missing or invalid package
65
+ manifest fails closed instead of silently changing the Skills version.
66
+ - Sync state and per-Skill hashes live under the AlphaFox config directory.
67
+ Missing or unchanged stale Skills may update automatically. Modified Skills
68
+ require `alphafox skills sync --force --yes` and are backed up first.
69
+ - Retired Skills are removed only when the state proves they are AlphaFox
70
+ managed and unmodified. Failed copy/removal verification does not advance
71
+ sync state.
67
72
  - `contractVersion` on the CLI profile MUST match the Public API
68
73
  `contractVersion` (or the documented compatible range). Mismatch → fail
69
74
  closed; do not download an older contract or degrade quietly.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alphafox/cli",
3
- "version": "0.3.4",
4
- "description": "Alphafox CLI — Agent/Human entry for the public Application API.",
3
+ "version": "0.3.6",
4
+ "description": "AlphaFox CLI — Agent/Human entry for the public Application API.",
5
5
  "type": "commonjs",
6
6
  "bin": {
7
7
  "alphafox": "bin/alphafox.js"
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-account
3
3
  description: Account, wallet, and subscription read paths.
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  ---
6
6
 
7
7
  # Account / wallet
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-admin
3
3
  description: Admin-only operations reusing Web role authorization.
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  ---
6
6
 
7
7
  # Admin
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: alphafox
3
- description: Alphafox CLI entry router. Use for any Alphafox request — install, login, whoami, 回测, engine backtest, strategy chat, traders, ticker/标的 resolve, market data, exchange connectors, wallet, subscriptions, notifications, or admin. Start here, then open the routed domain skill. Do not guess alphafox-engine-backtest vs alphafox-strategy from memory.
4
- version: 0.3.4
3
+ description: AlphaFox CLI entry router. Use for any AlphaFox request — install, update, login, whoami, 回测, engine backtest, strategy chat, traders, ticker/标的 resolve, market data, exchange connectors, wallet, subscriptions, notifications, or admin. If a CLI command prints `[alphafox] update available`, ask the user「检测到新的版本,是否需要我帮你升级?」and only then run `alphafox update --format json --no-input`. Start here, then open the routed domain skill. Do not guess alphafox-engine-backtest vs alphafox-strategy from memory.
4
+ version: 0.3.6
5
5
  ---
6
6
 
7
- # Alphafox
7
+ # AlphaFox
8
8
 
9
9
  This skill only routes. After choosing a row, **read that skill's `SKILL.md` and follow it**. Do not improvise domain procedures from this file.
10
10
 
@@ -16,7 +16,7 @@ Human-mentioned tickers go through `alphafox-market` (`alphafox resolve-symbols`
16
16
 
17
17
  | User intent | Skill |
18
18
  |---|---|
19
- | Install, doctor, version, catalog, how to call the CLI | `alphafox-shared` |
19
+ | Install, update, Skills status/sync, doctor, version, catalog, how to call the CLI | `alphafox-shared` |
20
20
  | Login, logout, whoami, profile, staging vs production | `alphafox-auth` |
21
21
  | Coin / ticker / 标的 / `BTC/USDT:USDT` / resolve a misspelled symbol | `alphafox-market` |
22
22
  | Engine WASM backtest, experiment, `engine-backtest run`, persist a local run | `alphafox-engine-backtest` |
@@ -29,6 +29,28 @@ Human-mentioned tickers go through `alphafox-market` (`alphafox resolve-symbols`
29
29
 
30
30
  If several rows apply, load **all** of them (typical: `alphafox-shared` + `alphafox-market` + one domain skill).
31
31
 
32
+ ## Upgrade reminder
33
+
34
+ The CLI may print this on **stderr** at most once every 24 hours:
35
+
36
+ ```text
37
+ [alphafox] update available: 0.3.5 -> 0.3.6. After the user confirms, run: alphafox update --format json --no-input
38
+ ```
39
+
40
+ If you see that notice (or `updateAvailable: true` from `alphafox update --check`):
41
+
42
+ 1. Ask the user: **检测到新的版本,是否需要我帮你升级?**
43
+ 2. Wait for an explicit yes. Do not upgrade on your own.
44
+ 3. After they confirm:
45
+
46
+ ```bash
47
+ alphafox update --format json --no-input
48
+ ```
49
+
50
+ 4. Tell the user to **restart the AI tool** so the new Skills load.
51
+
52
+ Do not install Skills from GitHub. Details and dry-run / check commands live in `alphafox-shared`.
53
+
32
54
  ## Do not mix these backtest paths
33
55
 
34
56
  - Local Engine tape + wasm + optional persist → `alphafox-engine-backtest` (`alphafox engine-backtest run`, hyphen).
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: alphafox-shared
3
- description: Shared Alphafox CLI rules for Agents — auth, profiles, envelopes, risk gates, and public operationIds only.
4
- version: 0.3.4
3
+ description: Shared AlphaFox CLI rules for Agents — auth, profiles, envelopes, risk gates, and public operationIds only.
4
+ version: 0.3.6
5
5
  ---
6
6
 
7
- # Alphafox shared Agent contract
7
+ # AlphaFox shared Agent contract
8
8
 
9
9
  User-facing entry is skill `alphafox` (router). This file is the shared CLI contract every domain skill assumes.
10
10
 
@@ -14,7 +14,7 @@ Co-versioned with `@alphafox/cli`. Query compatibility with `alphafox version --
14
14
 
15
15
  Prefer the wizard (CLI + Agent Skills) or the Agent install guide. Do not treat
16
16
  `npm install -g @alphafox/cli` as enough for Agents — Skills must be registered
17
- with `npx skills add`.
17
+ with `alphafox skills sync`.
18
18
 
19
19
  ```bash
20
20
  npx @alphafox/cli@latest install
@@ -24,6 +24,26 @@ npx @alphafox/cli version --format json --no-input
24
24
  npx @alphafox/cli doctor --format json --no-input
25
25
  ```
26
26
 
27
+ The CLI checks npm at most once every 24 hours and only prints a notice on
28
+ **stderr**. It never auto-upgrades. If you see
29
+ `[alphafox] update available` (or `updateAvailable: true`), ask the user:
30
+
31
+ **检测到新的版本,是否需要我帮你升级?**
32
+
33
+ Wait for an explicit yes. Then keep CLI and Skills co-versioned:
34
+
35
+ ```bash
36
+ alphafox update --check --format json --no-input
37
+ alphafox update --format json --no-input
38
+ alphafox skills status --format json --no-input
39
+ ```
40
+
41
+ After a successful `alphafox update`, tell the user to restart the AI tool.
42
+
43
+ Never update AlphaFox Skills independently from GitHub. If `skills status`
44
+ reports local modifications, stop and ask before using
45
+ `alphafox skills sync --force --yes`; the CLI backs up replaced files.
46
+
27
47
  - Default profile: `production`. Use `--profile staging|local` explicitly.
28
48
  - Tokens: OS keychain only (macOS Keychain, Linux Secret Service, Windows Credential Manager). Never pass `--token`. Never read tokens from config JSON.
29
49
  - Automation tokens are **not supported in v1** (interactive Device Flow / PKCE only).
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-auth
3
- description: Login, status, logout, whoami, and environment isolation for Alphafox CLI.
4
- version: 0.3.4
3
+ description: Login, status, logout, whoami, and environment isolation for AlphaFox CLI.
4
+ version: 0.3.6
5
5
  ---
6
6
 
7
7
  # Auth Skill
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-engine-backtest
3
3
  description: Local Engine WASM backtest (alphafox engine-backtest run|sweep) vs catalog experiment CRUD.
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  ---
6
6
 
7
7
  # Engine Backtest
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-exchange
3
3
  description: Exchange connectors list and connection management via Public API.
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  ---
6
6
 
7
7
  # Exchange connectors
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-market
3
3
  description: Market data, ticker resolution, and spread-radar readonly queries.
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  ---
6
6
 
7
7
  # Market
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-notification
3
3
  description: Notification channels and subscriptions.
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  ---
6
6
 
7
7
  # Notification
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-strategy
3
3
  description: Strategy definitions and chats via public operationIds.
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  ---
6
6
 
7
7
  # Strategy / Chat
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-trading
3
3
  description: Traders list and high-risk start/stop with confirmation gates.
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  ---
6
6
 
7
7
  # Trading