fund-assistant▌
xer97/fund-assistant · updated Apr 8, 2026
位置:.fund-assistant/users/{用户名}/portfolio.json(项目本地目录)
基金投资助手
脚本命令
基金 API(scripts/fund_api.py)
python scripts/fund_api.py query 001618,000001 # 查询实时估值
python scripts/fund_api.py search 白酒 # 搜索基金
python scripts/fund_api.py detail 001618 # 基金详情
python scripts/fund_api.py history 001618 y # 历史净值 (y/3y/6y/n/3n/5n)
python scripts/fund_api.py position 001618 # 持仓明细
python scripts/fund_api.py manager 001618 # 基金经理
python scripts/fund_api.py index # 大盘指数
python scripts/fund_api.py flow # 资金流向
python scripts/fund_api.py north # 北向资金
持仓管理(scripts/portfolio.py)
python scripts/portfolio.py init # 初始化数据目录
python scripts/portfolio.py list # 查看持仓
python scripts/portfolio.py add 001618 1000 1.5 # 添加持仓(代码 份额 成本)
python scripts/portfolio.py update 001618 shares=1500 # 更新持仓
python scripts/portfolio.py remove 001618 # 删除持仓
python scripts/portfolio.py user 老婆 # 切换用户
python scripts/portfolio.py users # 列出所有用户
python scripts/portfolio.py export portfolio.json # 导出持仓
python scripts/portfolio.py import portfolio.json # 导入持仓
数据存储
位置:.fund-assistant/users/{用户名}/portfolio.json(项目本地目录)
{"funds": [{"code": "001618", "name": "天弘中证食品饮料", "shares": 1000, "cost": 1.5}]}
收益计算
// 当日预估收益(今天赚/亏多少)
dailyGains = (gsz - nav) * shares;
dailyGainsRate = gszzl; // 直接用API返回的涨跌幅
// 持仓总收益(从买入到现在总共赚/亏多少)
costGains = (gsz - cost) * shares;
costGainsRate = ((gsz - cost) / cost) * 100;
重要区分:
- 当日收益 = (估算净值 - 昨日净值) × 份额 → 今天赚了多少
- 持仓收益 = (估算净值 - 成本价) × 份额 → 总共赚了多少
字段说明:
nav: 昨日净值(已公布)gsz: 估算净值(盘中实时)gszzl: 估算涨跌幅(%)gztime: 估值更新时间cost: 用户买入成本价
操作流程
| 用户意图 | 执行步骤 |
|---|---|
| 查询基金 | fund_api.py query {代码} → 解析 JSON 输出 |
| 添加持仓 | portfolio.py add {代码} {份额} {成本} |
| 查看持仓收益 | portfolio.py list → fund_api.py query {代码列表} → 计算收益 |
| 切换用户 | portfolio.py user {用户名} |
| 查看行情 | fund_api.py index |
API 响应字段
注意事项
- 首次使用需运行
portfolio.py init初始化数据目录 - 实时估值使用天天基金接口
http://fundgz.1234567.com.cn/js/{code}.js - 交易时段:9:30-11:30, 13:00-15:00(排除节假日)
- QDII基金估值可能延迟,部分新发基金无估值数据
Ratings
4.6★★★★★67 reviews- ★★★★★Ama Martinez· Dec 28, 2024
fund-assistant is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Hassan Thompson· Dec 24, 2024
fund-assistant has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Zaid Ramirez· Dec 24, 2024
Registry listing for fund-assistant matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Chen Bhatia· Dec 20, 2024
fund-assistant reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Chaitanya Patil· Dec 12, 2024
fund-assistant fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Noor Gupta· Dec 8, 2024
Solid pick for teams standardizing on skills: fund-assistant is focused, and the summary matches what you get after install.
- ★★★★★Rahul Santra· Nov 27, 2024
fund-assistant has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Harper Malhotra· Nov 19, 2024
fund-assistant fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Valentina Srinivasan· Nov 15, 2024
Useful defaults in fund-assistant — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Chen Mehta· Nov 11, 2024
I recommend fund-assistant for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
showing 1-10 of 67