← 返回 Skills 市场
rsoutar

Claw Portfolio

作者 Richard Soutar · GitHub ↗ · v1.0.2
cross-platform ✓ 安全检测通过
630
总下载
0
收藏
4
当前安装
3
版本数
在 OpenClaw 中安装
/install claw-portfolio
功能描述
Track stock and crypto portfolios with CLI - real-time prices, P&L, dividend tracking, multiple portfolios
使用说明 (SKILL.md)

Portfolio Tracker

A CLI tool for tracking stock and crypto portfolios with real-time prices, P&L, and dividend tracking.

When to Use This Skill

Use this skill when you need to:

  • Track stock and crypto holdings locally
  • Get real-time prices and P&L
  • Track dividend yields, Yield on Cost, and projected income
  • View upcoming ex-dividend dates
  • Manage multiple portfolios
  • Export portfolio data to CSV

Tools

This skill provides the following capabilities:

1. List Holdings

Show all holdings with current values and P&L.

Command:

npx tsx portfolio.ts list

2. Add Holding

Add a new stock or crypto holding.

Command:

npx tsx portfolio.ts add \x3Csymbol> \x3Cquantity> \x3Cprice> \x3Cname> [type]

Examples:

npx tsx portfolio.ts add AAPL 10 150 "Apple Inc." stock
npx tsx portfolio.ts add BTC 0.5 45000 Bitcoin crypto

3. Sell Holding

Sell shares using FIFO (First-In-First-Out) cost basis method.

Command:

npx tsx portfolio.ts sell \x3Csymbol> \x3Cquantity> \x3Cprice> [date]

Examples:

npx tsx portfolio.ts sell AAPL 5 180 2025-06-01
npx tsx portfolio.ts sell BTC 0.25 50000

4. Transaction History

View sell history for all holdings or a specific symbol.

Command:

npx tsx portfolio.ts history [symbol]

Examples:

npx tsx portfolio.ts history
npx tsx portfolio.ts history AAPL

5. P&L Summary

Show both realized and unrealized profit/loss.

Command:

npx tsx portfolio.ts pnl

6. Dividend Tracking

View detailed dividend information for stock holdings including yield, Yield on Cost (YOC), and projected annual income.

Command:

npx tsx portfolio.ts dividends

7. Dividend Summary

Show portfolio-level dividend summary: total projected income, weighted average yield, and Yield on Cost.

Command:

npx tsx portfolio.ts dividend-summary

Output includes:

  • Total projected annual income
  • Monthly/quarterly income estimates
  • Weighted average yield across all holdings
  • Portfolio Yield on Cost
  • Count of dividend-paying stocks

8. Dividend Calendar

View upcoming ex-dividend dates for your holdings.

Command:

npx tsx portfolio.ts calendar [days]

Examples:

npx tsx portfolio.ts calendar       # Next 30 days
npx tsx portfolio.ts calendar 60    # Next 60 days

9. List with Dividends

The list command automatically fetches dividend data. Use --no-dividends flag to skip.

Commands:

npx tsx portfolio.ts list           # With dividend info
npx tsx portfolio.ts list --no-dividends  # Skip dividends

10. Remove Holding

Remove a holding by symbol.

Command:

npx tsx portfolio.ts remove \x3Csymbol>

11. Portfolio Value

Show total portfolio value and P&L.

Command:

npx tsx portfolio.ts value

12. Manage Portfolios

List, switch, or create portfolios.

Commands:

npx tsx portfolio.ts portfolios
npx tsx portfolio.ts switch "Portfolio Name"
npx tsx portfolio.ts create "New Portfolio"

Tip: After running npm link, you can use the shorter portfolio command instead of npx tsx portfolio.ts.

Installation

First, install the required dependencies:

npm install

This will install all necessary packages including TypeScript runtime (tsx), Next.js, React, and other dependencies listed in package.json.

Optional: Link the CLI globally for easier access:

npm link

After linking, you can use portfolio \x3Ccommand> instead of npx tsx portfolio.ts \x3Ccommand>.

NPM Scripts

npm run dev        # Start web UI (optional)
npm run build      # Build for production

Web UI (Optional)

You can also run an optional web interface with full dividend tracking support:

npm run dev

Then open http://localhost:3000

Web UI Features:

  • Real-time portfolio value and P&L tracking
  • Dividend summary cards (annual income, weighted yield, YOC, upcoming dates)
  • Detailed dividend breakdown table per stock
  • Visual calendar of upcoming ex-dividend dates
  • Interactive pie chart for portfolio allocation

Data Storage

Portfolio data is stored locally in data/portfolio.json. The data file is created automatically on first run with an empty portfolio.

