portfolio-intel CLI
portfolio-intel is the parser as a command-line tool. It reads the PDF from
disk and parses it in-process: no account, no key, nothing uploaded.
Install
Section titled “Install”Requires Node.js 20 or later.
npx @portfolio-intel/cli demonpm install -g @portfolio-intel/cliportfolio-intel --versionInteractive
Section titled “Interactive”portfolio-intel # open the terminalportfolio-intel demo # open it and run the bundled sampleportfolio-intel ~/Downloads/cas.pdf╭──────────────────────────────────────────────────────╮│ ✻ Welcome to Portfolio Intel CAS parser v0.1.0 ││ ││ /help for commands · /demo to try a sample ││ /parse <path>, or drop a PDF onto this window │╰──────────────────────────────────────────────────────╯
> /allocation
● Allocation by AMC · 7 fund houses SBI Mutual Fund ████░░░░░░░░░░░░ 27.7% ₹8,33,149 HDFC Mutual Fund ███░░░░░░░░░░░░░ 20.3% ₹6,10,610 PPFAS Mutual Fund ███░░░░░░░░░░░░░ 18.2% ₹5,49,071Drag a PDF onto the terminal window: the terminal types its path, and a bare
path to a .pdf is treated as /parse <path>. Password-protected statements
prompt for the password with masked input.
Commands
Section titled “Commands”| Command | What it does |
|---|---|
/demo | Parse the bundled sample statement |
/parse [path] | Parse a CAS PDF from disk |
/summary | Value, invested amount and gain |
/holdings [filter] | Holdings with units, NAV, value and weight |
/allocation | Value by fund house, with a concentration warning above 40% |
/verify [fund] | Recompute units × NAV and compare with the stated value |
/export | Write the masked holdings as JSON to the current directory (never overwrites) |
/status, /privacy, /api, /clear, /help | Session information and housekeeping |
Plain English works for the common ones: show holdings, verify sbi small cap.
| Key | Action |
|---|---|
/ | Open the command menu; ↑ ↓ move, tab completes, enter runs |
↑ ↓ | Walk command history |
esc | Interrupt a parse · close the menu · clear the line |
ctrl+c | Interrupt a parse · clear the line · press twice to exit |
ctrl+l | Clear the screen (the parsed statement stays loaded) |
ctrl+a ctrl+e ctrl+u ctrl+k ctrl+w | Shell-style line editing |
Headless, for scripts
Section titled “Headless, for scripts”portfolio-intel parse runs the same checks without the UI and exits.
portfolio-intel parse cas.pdf --json > holdings.json-
stdout is only the result — the transcript as text, or with
--jsonthe masked snapshot. Diagnostics go to stderr;--verboseadds parser logs. -
Passwords never go on the command line. Arguments are visible to every process on the machine and saved in shell history, so
--passwordis refused. Use an environment variable or stdin:Terminal window CAS_PASSWORD=ABCDE1234F portfolio-intel parse cas.pdf --password-env CAS_PASSWORDpass show cas | portfolio-intel parse cas.pdf --password-stdin --json -
The exit code says what happened.
Code Meaning 0Parsed 1Not parsed — missing file, not a CAS, or no holdings found 2Usage error 3Password missing or wrong
JSON shape
Section titled “JSON shape”{ "fileName": "cas.pdf", "source": "CAMS", "statementDate": "2025-12-31", "investor": "R**** S*****", "folioCount": 7, "holdings": [ { "name": "SBI Small Cap Fund - Direct Growth", "amc": "SBI Mutual Fund", "folio": "••••4471", "isin": "INF200K01…", "units": 4521.84, "nav": 184.25, "value": 833148.97, "cost": 520000 } ], "totalValue": 3013128.4, "totalCost": 2190000, "parseMs": 842, "sample": false}Names keep their shape but not their letters; folios keep only the last four characters.