refactor: restructure to clean architecture
fix: restore ScoringConfig improvements lost in refactor commit docs: rewrite README and CLAUDE.md to reflect current architecture code-format code fixes
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* bin/import-portfolio.js — Portfolio CSV Importer
|
||||
*
|
||||
* Reads a holdings export from Robinhood, Vanguard, or Fidelity
|
||||
* and merges the positions into portfolio.json.
|
||||
*
|
||||
* Broker is auto-detected from CSV headers.
|
||||
* Existing entries are updated in-place; new tickers are added.
|
||||
*
|
||||
* How to export:
|
||||
* Robinhood → Account → Statements & History → Export → Holdings
|
||||
* Vanguard → My Accounts → Holdings → Download (top-right icon)
|
||||
* Fidelity → Accounts & Trade → Portfolio → Positions → Download CSV
|
||||
*
|
||||
* Usage:
|
||||
* npm run import-portfolio -- <file.csv>
|
||||
*/
|
||||
|
||||
import { PortfolioImporter } from '../src/finance/PortfolioImporter.js';
|
||||
|
||||
const csvPath = process.argv[2];
|
||||
|
||||
if (!csvPath) {
|
||||
console.error('Usage: npm run import-portfolio -- <path-to-csv>\n');
|
||||
console.error('Examples:');
|
||||
console.error(' npm run import-portfolio -- ~/Downloads/robinhood_holdings.csv');
|
||||
console.error(' npm run import-portfolio -- ~/Downloads/vanguard_holdings.csv');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
new PortfolioImporter().import(csvPath);
|
||||
} catch (err) {
|
||||
console.error(`\nImport failed: ${err.message}`);
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user