zfin/docs/reference/cli/index.md
Emil Lerch 74fc219afd
All checks were successful
Generic zig build / build (push) Successful in 5m48s
Generic zig build / publish-macos (push) Successful in 11s
Generic zig build / deploy (push) Successful in 23s
add docs/guides
2026-06-22 14:53:53 -07:00

5.1 KiB

CLI command reference

Every zfin subcommand, grouped the way zfin help groups them. Each command has its own page with flags and sample output. For a task-oriented path through these, see the user manual.

zfin [global options] <command> [command options]

Get help at any time with zfin help or per command with zfin <command> --help.

Per-symbol lookups

Command Does
perf 1y/3y/5y/10y trailing returns (Morningstar-style)
quote Latest quote with a chart and 20-day history
history Price history (symbol) or portfolio-value timeline
divs Dividend history with TTM yield
splits Split history
options Options chain (all expirations)
earnings Earnings history with EPS surprise, plus upcoming
etf ETF profile: holdings, sectors, AUM, inception

Portfolio analysis

Command Does
portfolio Positions, valuations, and watchlist
analysis Breakdowns by asset class, sector, geo, account, tax type
exposure True exposure to a symbol (direct + look-through)
review Per-holding performance and risk dashboard
projections Retirement projections and percentile bands
milestones Portfolio threshold crossings ($1M, doublings, ...)

Time-series and journaling

Command Does
snapshot Write a portfolio snapshot to history/
compare Compare the portfolio at two points in time
contributions Money added/withdrawn between two git revisions

Data hygiene

Command Does
audit Reconcile against brokerage exports + hygiene check
enrich Bootstrap metadata.srf from Wikidata + EDGAR
import Synthesize a portfolio file from a brokerage export
lookup Resolve a CUSIP to a ticker via OpenFIGI

Infrastructure

Command Does
cache Inspect or clear the local data cache
doctor Health-check files and environment (read-only)
version Show version and build info
interactive Launch the interactive TUI (alias i)

Global options

These apply to every command and must appear before the subcommand:

Option Effect
--no-color Disable colored output (also respects NO_COLOR).
--refresh-data=<auto|force|never> Cache freshness policy. auto (default) respects TTLs; force re-fetches everything; never is offline. See offline guide.
-p, --portfolio <PATTERN> Portfolio file or glob (repeatable; default portfolio*.srf). Resolved against ZFIN_HOME when set, else the current directory. Quote globs to prevent shell expansion.
-w, --watchlist <FILE> Watchlist file (default watchlist.srf).
zfin --no-color --refresh-data=never -p 'portfolio_*.srf' analysis

metadata.srf and accounts.srf load from the same directory as the first resolved portfolio file. See environment variables for ZFIN_HOME and related settings.


Documentation home