Features

  • Real-time stock prices via Yahoo Finance API
  • Real-time crypto prices via CoinGecko API
  • Multiple portfolio support
  • P&L tracking per holding
  • Dividend tracking (yield, YOC, projected income, ex-dates)
  • CLI and optional web interface
安全使用建议
This skill appears coherent and implements the described portfolio CLI + optional web UI. Before installing: (1) be aware npm install will pull a large dependency tree (Next.js, React, etc.) — if you only need the CLI you can review package.json and remove the web UI deps or run the script with a minimal environment; (2) the tool stores data locally at data/portfolio.json in the project directory — back it up if needed and don't run the project from a directory with sensitive files; (3) it makes outbound calls to public APIs (Yahoo Finance, CoinGecko) to fetch prices/dividends, so expect network traffic; (4) if you want least risk, inspect the repository locally or run it in a container/isolated environment before linking globally. No credentials are requested by the skill.
功能分析
Type: OpenClaw Skill Name: claw-portfolio Version: 1.0.2 The OpenClaw AgentSkills skill bundle implements a portfolio tracker with both CLI and optional web UI. It uses `zod` for robust input validation on all CLI arguments, mitigating shell injection risks. Network calls are exclusively made to legitimate financial data APIs (Yahoo Finance, CoinGecko) for real-time prices and dividend information. File system operations are confined to a local `data/portfolio.json` file for storing user portfolios, without accessing sensitive system files or environment variables. The `SKILL.md` contains no prompt injection attempts. All observed behaviors are aligned with the stated purpose and lack any indicators of intentional harmful actions or significant exploitable vulnerabilities.
能力评估
Purpose & Capability
Name/description (portfolio tracker with CLI + optional web UI) match the provided files and runtime commands. The code implements CLI commands and an optional Next.js web UI, uses Yahoo Finance and CoinGecko for prices/dividends, and stores data locally in data/portfolio.json. The presence of Next.js/React in package.json is justified by the optional web UI documented in SKILL.md.
Instruction Scope
SKILL.md instructs only to run npm install, optionally npm link, and to invoke the CLI via npx tsx portfolio.ts. The instructions and code operate on local paths (data/portfolio.json) and call only public price/dividend APIs. There are no instructions to read unrelated system files, environment variables, or to exfiltrate data to unexpected endpoints.
Install Mechanism
There is no custom install spec (instruction-only), so installation is the normal npm install of the bundled project. That will pull a substantial dependency tree (Next.js, React, tsx, many packages) which is expected given the included web UI, but is heavier than a minimal CLI-only tool. No downloads from arbitrary URLs or extract steps are present.
Credentials
The skill declares no required environment variables or credentials and the code does not attempt to access any secrets or unrelated config paths. It does make outbound requests to public APIs (Yahoo Finance and CoinGecko) which is reasonable for price/dividend data and proportional to its purpose.
Persistence & Privilege
The skill does persist its own data to data/portfolio.json within the project directory. It does not request always:true, does not modify other skills or system settings, and does not request elevated privileges. Optional npm link (global CLI) is user-controlled and documented.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install claw-portfolio
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /claw-portfolio 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
Big update: Adds full dividend tracking features throughout CLI and web UI. - Dividend tracking support: yields, Yield on Cost, projected income, and ex-dividend dates. - New commands: `dividends`, `dividend-summary`, and `calendar` for dividend-focused insights. - Holdings listing now shows dividend info by default, with an option to skip. - Enhanced README and SKILL.md to document all dividend features and usage. - Web interface updated with dividend summary, breakdowns, and calendar views.
v1.0.1
- Migrated CLI from JavaScript (portfolio.js) to TypeScript (portfolio.ts) - Added support for selling holdings and tracking transactions (FIFO cost basis) - Introduced transaction history and realized/unrealized P&L reporting - Updated documentation and examples to use TypeScript - Adjusted required files and data storage references in metadata and docs
v1.0.0
Initial release of claw-portfolio. - Track stock and crypto holdings locally via CLI. - Get real-time prices and P&L for portfolio holdings. - Manage multiple portfolios and switch between them. - Export portfolio data to CSV. - Optional web UI for portfolio management. - Local data storage in JSON file.
元数据
Slug claw-portfolio
版本 1.0.2
许可证
累计安装 4
当前安装数 4
历史版本数 3
常见问题

Claw Portfolio 是什么?

Track stock and crypto portfolios with CLI - real-time prices, P&L, dividend tracking, multiple portfolios. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 630 次。

如何安装 Claw Portfolio?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install claw-portfolio」即可一键安装,无需额外配置。

Claw Portfolio 是免费的吗?

是的,Claw Portfolio 完全免费(开源免费),可自由下载、安装和使用。

Claw Portfolio 支持哪些平台?

Claw Portfolio 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Claw Portfolio?

由 Richard Soutar(@rsoutar)开发并维护,当前版本 v1.0.2。

💬 留言讨论