aria-code 4.1.3__py3-none-any.whl

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 (284) hide show
  1. agents/__init__.py +32 -0
  2. agents/base.py +190 -0
  3. agents/deep/__init__.py +37 -0
  4. agents/deep/calibration_loop.py +144 -0
  5. agents/deep/critic.py +125 -0
  6. agents/deep/deepen.py +193 -0
  7. agents/deep/models.py +149 -0
  8. agents/deep/pipeline.py +164 -0
  9. agents/deep/quant_fusion.py +192 -0
  10. agents/deep/themes.py +95 -0
  11. agents/deep/tiers.py +106 -0
  12. agents/financial/__init__.py +10 -0
  13. agents/financial/catalyst.py +279 -0
  14. agents/financial/debate.py +145 -0
  15. agents/financial/earnings.py +303 -0
  16. agents/financial/fundamental.py +159 -0
  17. agents/financial/macro.py +99 -0
  18. agents/financial/news.py +207 -0
  19. agents/financial/risk.py +132 -0
  20. agents/financial/sector.py +279 -0
  21. agents/financial/synthesis.py +274 -0
  22. agents/financial/technical.py +258 -0
  23. agents/portfolio_agent.py +333 -0
  24. agents/realty/__init__.py +62 -0
  25. agents/realty/asset_diagnosis.py +150 -0
  26. agents/realty/business_match.py +165 -0
  27. agents/realty/cashflow_verify.py +208 -0
  28. agents/realty/contract_rules.py +209 -0
  29. agents/realty/energy_anomaly.py +188 -0
  30. agents/realty/exit_settlement.py +207 -0
  31. agents/realty/fulfillment_risk.py +205 -0
  32. agents/realty/ops_optimize.py +159 -0
  33. agents/realty/revenue_share.py +214 -0
  34. agents/registry.py +144 -0
  35. agents/sports/__init__.py +0 -0
  36. agents/sports/football_agent.py +169 -0
  37. agents/team.py +289 -0
  38. aliyun_data_client.py +660 -0
  39. apps/README.md +12 -0
  40. apps/__init__.py +2 -0
  41. apps/channels/README.md +15 -0
  42. apps/cli/README.md +13 -0
  43. apps/cli/__init__.py +2 -0
  44. apps/cli/bootstrap.py +99 -0
  45. apps/cli/codegen_paths.py +29 -0
  46. apps/cli/commands/__init__.py +16 -0
  47. apps/cli/commands/analysis_cmds.py +288 -0
  48. apps/cli/commands/backtest_cmds.py +1887 -0
  49. apps/cli/commands/broker_cmds.py +1154 -0
  50. apps/cli/commands/business_workflow_cmds.py +289 -0
  51. apps/cli/commands/catalog.py +84 -0
  52. apps/cli/commands/data_cmds.py +405 -0
  53. apps/cli/commands/diagnostic_cmds.py +179 -0
  54. apps/cli/commands/diagnostic_ops_cmds.py +696 -0
  55. apps/cli/commands/finance_render.py +12 -0
  56. apps/cli/commands/market.py +399 -0
  57. apps/cli/commands/market_cmds.py +1276 -0
  58. apps/cli/commands/market_context.py +425 -0
  59. apps/cli/commands/market_render.py +7 -0
  60. apps/cli/commands/model_cmds.py +1579 -0
  61. apps/cli/commands/ops_cmds.py +668 -0
  62. apps/cli/commands/portfolio_cmds.py +962 -0
  63. apps/cli/commands/report.py +377 -0
  64. apps/cli/commands/scaffold_templates.py +617 -0
  65. apps/cli/commands/session_cmds.py +179 -0
  66. apps/cli/commands/session_ux_cmds.py +280 -0
  67. apps/cli/commands/team.py +588 -0
  68. apps/cli/commands/team_render.py +8 -0
  69. apps/cli/commands/ui_cmds.py +358 -0
  70. apps/cli/commands/workflow_cmds.py +279 -0
  71. apps/cli/commands/workspace_cmds.py +1414 -0
  72. apps/cli/config_paths.py +70 -0
  73. apps/cli/config_store.py +61 -0
  74. apps/cli/deterministic.py +122 -0
  75. apps/cli/direct.py +48 -0
  76. apps/cli/github_app_auth.py +135 -0
  77. apps/cli/handlers/__init__.py +11 -0
  78. apps/cli/handlers/broker_handlers.py +122 -0
  79. apps/cli/handlers/chart_handlers.py +1309 -0
  80. apps/cli/handlers/market_handlers.py +2509 -0
  81. apps/cli/handlers/realty_handlers.py +114 -0
  82. apps/cli/handlers/strategy_advice.py +82 -0
  83. apps/cli/hooks.py +180 -0
  84. apps/cli/i18n.py +284 -0
  85. apps/cli/intent.py +136 -0
  86. apps/cli/intent_router.py +217 -0
  87. apps/cli/lifecycle_hooks.py +48 -0
  88. apps/cli/main.py +29 -0
  89. apps/cli/market_metadata.py +135 -0
  90. apps/cli/market_universe.py +265 -0
  91. apps/cli/message_processing.py +257 -0
  92. apps/cli/plan_mode.py +139 -0
  93. apps/cli/plotly_html.py +15 -0
  94. apps/cli/prediction_feedback.py +202 -0
  95. apps/cli/preflight.py +497 -0
  96. apps/cli/project_aria.py +60 -0
  97. apps/cli/prompts/__init__.py +0 -0
  98. apps/cli/prompts/coding.py +658 -0
  99. apps/cli/prompts/system_prompts.py +531 -0
  100. apps/cli/prompts/ui.py +434 -0
  101. apps/cli/providers/__init__.py +1 -0
  102. apps/cli/providers/base.py +271 -0
  103. apps/cli/providers/chat_routing.py +80 -0
  104. apps/cli/providers/llm/__init__.py +1 -0
  105. apps/cli/providers/llm/ollama_stream.py +1170 -0
  106. apps/cli/providers/llm/sse_stream.py +216 -0
  107. apps/cli/providers/runtime_bridge.py +185 -0
  108. apps/cli/runtime_consumer.py +489 -0
  109. apps/cli/session_export.py +87 -0
  110. apps/cli/session_jsonl.py +207 -0
  111. apps/cli/session_store.py +112 -0
  112. apps/cli/todo_tracker.py +190 -0
  113. apps/cli/tools/__init__.py +40 -0
  114. apps/cli/tools/context.py +46 -0
  115. apps/cli/tools/file_tools.py +112 -0
  116. apps/cli/tools/market_tools.py +549 -0
  117. apps/cli/tools/notebook_tools.py +111 -0
  118. apps/cli/tools/system_tools.py +669 -0
  119. apps/cli/tools/write_tools.py +715 -0
  120. apps/cli/tradingview_bridge.py +434 -0
  121. apps/cli/update_check.py +152 -0
  122. apps/cli/utils/__init__.py +0 -0
  123. apps/cli/utils/market_detect.py +1578 -0
  124. apps/daemon/README.md +14 -0
  125. apps/vscode/README.md +115 -0
  126. apps/vscode/package.json +70 -0
  127. aria_cli.py +11636 -0
  128. aria_code-4.1.3.dist-info/METADATA +952 -0
  129. aria_code-4.1.3.dist-info/RECORD +284 -0
  130. aria_code-4.1.3.dist-info/WHEEL +5 -0
  131. aria_code-4.1.3.dist-info/entry_points.txt +2 -0
  132. aria_code-4.1.3.dist-info/licenses/LICENSE +121 -0
  133. aria_code-4.1.3.dist-info/top_level.txt +50 -0
  134. aria_daemon.py +1295 -0
  135. aria_feishu_bot.py +1359 -0
  136. aria_relay_client.py +182 -0
  137. aria_relay_server.py +405 -0
  138. aria_telegram_bot.py +202 -0
  139. ariarc.py +328 -0
  140. artifacts.py +491 -0
  141. backtest_report.py +472 -0
  142. brokers/__init__.py +72 -0
  143. brokers/base.py +207 -0
  144. brokers/capabilities.py +264 -0
  145. brokers/cn/__init__.py +10 -0
  146. brokers/cn/easytrader_broker.py +193 -0
  147. brokers/cn/futu_broker.py +194 -0
  148. brokers/cn/longbridge_broker.py +190 -0
  149. brokers/cn/tiger_broker.py +196 -0
  150. brokers/cn/xtquant_broker.py +175 -0
  151. brokers/config.py +364 -0
  152. brokers/intl/__init__.py +5 -0
  153. brokers/intl/alpaca_broker.py +183 -0
  154. brokers/intl/ibkr_broker.py +215 -0
  155. brokers/intl/webull_broker.py +156 -0
  156. brokers/paper_broker.py +259 -0
  157. brokers/planning.py +296 -0
  158. brokers/registry.py +181 -0
  159. brokers/trading.py +237 -0
  160. change_store.py +127 -0
  161. command_safety.py +19 -0
  162. computer_use_tools.py +504 -0
  163. dashboard_generator.py +578 -0
  164. data_analysis_tools.py +808 -0
  165. data_cleaner.py +483 -0
  166. data_service.py +481 -0
  167. datasources/__init__.py +23 -0
  168. datasources/base.py +166 -0
  169. datasources/router.py +221 -0
  170. datasources/sources/__init__.py +15 -0
  171. datasources/sources/akshare_source.py +269 -0
  172. datasources/sources/alpha_vantage_source.py +202 -0
  173. datasources/sources/edgar_source.py +218 -0
  174. datasources/sources/finnhub_source.py +197 -0
  175. datasources/sources/fred_source.py +219 -0
  176. datasources/sources/tushare_source.py +141 -0
  177. datasources/sources/web_scraper_source.py +278 -0
  178. datasources/sources/world_bank_source.py +205 -0
  179. datasources/sources/yfinance_source.py +152 -0
  180. demo_player.py +204 -0
  181. doctor.py +508 -0
  182. file_analysis_tools.py +734 -0
  183. finance_formulas.py +389 -0
  184. football_data_client.py +1670 -0
  185. intent_classifier.py +358 -0
  186. local_finance_tools.py +3221 -0
  187. local_llm_provider.py +552 -0
  188. macro_tools.py +368 -0
  189. market_data_client.py +1899 -0
  190. mcp_client.py +506 -0
  191. memory_manager.py +245 -0
  192. model_capability.py +416 -0
  193. notification_tools.py +248 -0
  194. packages/__init__.py +23 -0
  195. packages/aria_agents/__init__.py +5 -0
  196. packages/aria_agents/manifest.py +69 -0
  197. packages/aria_core/__init__.py +34 -0
  198. packages/aria_core/architecture.py +192 -0
  199. packages/aria_core/export.py +124 -0
  200. packages/aria_core/manifest.py +65 -0
  201. packages/aria_infra/__init__.py +15 -0
  202. packages/aria_infra/arthera.py +52 -0
  203. packages/aria_infra/doctor.py +246 -0
  204. packages/aria_infra/product.py +37 -0
  205. packages/aria_mcp/__init__.py +25 -0
  206. packages/aria_mcp/bridge.py +38 -0
  207. packages/aria_mcp/config.py +97 -0
  208. packages/aria_mcp/tools.py +61 -0
  209. packages/aria_sdk/__init__.py +19 -0
  210. packages/aria_sdk/client.py +396 -0
  211. packages/aria_sdk/providers.py +70 -0
  212. packages/aria_sdk/streaming.py +73 -0
  213. packages/aria_sdk/types.py +86 -0
  214. packages/aria_services/__init__.py +55 -0
  215. packages/aria_services/context.py +258 -0
  216. packages/aria_services/data.py +11 -0
  217. packages/aria_services/provider_health.py +189 -0
  218. packages/aria_services/registry.py +213 -0
  219. packages/aria_services/usage.py +138 -0
  220. packages/aria_skills/__init__.py +5 -0
  221. packages/aria_skills/registry.py +59 -0
  222. packages/aria_tools/__init__.py +5 -0
  223. packages/aria_tools/registry.py +128 -0
  224. packages/quant_engine/__init__.py +6 -0
  225. packages/quant_engine/sports/__init__.py +72 -0
  226. packages/quant_engine/sports/calibrator.py +353 -0
  227. packages/quant_engine/sports/dixon_coles.py +234 -0
  228. packages/quant_engine/sports/elo.py +299 -0
  229. packages/quant_engine/sports/form.py +188 -0
  230. packages/quant_engine/sports/h2h.py +195 -0
  231. packages/quant_engine/sports/ml_model.py +354 -0
  232. packages/quant_engine/sports/predictor.py +311 -0
  233. packages/quant_engine/sports/tracker.py +664 -0
  234. packages/quant_engine/stochastic/__init__.py +27 -0
  235. packages/quant_engine/stochastic/gbm_enhanced.py +195 -0
  236. packages/quant_engine/stochastic/ito_calculus.py +477 -0
  237. packages/quant_engine/stochastic/kelly_criterion.py +181 -0
  238. packages/quant_engine/stochastic/monte_carlo_advanced.py +95 -0
  239. packages/quant_engine/stochastic/options_pricing.py +573 -0
  240. packages/quant_engine/stochastic/stochastic_processes.py +90 -0
  241. plan_utils.py +194 -0
  242. plugin_loader.py +328 -0
  243. portfolio_ledger.py +262 -0
  244. privacy/__init__.py +5 -0
  245. privacy/feedback.py +123 -0
  246. project_tools.py +525 -0
  247. providers/__init__.py +30 -0
  248. providers/llm/__init__.py +19 -0
  249. providers/llm/anthropic.py +184 -0
  250. providers/llm/base.py +139 -0
  251. providers/llm/ollama.py +128 -0
  252. providers/llm/openai_compat.py +282 -0
  253. providers/llm/registry.py +358 -0
  254. realty_data_tools.py +659 -0
  255. report_generator.py +1314 -0
  256. runtime/__init__.py +103 -0
  257. runtime/agent_loop.py +1183 -0
  258. runtime/approval.py +51 -0
  259. runtime/events.py +102 -0
  260. runtime/gateway.py +128 -0
  261. runtime/lsp.py +346 -0
  262. runtime/subagent.py +258 -0
  263. runtime/tool_executor.py +104 -0
  264. runtime/tool_policy.py +106 -0
  265. safety/__init__.py +21 -0
  266. safety/permissions.py +275 -0
  267. setup_wizard.py +653 -0
  268. strategy_vault.py +420 -0
  269. ui/__init__.py +100 -0
  270. ui/banner.py +310 -0
  271. ui/completer.py +391 -0
  272. ui/console.py +271 -0
  273. ui/image_render.py +243 -0
  274. ui/input_box.py +376 -0
  275. ui/picker.py +195 -0
  276. ui/render/__init__.py +11 -0
  277. ui/render/finance.py +1480 -0
  278. ui/render/market.py +225 -0
  279. ui/render/output.py +681 -0
  280. ui/render/team.py +346 -0
  281. ui/robot.py +235 -0
  282. workspace/__init__.py +6 -0
  283. workspace/files.py +170 -0
  284. workspace/verify.py +113 -0
