> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# 投资组合管理

> 跟踪持仓、配置和实时 P&L。

[在 GitHub 上查看 ->](https://github.com/AIsa-team/agent-skills/tree/main/financial/stock-portfolio)

**面向智能体的投资组合跟踪。** 使用 AIsa 市场数据管理持仓、配置和实时 P\&L 快照。

## 安装

如果还没有安装 AIsa CLI，请先安装：

```bash theme={null}
npm install -g @aisa-one/cli
```

然后安装该技能：

```bash theme={null}
aisa skills install stock-portfolio
```

## 智能体可以用它做什么？

> [card] 持仓跟踪
>
> 总结投资组合持仓和风险敞口。

> [card] 配置复核
>
> 按资产、行业或主题检查集中度。

> [card] 实时 P\&L
>
> 使用市场数据估算当前盈亏。

> [card] 再平衡备注
>
> 标记需要复核的持仓。

## 用法

```bash theme={null}
# 创建新组合
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" create "My Portfolio"

# 添加持仓
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" add AAPL --quantity 10 --cost 150
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" add BTC-USD --quantity 0.5 --cost 40000

# 展示带实时 P&L 的组合
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" show
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" show --portfolio "My Portfolio"

# 更新持仓
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" update AAPL --quantity 15 --cost 160

# 删除持仓
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" remove AAPL

# 列出所有组合
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" list

# 重命名组合
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" rename "My Portfolio" "Tech Holdings"

# 删除组合
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" delete "Old Portfolio"
```

### 操作

| 操作 | 说明 |
| - | - |
| `create NAME` | 创建新投资组合 |
| `list` | 列出所有投资组合 |
| `show` | 展示带实时 P\&L 的组合摘要 |
| `add TICKER` | 使用 `--quantity` 和 `--cost` 添加持仓 |
| `update TICKER` | 更新持仓数量/成本 |
| `remove TICKER` | 从组合中删除持仓 |
| `rename OLD NEW` | 重命名投资组合 |
| `delete NAME` | 删除投资组合 |

## 数据存储

组合数据存储在 `${CLAUDE_PLUGIN_DATA}/portfolios.json`，可跨会话持久化。

**非投资建议。** 仅供参考。

## 开始使用

1. 在 [aisa.one](https://aisa.one) 注册（新账户有 \$1 免费额度）。
2. 从控制台生成 API key。
3. 设置 key 并安装技能：
   ```bash theme={null}
   export AISA_API_KEY="your-key"
   npm install -g @aisa-one/cli
   aisa skills install stock-portfolio
   ```
4. 启动新的智能体会话，让运行时加载更新后的技能说明。

## 相关

> [card] [自选列表管理](https://aisa.one/docs/zh/agent-skills/stock-watchlist.md)
>
> 跟踪目标位和提醒检查。

> [card] [股票与加密资产分析](https://aisa.one/docs/zh/agent-skills/stock-analysis.md)
>
> 分析单个持仓。

> [card] [AIsa Market](https://aisa.one/docs/zh/agent-skills/market.md)
>
> 用于组合复核的市场数据。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.