Track investments with buy/sell records, allocation charts, and P/L analysis. Use when managing a stock or crypto portfolio, rebalancing, or comparing assets.
Investment portfolio tracker — record holdings with buy prices, track performance and P/L, view allocation charts, analyze risk, calculate DCA, manage dividends, rebalance to targets, compare assets, and view sector breakdown. All data stored locally in JSONL format.
addAdd a holding — specify ticker, number of shares, and purchase price.
scripts/script.sh add AAPL 10 175.50
scripts/script.sh add BTC 0.5 42000
removeRemove a holding by ticker symbol.
scripts/script.sh remove TSLA
updateUpdate the current market price of a holding.
scripts/script.sh update AAPL 195.00
listShow all holdings with shares, buy price, and current price.
scripts/script.sh list
summaryPortfolio summary — total value, total cost, overall P/L.
scripts/script.sh summary
allocationASCII bar chart showing portfolio allocation by ticker as percentage.
scripts/script.sh allocation
performanceDetailed gain/loss analysis per holding with percentage returns.
scripts/script.sh performance
riskRisk metrics — standard deviation of returns and diversification score.
scripts/script.sh risk
rebalanceGenerate buy/sell suggestions to match target allocation percentages.
scripts/script.sh rebalance '{"AAPL":40,"GOOGL":30,"BTC":30}'
dcaDollar-cost averaging calculator — monthly investment table over 12 months.
scripts/script.sh dca AAPL 500
dividendCalculate dividend yield from annual dividend and current price.
scripts/script.sh dividend AAPL 3.76 195.00
compareCompare two holdings side by side — shares, prices, and P/L.
scripts/script.sh compare AAPL GOOGL
sectorsSector breakdown with allocation chart. Uses built-in ticker-to-sector mapping.
scripts/script.sh sectors
exportExport portfolio data as CSV.
scripts/script.sh export csv
historyShow transaction history from the log file.
scripts/script.sh history
helpscripts/script.sh help
versionscripts/script.sh version
# Build a portfolio
scripts/script.sh add AAPL 10 175
scripts/script.sh add GOOGL 5 140
scripts/script.sh add BTC 0.1 42000
scripts/script.sh update AAPL 195
# Analyze
scripts/script.sh summary
scripts/script.sh allocation
scripts/script.sh performance
scripts/script.sh risk
# Rebalance
scripts/script.sh rebalance '{"AAPL":50,"GOOGL":30,"BTC":20}'
scripts/script.sh compare AAPL GOOGL
scripts/script.sh sectors
| Variable | Required | Description |
|---|---|---|
PORTFOLIO_DIR | No | Data directory (default: ~/.local/share/investment-portfolio/) |
All data saved in ~/.local/share/investment-portfolio/:
holdings.jsonl — Portfolio holdings (one JSON object per line)history.log — Transaction logAll prices are manually entered — no external API calls.
Powered by BytesAgain | bytesagain.com | [email protected]