An investment portfolio tracker that runs entirely locally. All data stays in ~/.portfolio-tracker/.
~/.portfolio-tracker/data.json (portfolios, assets, prices)~/.portfolio-tracker/config.json (API keys, wallet addresses, user profile)/scripts/ , run via npx tsxBefore running any script, ensure dependencies are installed:
npm install --prefix <skill-path>/scripts
Replace with the actual installed path of this skill.
Each script is a standalone CLI tool. Run them with:
npx tsx <skill-path>/scripts/<script>.ts <command> [args]
Scripts read from stdin when needed and output JSON to stdout.
load — Read portfolio data (creates default if missing)save — Write portfolio data (JSON from stdin)load-config — Read configsave-config — Write config (JSON from stdin)crypto — Get crypto price (Binance → CoinGecko)stock — Get stock price (Yahoo Finance)fx — Get USD/CNY/HKD exchange rateshistorical — Get 3yr monthly historical datasearch — Search for assets by name/symbolrefresh — Batch refresh prices (assets JSON from stdin)sync — Fetch all Binance balances (6 account types)validate — Validate API credentialssync — Fetch IBKR positions via Flex Queryvalidate — Validate IBKR credentialssync [chain] — Fetch wallet balances (single chain or all 5 EVM chains)validate — Validate EVM address{
"id": "unique-id",
"type": "CRYPTO | USSTOCK | HKSTOCK | ASHARE | CASH",
"symbol": "BTC",
"name": "Bitcoin",
"quantity": 1.5,
"avgPrice": 40000,
"currentPrice": 50000,
"currency": "USD | CNY | HKD",
"transactions": [],
"source": { "type": "manual | binance | wallet | ibkr" }
}
{
"id": "unique-id",
"name": "Main",
"assets": [...]
}
data-store.ts loadcurrentPortfolioIdquantity * currentPrice per assetexchangeRatesfetch-prices.ts search fetch-prices.ts crypto/stock fetch-prices.ts refresh via stdinfetch-prices.ts fx for exchange ratescurrentPrice and the exchangeRateslastPriceRefresh to current ISO timestampAvailable user commands:
/portfolio — View and manage portfolios/prices — Refresh all prices/setup — Configure API keys and wallets/sync-binance — Sync from Binance/sync-ibkr — Sync from Interactive Brokers/sync-wallet — Sync from blockchain wallet/advise — Get AI investment advice共 1 个版本