@@ -0,0 +1,952 @@
1
+ Metadata-Version: 2.4
2
+ Name: aria-code
3
+ Version: 4.1.3
4
+ Summary: AI-powered financial terminal — local LLM + multi-source market data
5
+ License: BUSL-1.1
6
+ Project-URL: Homepage, https://github.com/artherahq/aria-code
7
+ Project-URL: Repository, https://github.com/artherahq/aria-code
8
+ Project-URL: Issues, https://github.com/artherahq/aria-code/issues
9
+ Keywords: ai,llm,finance,trading,terminal,cli
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Financial and Insurance Industry
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Office/Business :: Financial
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: aiohttp>=3.9.0
25
+ Requires-Dist: rich>=13.7.0
26
+ Requires-Dist: prompt_toolkit>=3.0.43
27
+ Requires-Dist: PyYAML>=6.0.2
28
+ Requires-Dist: requests>=2.32.0
29
+ Requires-Dist: httpx[http2]>=0.27.0
30
+ Requires-Dist: PyJWT>=2.8.0
31
+ Requires-Dist: aiofiles>=23.2.0
32
+ Requires-Dist: websockets>=12.0
33
+ Requires-Dist: apscheduler>=3.10.0
34
+ Requires-Dist: numpy>=1.26.0
35
+ Requires-Dist: pandas>=2.2.0
36
+ Requires-Dist: scipy>=1.13.0
37
+ Requires-Dist: pandas_ta>=0.3.14b
38
+ Requires-Dist: yfinance>=0.2.55
39
+ Provides-Extra: cn
40
+ Requires-Dist: akshare>=1.14.68; extra == "cn"
41
+ Provides-Extra: crypto
42
+ Requires-Dist: ccxt>=4.4.0; extra == "crypto"
43
+ Provides-Extra: charts
44
+ Requires-Dist: mplfinance>=0.12.9; extra == "charts"
45
+ Provides-Extra: data
46
+ Requires-Dist: duckdb>=0.10.3; extra == "data"
47
+ Provides-Extra: files
48
+ Requires-Dist: pdfplumber>=0.11.0; extra == "files"
49
+ Requires-Dist: pypdf>=4.3.0; extra == "files"
50
+ Requires-Dist: python-docx>=1.1.2; extra == "files"
51
+ Requires-Dist: openpyxl>=3.1.5; extra == "files"
52
+ Requires-Dist: beautifulsoup4>=4.12.3; extra == "files"
53
+ Requires-Dist: Pillow>=10.4.0; extra == "files"
54
+ Provides-Extra: ibkr
55
+ Requires-Dist: ib_insync>=0.9.86; extra == "ibkr"
56
+ Provides-Extra: futu
57
+ Requires-Dist: futu-api>=9.1.5108; extra == "futu"
58
+ Provides-Extra: tiger
59
+ Requires-Dist: tigeropen>=3.2.0; extra == "tiger"
60
+ Provides-Extra: longbridge
61
+ Requires-Dist: longbridge>=1.0.22; extra == "longbridge"
62
+ Provides-Extra: alpaca
63
+ Requires-Dist: alpaca-py>=0.35.0; extra == "alpaca"
64
+ Provides-Extra: webull
65
+ Requires-Dist: webull>=0.3.14; extra == "webull"
66
+ Provides-Extra: brokers
67
+ Requires-Dist: ib_insync>=0.9.86; extra == "brokers"
68
+ Requires-Dist: futu-api>=9.1.5108; extra == "brokers"
69
+ Requires-Dist: tigeropen>=3.2.0; extra == "brokers"
70
+ Requires-Dist: longbridge>=1.0.22; extra == "brokers"
71
+ Requires-Dist: alpaca-py>=0.35.0; extra == "brokers"
72
+ Provides-Extra: backtest
73
+ Requires-Dist: vectorbt>=0.26.2; extra == "backtest"
74
+ Provides-Extra: web
75
+ Requires-Dist: ddgs>=9.0; extra == "web"
76
+ Provides-Extra: browser
77
+ Requires-Dist: playwright>=1.44.0; extra == "browser"
78
+ Provides-Extra: desktop
79
+ Requires-Dist: mss>=9.0.1; extra == "desktop"
80
+ Requires-Dist: pyautogui>=0.9.54; extra == "desktop"
81
+ Provides-Extra: sports
82
+ Requires-Dist: understat>=0.1.0; extra == "sports"
83
+ Provides-Extra: lsp
84
+ Requires-Dist: python-lsp-server[all]>=1.10.0; extra == "lsp"
85
+ Provides-Extra: dev
86
+ Requires-Dist: pytest>=8.2.0; extra == "dev"
87
+ Requires-Dist: pytest-asyncio>=0.23.7; extra == "dev"
88
+ Requires-Dist: ruff>=0.4.0; extra == "dev"
89
+ Requires-Dist: mypy>=1.10.0; extra == "dev"
90
+ Provides-Extra: full
91
+ Requires-Dist: akshare>=1.14.68; extra == "full"
92
+ Requires-Dist: ccxt>=4.4.0; extra == "full"
93
+ Requires-Dist: mplfinance>=0.12.9; extra == "full"
94
+ Requires-Dist: duckdb>=0.10.3; extra == "full"
95
+ Requires-Dist: pdfplumber>=0.11.0; extra == "full"
96
+ Requires-Dist: pypdf>=4.3.0; extra == "full"
97
+ Requires-Dist: python-docx>=1.1.2; extra == "full"
98
+ Requires-Dist: openpyxl>=3.1.5; extra == "full"
99
+ Requires-Dist: beautifulsoup4>=4.12.3; extra == "full"
100
+ Requires-Dist: Pillow>=10.4.0; extra == "full"
101
+ Requires-Dist: ddgs>=9.0; extra == "full"
102
+ Provides-Extra: all
103
+ Requires-Dist: akshare>=1.14.68; extra == "all"
104
+ Requires-Dist: ccxt>=4.4.0; extra == "all"
105
+ Requires-Dist: mplfinance>=0.12.9; extra == "all"
106
+ Requires-Dist: duckdb>=0.10.3; extra == "all"
107
+ Requires-Dist: pdfplumber>=0.11.0; extra == "all"
108
+ Requires-Dist: pypdf>=4.3.0; extra == "all"
109
+ Requires-Dist: python-docx>=1.1.2; extra == "all"
110
+ Requires-Dist: openpyxl>=3.1.5; extra == "all"
111
+ Requires-Dist: beautifulsoup4>=4.12.3; extra == "all"
112
+ Requires-Dist: Pillow>=10.4.0; extra == "all"
113
+ Requires-Dist: ddgs>=9.0; extra == "all"
114
+ Requires-Dist: playwright>=1.44.0; extra == "all"
115
+ Requires-Dist: mss>=9.0.1; extra == "all"
116
+ Requires-Dist: pyautogui>=0.9.54; extra == "all"
117
+ Requires-Dist: understat>=0.1.0; extra == "all"
118
+ Requires-Dist: ib_insync>=0.9.86; extra == "all"
119
+ Requires-Dist: futu-api>=9.1.5108; extra == "all"
120
+ Requires-Dist: tigeropen>=3.2.0; extra == "all"
121
+ Requires-Dist: longbridge>=1.0.22; extra == "all"
122
+ Requires-Dist: alpaca-py>=0.35.0; extra == "all"
123
+ Requires-Dist: vectorbt>=0.26.2; extra == "all"
124
+ Requires-Dist: pytest>=8.2.0; extra == "all"
125
+ Requires-Dist: pytest-asyncio>=0.23.7; extra == "all"
126
+ Dynamic: license-file
127
+
128
+ <p align="center">
129
+ <picture>
130
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/logo-dark.svg" width="100">
131
+ <img src="docs/assets/logo-light.svg" alt="Aria Code" width="100">
132
+ </picture>
133
+ </p>
134
+
135
+ <p align="center">
136
+ <a href="./README_CN.md"><img src="https://img.shields.io/badge/中文文档-README__CN.md-red?style=flat-square" alt="中文"/></a>
137
+ <img src="https://img.shields.io/badge/English-Current-6366f1?style=flat-square" alt="English"/>
138
+ </p>
139
+
140
+ <p align="center">
141
+ <a href="https://www.npmjs.com/package/@artheras/aria-code"><img src="https://img.shields.io/npm/v/@artheras/aria-code?style=for-the-badge&logo=npm&color=cb3837&label=npm" alt="npm"/></a>
142
+ <img src="https://img.shields.io/badge/Python-3.10+-3776AB?style=for-the-badge&logo=python&logoColor=white" alt="python"/>
143
+ <img src="https://img.shields.io/badge/Ollama-Local_LLM-black?style=for-the-badge&logo=llama&logoColor=white" alt="ollama"/>
144
+ <img src="https://img.shields.io/badge/Providers-19+_Cloud-f59e0b?style=for-the-badge" alt="providers"/>
145
+ <img src="https://img.shields.io/badge/License-BSL%201.1-f59e0b?style=for-the-badge" alt="license"/>
146
+ <img src="https://img.shields.io/github/stars/artherahq/aria-code?style=for-the-badge&color=f59e0b" alt="stars"/>
147
+ </p>
148
+
149
+ <h1 align="center">Aria Code</h1>
150
+
151
+ <p align="center">
152
+ <b>AI-powered financial terminal for the command line</b><br>
153
+ <sub>Runs fully offline · 19+ cloud providers · Auto language detection · Built for investors & quant researchers</sub>
154
+ </p>
155
+
156
+ <p align="center">
157
+ <a href="#-quick-start">Quick Start</a> ·
158
+ <a href="#-keyboard-shortcuts">Shortcuts</a> ·
159
+ <a href="#-model-support">Models</a> ·
160
+ <a href="#-commands-reference">Commands</a> ·
161
+ <a href="#-feishu-integration">Feishu</a> ·
162
+ <a href="#-telegram-integration">Telegram</a> ·
163
+ <a href="#-architecture">Architecture</a>
164
+ </p>
165
+
166
+ <p align="center">
167
+ <img src="docs/assets/demo-2026-06-22.gif" alt="Aria Code demo" width="860"/>
168
+ </p>
169
+
170
+ ---
171
+
172
+ ## What is Aria Code?
173
+
174
+ Aria Code is a **terminal-first AI financial agent** — think of it as Claude Code, but with deep finance domain knowledge and full offline capability. Ask it about stocks, portfolio optimization, quantitative strategies, or code, and it replies with real data, formulas, and analysis right in your terminal.
175
+
176
+ ```
177
+ $ aria-code
178
+
179
+ ▣ Aria Code v4.0 local-first agent
180
+ model qwen2.5-coder:7b local
181
+ workspace ~/my-portfolio
182
+ mode workspace-write · network on · local-only
183
+ status Ollama online · 3 models
184
+
185
+ try analyze AAPL · /project load ./myapp · /help
186
+
187
+ > analyze NVDA momentum — give me RSI, MACD, and a short thesis
188
+
189
+ NVIDIA Corp (NVDA) ── Technical Snapshot
190
+ ─────────────────────────────────────────
191
+ Price $875.40 +2.3% today (Finnhub real-time)
192
+ RSI (14) 68.4 Approaching overbought
193
+ MACD +4.2 Bullish crossover 3 days ago
194
+ BB Width 0.18 Moderate volatility
195
+
196
+ Signal: ↑ BULLISH (momentum intact, watch RSI > 70)
197
+ Support: $842 / $810 Resistance: $900 / $925
198
+
199
+ Thesis: AI infrastructure spending cycle still early …
200
+
201
+ 1.9s · qwen2.5-coder:7b (local)
202
+ ```
203
+
204
+ ---
205
+
206
+ ## ✨ What's New in v4.1
207
+
208
+ | Feature | Description |
209
+ |---------|-------------|
210
+ | **Bloomberg UI** | `/ui <desc>` generates Bloomberg Terminal-style HTML dashboards — amber-on-black, IBM Plex Mono, zero border-radius, `prefers-color-scheme` |
211
+ | **Tool transparency** | `✓ action (42ms)` after every tool call · per-turn cost display · phase dividers in multi-step commands |
212
+ | **User profile** | `~/.arthera/ARIA.md` auto-injected every session · `/memory profile add <text>` to persist your preferences |
213
+ | **Quant engine** | Citadel/Jane Street-style 5-module engine · limit-up prediction · dynamic market pool |
214
+ | **MCP tools** | 5 new quantitative MCP tools in the tool registry |
215
+ | **83 commands** | Consolidated from ~150 — removed all LLM-replaceable commands; natural language handles the rest |
216
+ | **LLM routing fix** | Model now knows it can call real-time data tools instead of saying "I don't have live data" |
217
+
218
+ See [CHANGELOG.md](CHANGELOG.md) for the full history.
219
+
220
+ ### v4.0 highlights
221
+
222
+ | Feature | Description |
223
+ |---------|-------------|
224
+ | ⌨️ **Keyboard shortcuts** | `Shift+Tab` cycle modes · `Alt+T` thinking · `Alt+P` model picker · `Ctrl+O` transcript · `Ctrl+T` tasks |
225
+ | `!` **Shell mode** | Type `! git status` to run shell commands, output auto-added to AI context |
226
+ | `@` **File autocomplete** | Type `@src/` to get instant file path completion anywhere in input |
227
+ | `/btw` **Side questions** | Ask quick questions without polluting conversation history |
228
+ | 🌍 **Auto language** | UI and responses auto-detect Chinese/English from OS locale on first run |
229
+ | 🤖 **19+ cloud providers** | Google Gemini · xAI Grok · Mistral · Cohere · Perplexity · Baidu ERNIE · ByteDance · MiniMax · StepFun · 01.AI + all originals |
230
+ | 🔢 **All Ollama models** | Qwen3 · DeepSeek-R1 · Llama 3.x · Phi-4 · Gemma3 · Mistral families |
231
+
232
+ ---
233
+
234
+ ## 🧠 Intelligence Pipeline
235
+
236
+ ```mermaid
237
+ mindmap
238
+ root((Aria Code))
239
+ Data Layer
240
+ Real-time Quotes
241
+ A-shares via Eastmoney
242
+ US stocks via Finnhub + yfinance
243
+ HK stocks via yfinance
244
+ Crypto via ccxt
245
+ Fundamentals
246
+ Financial statements akshare
247
+ SEC EDGAR US filings
248
+ Tushare A-share data
249
+ Macro Economics
250
+ FRED Fed Reserve data
251
+ GDP · Inflation · Rates
252
+ Analysis Layer
253
+ Quantitative Research
254
+ Technical signals RSI MACD Ichimoku
255
+ Factor analysis PE PB ROE Momentum
256
+ Backtest engine multi-strategy
257
+ Kelly criterion position sizing
258
+ Black-Scholes options pricing
259
+ Fundamental Analysis
260
+ DCF discounted cash flow
261
+ Piotroski F-Score
262
+ Altman Z-Score
263
+ DuPont decomposition
264
+ Risk Metrics
265
+ Max Drawdown MDD
266
+ Sharpe Ratio
267
+ Value at Risk VaR
268
+ Correlation matrix
269
+ Intelligence Layer
270
+ Local-first Routing
271
+ Ollama qwen3 deepseek-r1 llama3
272
+ Auto model discovery on first run
273
+ 19+ Cloud Providers
274
+ Anthropic Claude Google Gemini
275
+ OpenAI xAI DeepSeek Groq
276
+ Baidu ByteDance MiniMax StepFun
277
+ Multi-agent Team
278
+ Fundamental Technical Macro Risk Synthesis
279
+ Channel Layer
280
+ Terminal CLI with full keyboard shortcuts
281
+ Feishu enterprise chat relay
282
+ Telegram personal bot
283
+ iOS push notifications APNs
284
+ ```
285
+
286
+ ---
287
+
288
+ ## ✨ Core Features
289
+
290
+ | Capability | Details |
291
+ |-----------|---------|
292
+ | 🦙 **100% offline mode** | Powered by Ollama — no API key, no data leaves your machine |
293
+ | 📊 **Financial intelligence** | DCF / WACC / PE / Sharpe / Kelly / Black-Scholes + 30 more built-in formulas |
294
+ | 📈 **Live market data** | A-shares (Eastmoney) · US stocks (Finnhub) · HK · Crypto (ccxt) |
295
+ | 🔍 **Quant research** | `/backtest` `/signal` `/kelly` `/factor` `/portfolio` `/screen` `/corr` `/ptbt` |
296
+ | 🤖 **19+ cloud providers** | All major international + Chinese LLM APIs supported |
297
+ | 🔌 **MCP protocol** | Connect any [Model Context Protocol](https://modelcontextprotocol.io) server |
298
+ | ⌨️ **Rich keyboard UX** | Vim mode · `!` shell · `@` files · `Shift+Tab` modes · transcript viewer |
299
+ | 💬 **Feishu / Telegram** | Ask Aria from any chat app, anytime |
300
+ | 📱 **iOS push alerts** | Real-time price alerts via APNs |
301
+ | 🌍 **Auto bilingual** | OS language auto-detected on first run; output follows user's input language |
302
+ | 🏠 **Real estate** | Property valuation, REIT screening, rental yield, 70-city China housing |
303
+
304
+ ---
305
+
306
+ ## 🚀 Quick Start
307
+
308
+ ### Option 1: Bootstrap (fresh Mac / Linux — recommended)
309
+
310
+ No Node.js, Python, or Xcode required. One command handles everything:
311
+
312
+ ```bash
313
+ curl -fsSL https://raw.githubusercontent.com/artherahq/aria-code/aria-code/bootstrap.sh | bash
314
+ ```
315
+
316
+ What it does automatically:
317
+ - ✅ Installs **Xcode Command Line Tools** (macOS) — provides `git`, `make`, compiler
318
+ - ✅ Installs **Homebrew** (macOS package manager)
319
+ - ✅ Installs **Python 3.12** if not present
320
+ - ✅ Clones the repo into `~/aria-code`
321
+ - ✅ Runs `install.sh` to create venv, install all packages, and register the `aria-code` command
322
+
323
+ > Already cloned the repo? Just run `bash bootstrap.sh` from inside the folder.
324
+
325
+ ### Option 2: npm (requires Node.js ≥ 16)
326
+
327
+ If you already have [Node.js](https://nodejs.org) installed, the npm installer handles Python, Xcode CLT, and Homebrew automatically:
328
+
329
+ ```bash
330
+ npm install -g @artheras/aria-code
331
+ aria-code
332
+ ```
333
+
334
+ What happens under the hood:
335
+ - ✅ Detects / installs Xcode Command Line Tools (macOS)
336
+ - ✅ Detects / installs Homebrew (macOS)
337
+ - ✅ Detects / installs Python 3.12 if missing
338
+ - ✅ Clones Aria Code into `~/.aria-code/`
339
+ - ✅ Uses **uv** to create a venv and install dependencies from `pyproject.toml` (falls back to pip)
340
+
341
+ Update: `npm update -g @artheras/aria-code`
342
+
343
+ Repair if broken: `npm explore -g @artheras/aria-code -- npm run repair`
344
+
345
+ ### Option 3: Git clone
346
+
347
+ `install.sh` is **uv-powered** — it installs [uv](https://docs.astral.sh/uv/) if
348
+ missing and lets uv download a managed Python automatically, so you don't need
349
+ Python pre-installed. Dependencies come from `pyproject.toml`.
350
+
351
+ ```bash
352
+ git clone https://github.com/artherahq/aria-code.git
353
+ cd aria-code
354
+ bash install.sh # full install (recommended)
355
+ # bash install.sh --core # slim core only — add features later
356
+ # bash install.sh --dev # everything incl. brokers + dev tools
357
+ ```
358
+
359
+ Add to PATH (if prompted):
360
+
361
+ ```bash
362
+ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
363
+ ```
364
+
365
+ ### Option 4: Windows
366
+
367
+ ```powershell
368
+ git clone https://github.com/artherahq/aria-code.git
369
+ cd aria-code
370
+ .\install.ps1
371
+ ```
372
+
373
+ ### Option 5: PyPI (pip / uv / pipx)
374
+
375
+ Aria Code ships a proper Python package, so any standard tool works:
376
+
377
+ ```bash
378
+ uv tool install aria-code # isolated, fast (recommended)
379
+ pipx install aria-code # isolated alternative
380
+ pip install aria-code # into the current environment
381
+ ```
382
+
383
+ This installs the **slim core** (CLI + yfinance). Add features with extras:
384
+
385
+ ```bash
386
+ uv tool install "aria-code[full]" # all data sources + files + charts + SQL
387
+ pip install "aria-code[cn]" # + China A-share data (akshare)
388
+ pip install "aria-code[files]" # + PDF/Word/Excel parsing
389
+ pip install "aria-code[all]" # + brokers + backtest + dev tools
390
+ ```
391
+
392
+ Available extras: `cn` · `crypto` · `charts` · `data` · `files` · `web` ·
393
+ `browser` · `desktop` · `sports` · `lsp` · `brokers` · `backtest` · `full` · `all`.
394
+
395
+ ### Option 6: Run directly (no install)
396
+
397
+ ```bash
398
+ git clone https://github.com/artherahq/aria-code.git
399
+ cd aria-code
400
+ uv venv && uv pip install -e ".[full]" # uv (fast); or use python -m venv + pip
401
+ python3 aria_cli.py
402
+ ```
403
+
404
+ ### 🇨🇳 China / behind a firewall (network timeouts)
405
+
406
+ If installs time out reaching GitHub or PyPI (e.g. `curl: (56) Recv failure`),
407
+ set `ARIA_CN=1` — every installer then uses the Tsinghua PyPI mirror and a
408
+ Python-build mirror. The installers also auto-retry through these mirrors if a
409
+ download fails, so you usually don't need the flag.
410
+
411
+ ```bash
412
+ ARIA_CN=1 bash install.sh # git clone path
413
+ ARIA_CN=1 npm install -g @artheras/aria-code # npm path
414
+ ```
415
+
416
+ ```powershell
417
+ $env:ARIA_CN=1; .\install.ps1 # Windows
418
+ ```
419
+
420
+ You can also point at your own mirrors via standard env vars:
421
+ `UV_DEFAULT_INDEX`, `UV_PYTHON_INSTALL_MIRROR`, `PIP_INDEX_URL`.
422
+
423
+ ### Step 1: Install Ollama (local LLM — free, fully offline)
424
+
425
+ ```bash
426
+ # macOS / Linux
427
+ curl -fsSL https://ollama.ai/install.sh | sh
428
+
429
+ # Pull a model (choose one — auto-detected on first run)
430
+ ollama pull qwen2.5-coder:7b # Recommended — fast, great Chinese support (~4.7GB)
431
+ ollama pull qwen3:8b # Latest Qwen, stronger reasoning
432
+ ollama pull deepseek-r1:7b # Strong reasoning for complex quant tasks
433
+ ollama pull llama3.2:3b # Smallest, fastest (~2GB)
434
+ ollama pull phi4-mini # Microsoft Phi-4 mini, excellent code
435
+ ```
436
+
437
+ Aria auto-discovers the best installed model on first run — no configuration needed.
438
+
439
+ ### Step 2: Cloud API keys (all optional)
440
+
441
+ ```bash
442
+ # Interactive setup wizard
443
+ python3 setup_wizard.py
444
+
445
+ # Or manually copy and edit
446
+ cp .env.example .env
447
+ ```
448
+
449
+ The setup wizard now covers all 19 cloud providers including Google Gemini, xAI Grok, Mistral, Baidu ERNIE, ByteDance Doubao, and more.
450
+
451
+ ---
452
+
453
+ ## ⌨️ Keyboard Shortcuts
454
+
455
+ Aria Code has a full keyboard shortcut system powered by `prompt_toolkit`:
456
+
457
+ ### General
458
+
459
+ | Shortcut | Action |
460
+ |----------|--------|
461
+ | `Shift+Tab` | Cycle permission modes: `read-only` → `workspace-write` → `full-access` |
462
+ | `Alt+T` | Toggle thinking mode on/off |
463
+ | `Alt+P` | Open model switcher (fills `/model` in prompt) |
464
+ | `Ctrl+O` | Toggle transcript viewer — shows all tool calls with timestamps |
465
+ | `Ctrl+T` | Toggle task list — live pending/in-progress/done indicator |
466
+ | `Ctrl+L` | Redraw terminal screen (fixes garbled display) |
467
+ | `Ctrl+C` | Cancel current response / clear input |
468
+ | `Ctrl+D` | Exit Aria |
469
+ | `Esc` | Interrupt streaming response |
470
+
471
+ ### Input Modes
472
+
473
+ | Prefix | Mode | Example |
474
+ |--------|------|---------|
475
+ | `/` | Slash command with fuzzy autocomplete | `/backtest momentum SPY` |
476
+ | `!` | Shell mode — runs command, adds output to context | `! git diff HEAD~1` |
477
+ | `@` | File path autocomplete | `@src/components/` |
478
+ | `"""` | Multi-line input mode (end with `"""`) | For pasting code blocks |
479
+
480
+ ### Bottom Toolbar (always visible)
481
+
482
+ ```
483
+ qwen2.5-coder:7b · ~/my-project ⎇ main ✓3/5 · rw · local-only · /help · 1,240/16,384
484
+ │ │ │ │ │ │
485
+ │ │ │ │ │ └── context usage
486
+ │ │ │ │ └── privacy status
487
+ │ │ │ └── permission: ro/rw/full (color-coded)
488
+ │ │ └── task progress
489
+ │ └── git branch
490
+ └── current model
491
+ ```
492
+
493
+ ---
494
+
495
+ ## 🤖 Model Support
496
+
497
+ ### Local Models (via Ollama — offline, free)
498
+
499
+ | Model | Command | Size | Best For |
500
+ |-------|---------|------|----------|
501
+ | **qwen2.5-coder:7b** ⭐ | `ollama pull qwen2.5-coder:7b` | 4.7GB | Code + Chinese (recommended) |
502
+ | qwen3:8b | `ollama pull qwen3:8b` | 5.2GB | Latest Qwen, reasoning |
503
+ | qwen3:30b-a3b | `ollama pull qwen3:30b-a3b` | 17GB | High capability |
504
+ | deepseek-r1:7b | `ollama pull deepseek-r1:7b` | 4.7GB | Strong math/reasoning |
505
+ | deepseek-r1:1.5b | `ollama pull deepseek-r1:1.5b` | 1.1GB | Ultra-light reasoning |
506
+ | llama3.2:3b | `ollama pull llama3.2:3b` | 2GB | General, fastest |
507
+ | llama3.1:8b | `ollama pull llama3.1:8b` | 4.7GB | General purpose |
508
+ | mistral:7b | `ollama pull mistral:7b` | 4.1GB | European quality |
509
+ | phi4-mini | `ollama pull phi4-mini` | 2.5GB | Excellent code, small |
510
+ | gemma3:4b | `ollama pull gemma3:4b` | 3.3GB | Google, efficient |
511
+
512
+ Switch model anytime:
513
+
514
+ ```bash
515
+ /model # Interactive picker with install status
516
+ /model qwen3:8b # Direct switch
517
+ /model openai/gpt-4.5 # Cloud model
518
+ Alt+P # Keyboard shortcut
519
+ ```
520
+
521
+ ### Cloud Providers (19+ supported)
522
+
523
+ #### International
524
+
525
+ | Provider | Models | Env Var |
526
+ |----------|--------|---------|
527
+ | **Anthropic** | Claude Sonnet 4, Opus 4 | `ANTHROPIC_API_KEY` |
528
+ | **OpenAI** | GPT-4.5, o3, o4-mini | `OPENAI_API_KEY` |
529
+ | **DeepSeek** | deepseek-chat, deepseek-reasoner | `DEEPSEEK_API_KEY` |
530
+ | **Google Gemini** | gemini-2.0-flash, 2.5-pro | `GOOGLE_API_KEY` |
531
+ | **xAI Grok** | grok-3, grok-3-fast | `XAI_API_KEY` |
532
+ | **Groq** | llama-3.3-70b (fast inference) | `GROQ_API_KEY` |
533
+ | **Mistral** | mistral-large, codestral | `MISTRAL_API_KEY` |
534
+ | **Cohere** | command-r-plus | `COHERE_API_KEY` |
535
+ | **Perplexity** | sonar-pro (web search) | `PERPLEXITY_API_KEY` |
536
+ | **Together AI** | 100+ open-source models | `TOGETHER_API_KEY` |
537
+
538
+ #### Chinese Providers (国内)
539
+
540
+ | Provider | Models | Env Var |
541
+ |----------|--------|---------|
542
+ | **SiliconFlow 硅基流动** | Qwen/DeepSeek hosted | `SILICONFLOW_API_KEY` |
543
+ | **DashScope 阿里百炼** | qwen-max, qwen-turbo | `DASHSCOPE_API_KEY` |
544
+ | **Moonshot Kimi** | moonshot-v1-128k | `MOONSHOT_API_KEY` |
545
+ | **Zhipu GLM 智谱** | glm-4-plus | `ZHIPU_API_KEY` |
546
+ | **Baidu ERNIE 百度千帆** | ernie-4.5-turbo | `QIANFAN_ACCESS_KEY` |
547
+ | **ByteDance Doubao 豆包** | (endpoint-based) | `ARK_API_KEY` |
548
+ | **MiniMax** | MiniMax-Text-01 | `MINIMAX_API_KEY` |
549
+ | **StepFun 阶跃星辰** | step-2-16k | `STEPFUN_API_KEY` |
550
+ | **01.AI Yi 零一万物** | yi-large | `ONEAI_API_KEY` |
551
+
552
+ Use any provider:
553
+
554
+ ```bash
555
+ /model anthropic/claude-sonnet-4-6
556
+ /model google/gemini-2.0-flash-exp
557
+ /model baidu/ernie-4.5-turbo-128k
558
+ /model moonshot/moonshot-v1-128k
559
+ /apikey # Interactive wizard for all 19 providers
560
+ ```
561
+
562
+ ---
563
+
564
+ ## ⚡ Commands Reference
565
+
566
+ ### Market & Quotes
567
+
568
+ ```bash
569
+ /quote AAPL MSFT TSLA # Real-time multi-symbol quotes (Finnhub)
570
+ /quote 000001 600519 300750 # A-share quotes (Eastmoney)
571
+ /quote BTC/USDT ETH/USDT # Crypto prices
572
+ /news AAPL # Latest financial news
573
+ /regime # Market regime (bull / bear / neutral)
574
+ /alert add AAPL gt 200 # Price alert
575
+ /alert list # View all alerts
576
+ ```
577
+
578
+ ### Quantitative Research
579
+
580
+ ```bash
581
+ /signal TSLA # Technical signals (RSI / MACD / Bollinger)
582
+ /backtest momentum SPY 2023-01-01 2024-12-31
583
+ /backtest ml 600519 300750 NVDA # ML signal backtest (3-strategy comparison)
584
+ /wf SPY momentum # Walk-forward backtest
585
+ /kelly AAPL 0.6 2.0 # Kelly formula — position size recommendation
586
+ /factor PE PB ROE # Multi-factor analysis
587
+ /screen PE<15 ROE>20 # Stock screener with filters
588
+ /portfolio AAPL MSFT GOOGL # Portfolio optimization
589
+ /ptbt AAPL MSFT GOOG 0.4 0.3 0.3 # Portfolio backtest with weights
590
+ /corr AAPL MSFT TSLA SPY # Correlation matrix
591
+ /ichimoku AAPL # Ichimoku cloud chart
592
+ /options AAPL calls 2025-01 # Options chain
593
+ /quality AAPL # Piotroski + Altman Z-score
594
+ ```
595
+
596
+ ### Analysis
597
+
598
+ ```bash
599
+ /analyze AAPL # AI full analysis
600
+ /peer AAPL MSFT GOOGL META # Peer comparison
601
+ /macro # Macro dashboard (GDP / CPI / Fed rates)
602
+ /macro cn # China macro data
603
+ /sector tech # Sector analysis
604
+ /realty Shanghai Pudong # Real estate analysis
605
+ /feargreed # Crypto Fear & Greed Index
606
+ /funding BTC ETH # Perpetual funding rates
607
+ ```
608
+
609
+ ### Session & UI
610
+
611
+ ```bash
612
+ /btw what was that function name? # Side question — no history pollution
613
+ /recap # Session summary (turns + topics)
614
+ /clear # Clear conversation
615
+ /compact # Smart context compression
616
+ /history # Show recent conversation
617
+ /sessions # List saved sessions
618
+ /export md report.md # Export conversation
619
+ /rename "NVDA Research" # Name current session
620
+ ```
621
+
622
+ ### System
623
+
624
+ ```bash
625
+ /model # View / switch LLM (interactive picker)
626
+ /apikey # API key wizard for all 19 providers
627
+ /config set ui_lang=zh # Force Chinese UI
628
+ /config set ui_lang=en # Force English UI
629
+ /thinking on # Enable extended thinking mode
630
+ /privacy status # Privacy settings
631
+ /tools # List all enabled tools
632
+ /skills # List skills
633
+ /mcp list # MCP server status
634
+ /doctor # Diagnose installation issues
635
+ /providers # All provider status
636
+ ```
637
+
638
+ ---
639
+
640
+ ## 🌍 Language Auto-Detection
641
+
642
+ On first run, Aria reads your OS locale and sets the UI language automatically:
643
+
644
+ ```bash
645
+ # Chinese system → Chinese UI + hints
646
+ LANG=zh_CN.UTF-8 → 本地优先智能体 · Ollama 在线 · 试试 分析 AAPL
647
+
648
+ # English system → English UI + hints
649
+ LANG=en_US.UTF-8 → local-first agent · Ollama online · try analyze AAPL
650
+ ```
651
+
652
+ AI **output language** always follows your input — ask in Chinese, get Chinese; ask in English, get English.
653
+
654
+ Override anytime:
655
+
656
+ ```bash
657
+ /config set ui_lang=zh # Force Chinese
658
+ /config set ui_lang=en # Force English
659
+ /config set ui_lang=auto # Back to OS auto-detect
660
+ ```
661
+
662
+ ---
663
+
664
+ ## 💬 Feishu Integration
665
+
666
+ Connect Aria to Feishu (Lark) and ask financial questions from any group or DM.
667
+
668
+ ### How it works
669
+
670
+ ```
671
+ Your Feishu message
672
+
673
+
674
+ Feishu servers
675
+
676
+ ┌────┴────────────────────────────────────┐
677
+ │ Mode A: Relay (recommended, 5 min) │ Mode B: Own App (20 min)
678
+ │ Aria Relay Server │ Feishu Open Platform App
679
+ │ wss://relay.aria.ai │ Requires public IP or tunnel
680
+ └────┬────────────────────────────────────┘
681
+
682
+
683
+ aria_relay_client.py (your machine)
684
+
685
+
686
+ aria_cli.py → LLM → response sent back
687
+ ```
688
+
689
+ ### Mode A: Relay (Recommended)
690
+
691
+ ```bash
692
+ python3 setup_wizard.py
693
+ # Select "Feishu relay mode"
694
+ # Output: ✅ Your Client ID: ARIA-xxxxxxxx-xxxx
695
+ ```
696
+
697
+ Send to the **Aria Bot** in Feishu:
698
+
699
+ ```
700
+ /bind ARIA-xxxxxxxx-xxxx
701
+ ```
702
+
703
+ Configure `~/.aria/.env`:
704
+
705
+ ```env
706
+ ARIA_RELAY_URL=wss://relay.aria.ai
707
+ ARIA_RELAY_CLIENT_ID=ARIA-xxxxxxxx-xxxx
708
+ ARIA_RELAY_MODE=relay
709
+ ARIA_CODE_DIR=~/aria-code
710
+ ```
711
+
712
+ Start:
713
+
714
+ ```bash
715
+ python3 aria_daemon.py start
716
+ ```
717
+
718
+ ### Mode B: Own Feishu App
719
+
720
+ 1. Open [Feishu Open Platform](https://open.feishu.cn/app) → Create custom app
721
+ 2. Set event URL: `https://yourdomain.com/api/v1/feishu/webhook`
722
+ 3. Subscribe to `im.message.receive_v1`
723
+
724
+ ```env
725
+ FEISHU_APP_ID=cli_xxxxxxxxxxxxxxxxx
726
+ FEISHU_APP_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
727
+ ARIA_RELAY_MODE=own_app
728
+ ```
729
+
730
+ ---
731
+
732
+ ## 📱 Telegram Integration
733
+
734
+ ### Setup
735
+
736
+ 1. Message **@BotFather** → `/newbot` → copy your **Bot Token**
737
+ 2. Message **@userinfobot** → copy your **Chat ID**
738
+
739
+ Configure:
740
+
741
+ ```env
742
+ TELEGRAM_BOT_TOKEN=1234567890:ABCDEFGxxxxxxxxxxxxxx
743
+ TELEGRAM_ALLOWED_IDS=123456789
744
+ ARIA_CODE_DIR=~/aria-code
745
+ ```
746
+
747
+ Start:
748
+
749
+ ```bash
750
+ python3 aria_daemon.py start
751
+ ```
752
+
753
+ Use in Telegram:
754
+
755
+ ```
756
+ /price AAPL → Apple real-time quote
757
+ /price 600519 → Moutai A-share
758
+ /price BTC/USDT → Bitcoin
759
+ Analyze NVDA momentum → Full AI analysis
760
+ ```
761
+
762
+ ---
763
+
764
+ ## 🏗️ Architecture
765
+
766
+ ```
767
+ ┌─────────────────────────────────────────────────────────────────┐
768
+ │ Aria Code v4.0 │
769
+ │ │
770
+ │ ┌──────────┐ ┌────────────┐ ┌──────────┐ ┌─────────────┐ │
771
+ │ │ Terminal │ │Feishu Bot │ │ Telegram │ │ Webhook │ │
772
+ │ │ CLI │ │(relay/app) │ │ Bot │ │ External │ │
773
+ │ └────┬─────┘ └─────┬──────┘ └────┬─────┘ └──────┬──────┘ │
774
+ │ └───────────────┴──────────────┴────────────────┘ │
775
+ │ │ │
776
+ │ ┌─────────▼──────────┐ │
777
+ │ │ aria_daemon.py │ │
778
+ │ │ Message router │ │
779
+ │ └─────────┬──────────┘ │
780
+ │ │ │
781
+ │ ┌────────────────┼────────────────┐ │
782
+ │ │ │ │ │
783
+ │ ┌──────────▼───┐ ┌─────────▼───┐ ┌────────▼──────┐ │
784
+ │ │ LLM Router │ │ Tool Exec │ │ Data Layer │ │
785
+ │ │19+ providers │ │ bash/file │ │Finnhub/EastMny│ │
786
+ │ └──────────────┘ └─────────────┘ └───────────────┘ │
787
+ └─────────────────────────────────────────────────────────────────┘
788
+ ```
789
+
790
+ ### File Structure
791
+
792
+ ```
793
+ aria-code/
794
+ ├── aria_cli.py # Main CLI + REPL (keyboard shortcuts, ! shell, @files)
795
+ ├── aria_daemon.py # Background daemon + scheduler
796
+ ├── market_data_client.py # Unified market data (Finnhub primary for US)
797
+ ├── setup_wizard.py # Bilingual setup wizard (19 providers)
798
+
799
+ ├── apps/cli/
800
+ │ ├── i18n.py # Language auto-detection + UI string translations
801
+ │ ├── commands/
802
+ │ │ └── model_cmds.py # /model /apikey /providers (19 cloud providers)
803
+ │ ├── prompts/
804
+ │ │ └── coding.py # Code generation prompts (end_date fix, akshare fallback)
805
+ │ └── tools/
806
+ │ └── market_tools.py # Market data tools (Finnhub dp field)
807
+
808
+ ├── ui/
809
+ │ ├── banner.py # Bilingual banner (i18n aware)
810
+ │ └── completer.py # Fuzzy autocomplete: / commands · @ files · ! history
811
+
812
+ ├── providers/llm/ # LLM adapters (19+ cloud endpoints)
813
+ ├── agents/financial/ # Fundamental / Technical / Macro / Risk / Synthesis
814
+ ├── brokers/ # CN (Futu/Longbridge/Tiger) + Intl (IBKR/Alpaca)
815
+ └── datasources/sources/ # yfinance · akshare · FRED · EDGAR · Finnhub
816
+ ```
817
+
818
+ ---
819
+
820
+ ## 📡 Market Data Sources
821
+
822
+ | Source | Coverage | API Key |
823
+ |--------|----------|---------|
824
+ | **Finnhub** ⭐ | US real-time quotes (primary) + earnings | Optional free tier |
825
+ | **Eastmoney** | A-share real-time, northbound flow, limit-up/down | None (free) |
826
+ | **akshare** | A-share history, financials, sector data | None (free) |
827
+ | **yfinance** | US/HK/global stocks, ETFs, FX, history | None (free) |
828
+ | **ccxt** | 100+ crypto exchanges | None (free tier) |
829
+ | **FRED** | Fed macro — GDP, CPI, rates | Optional (free signup) |
830
+ | **SEC EDGAR** | US 10-K / 10-Q filings | None (free) |
831
+ | Alpha Vantage | US history + fundamentals | Optional (free tier) |
832
+ | Polygon | US market data (professional) | Optional (free tier) |
833
+ | Tushare | A-share complete data | Optional (free token) |
834
+
835
+ ---
836
+
837
+ ## 🔌 MCP Integration
838
+
839
+ Connect any [Model Context Protocol](https://modelcontextprotocol.io) server:
840
+
841
+ ```json
842
+ {
843
+ "servers": [
844
+ {
845
+ "name": "filesystem",
846
+ "command": "npx",
847
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/your/project"]
848
+ },
849
+ {
850
+ "name": "brave-search",
851
+ "command": "npx",
852
+ "args": ["-y", "@modelcontextprotocol/server-brave-search"],
853
+ "env": { "BRAVE_API_KEY": "your-key" }
854
+ }
855
+ ]
856
+ }
857
+ ```
858
+
859
+ ```bash
860
+ /mcp list # List connected MCP servers
861
+ /mcp status # Server health
862
+ /mcp tools # All available MCP tools
863
+ ```
864
+
865
+ ---
866
+
867
+ ## ⚙️ Configuration
868
+
869
+ Settings are stored in `~/.arthera/config.json`. Add `.ariarc` to any project for project-level overrides:
870
+
871
+ ```json
872
+ {
873
+ "model": "qwen2.5-coder:7b",
874
+ "ui_lang": "auto",
875
+ "market": "us",
876
+ "permission_mode": "workspace-write",
877
+ "default_symbols": ["AAPL", "NVDA", "MSFT", "GOOGL"],
878
+ "thinking": false
879
+ }
880
+ ```
881
+
882
+ ### LLM Provider Priority
883
+
884
+ Aria automatically selects the first available provider:
885
+
886
+ ```
887
+ Local Ollama → Anthropic → OpenAI → DeepSeek → Google → xAI → Groq → …
888
+ (offline first) (reasoning) (general) (cost-eff.) (multi.) (web) (fast)
889
+ ```
890
+
891
+ Force local mode: `ARIA_MODEL=ollama/qwen2.5-coder:7b`
892
+
893
+ ---
894
+
895
+ ## 🛠️ Requirements
896
+
897
+ - Python **3.10+**
898
+ - [Ollama](https://ollama.ai) (highly recommended for offline mode)
899
+ - RAM: 4GB+ (8GB+ for 7B models)
900
+ - macOS · Linux · Windows (WSL2)
901
+
902
+ ```bash
903
+ pip install -r requirements.txt
904
+ ```
905
+
906
+ Core dependencies: `rich` · `prompt_toolkit` · `yfinance` · `akshare` · `ccxt` · `pandas` · `numpy`
907
+
908
+ ---
909
+
910
+ ## 🤝 Contributing
911
+
912
+ Contributions welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md).
913
+
914
+ ```bash
915
+ git clone https://github.com/artherahq/aria-code.git
916
+ cd aria-code
917
+ python3 -m venv .venv && source .venv/bin/activate
918
+ pip install -r requirements.txt
919
+ pytest tests/ -v
920
+ ```
921
+
922
+ ---
923
+
924
+ ## Relation to Arthera
925
+
926
+ Aria Code is the open-source CLI component of [Arthera](https://arthera.finance) — an AI-powered quantitative investment platform. The full Arthera platform includes a web dashboard, desktop terminal, iOS app, and institutional quant engine.
927
+
928
+ Aria Code is designed to work as a **standalone tool** — it does not require the Arthera backend. All financial calculations run locally. Cloud features are optional.
929
+
930
+ ---
931
+
932
+ ## License
933
+
934
+ [Business Source License 1.1](./LICENSE) © 2025–2026 Arthera.
935
+
936
+ Free to use, run, modify, and self-host for personal, internal, educational,
937
+ and research purposes — including trading your own account. Offering Aria Code
938
+ as a hosted/managed service, or selling a competing product built on it,
939
+ requires a commercial license (contact dev@arthera.finance). Each version
940
+ converts to Apache 2.0 four years after release.
941
+
942
+ > Versions up to and including **4.1.2** were released under MIT and remain
943
+ > available under those terms.
944
+
945
+ ---
946
+
947
+ <p align="center">
948
+ <a href="https://arthera.finance">Website</a> ·
949
+ <a href="https://github.com/Cinsoul/Arthera">Full Platform</a> ·
950
+ <a href="https://github.com/artherahq/aria-code/issues">Issues</a> ·
951
+ <a href="https://github.com/artherahq/aria-code/discussions">Discussions</a>
952
+ </p>