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:
Kazuma
2026-06-03 00:02:55 -04:00
parent 19fc052d14
commit cd74497de6
60 changed files with 4610 additions and 796 deletions
+34
View File
@@ -0,0 +1,34 @@
// import-portfolio.js
//
// Imports holdings from a broker CSV export into portfolio.json.
//
// Usage:
// npm run import-portfolio -- holdings.csv
//
// Supported brokers (auto-detected from headers):
// Robinhood → Account → Statements & History → Export → Holdings
// Vanguard → My Accounts → Holdings → Download (top-right icon)
// Fidelity → Accounts & Trade → Portfolio → Positions → Download CSV
//
// If you have multiple brokers, run the command once per file —
// each import merges into portfolio.json without overwriting previous entries.
import { PortfolioImporter } from './src/finance/PortfolioImporter.js';
const csvPath = process.argv[2];
if (!csvPath) {
console.error('Usage: npm run import-portfolio -- <path-to-csv>');
console.error('');
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(`\n======>>>> Import failed <<<<====== ${err.message}`);
process.exit(1);
}