zfin/docs/reference/cli/import.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

2.4 KiB

zfin import

Synthesize a portfolio file from a brokerage positions export. Designed for managed accounts (direct-indexing baskets, accounts you don't track at lot granularity).

Usage: zfin -p <PORTFOLIO> import (--fidelity FILE | --schwab FILE | --wells-fargo FILE [--account NAME]) [-y]

Each run replaces the target portfolio file with synthetic lots -- one per (account, symbol) -- drawn from the export. Per-buy history is lost; git serves as the file-level history.

Re-import merge: when the target already exists, lots still present in the new export keep their prior open_date, open_price, and note::, so trailing-return and ST/LT classifications stay stable and git diff flags only genuine brokerage changes. New positions get an open_date::1970-01-01 sentinel; disappeared positions are dropped. Hand-edited fields (price::, ticker::) are not preserved.

Options

Flag Effect
-p, --portfolio <FILE> Target file (a single concrete path, not a glob). Required.
--fidelity <CSV> Fidelity positions CSV.
--schwab <CSV> Schwab per-account positions CSV.
--wells-fargo <FILE> Wells Fargo positions paste (- for stdin).
--account <NAME> (Wells Fargo only) account to attribute lots to; must match an accounts.srf entry.
-y, --yes Don't prompt before overwriting an existing file.

Account resolution needs an accounts.srf next to the target with institution:: + account_number:: entries matching the export; import refuses to write when an export account is unmapped.

Example

zfin -p portfolio_managed.srf import --fidelity ~/Downloads/Portfolio_Positions.csv

See also

  • audit -- reconcile an existing portfolio against an export instead of replacing it.
  • Map your accounts -- the institution/number mapping import needs.

CLI command reference