Skip to content

Commit 4b97096

Browse files
committed
updating post to reflect hsa-expense-analyzer-cli 0.2.0 changes
1 parent 0697708 commit 4b97096

File tree

2 files changed

+42
-11
lines changed

2 files changed

+42
-11
lines changed

_posts/2025-09-04-hsa-expense-analyzer.md

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ categories: [Hobbies, Tools]
77
tags: [Node.js, Personal Finance]
88
media_subpath: /assets/screenshots/2025-09-04-hsa-expense-analyzer
99
image:
10-
path: hsa-expense-analyzer.png
10+
path: hsa-expense-analyzer-v0.2.0.png
1111
width: 100%
1212
height: 100%
1313
alt: HSA Expense Analyzer sample output showing yearly expense breakdown and charts
@@ -76,7 +76,7 @@ I built this with Node.js because I wanted something I could run locally without
7676

7777
- **[`chartscii`](https://github.com/tool3/chartscii)** - Creates those ASCII bar charts you see in the output
7878
- **`yargs`** - Handles command-line arguments (`--dirPath`, `--help`, etc.)
79-
- **`prettyjson`** - Formats the summary tables nicely
79+
- **`prettyjson`** - Formats the year by year tables nicely
8080

8181
The core logic is surprisingly simple - it's mostly string manipulation and basic math.
8282

@@ -85,9 +85,8 @@ The core logic is surprisingly simple - it's mostly string manipulation and basi
8585
1. **Reads filenames** - Splits on " - " and validates the date/amount format
8686
2. **Groups by year** - Extracts the year from each date
8787
3. **Tracks reimbursements** - Looks for `.reimbursed.` in the filename
88-
4. **Warns about mismatched files** - Lists files that don't match the expected pattern
89-
5. **Generates reports** - Summary tables plus three different ASCII charts
90-
6. **Does the math** - Calculates the yearly totals for expenses and reimbursements
88+
4. **Warns about mismatched files** - Identifies files that don't follow the naming convention and explains what's wrong (missing date, invalid amount format, etc.)
89+
5. **Generates reports** - Creates visual ASCII charts (expenses by year, reimbursements by year, and side-by-side comparison) plus detailed summary statistics
9190

9291
## Usage
9392

@@ -96,10 +95,15 @@ The easiest way is to install as a global package from [npm](https://www.npmjs.c
9695
```bash
9796
npm install -g @joshjohanning/hsa-expense-analyzer-cli
9897
hsa-expense-analyzer-cli --dirPath="/path/to/your/receipts"
98+
99+
# Show only summary statistics (no tables or charts)
100+
hsa-expense-analyzer-cli --dirPath="/path/to/your/receipts" --summary-only
101+
102+
# Disable colored output for plain text
103+
hsa-expense-analyzer-cli --dirPath="/path/to/your/receipts" --no-color
99104
```
100105
{: .nolineno}
101106

102-
103107
Or if you want to clone locally and hack on the code:
104108

105109
```bash
@@ -169,18 +173,45 @@ Expenses vs Reimbursements by year
169173
2025 Expenses ╢██████████░░░░░░░░░░ $125.00
170174
2025 Reimbursements ╢░░░░░░░░░░░░░░░░░░░░ $0.00
171175
╚════════════════════
176+
177+
📊 Summary Statistics
178+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
179+
Total Receipts Processed: 9
180+
Years Covered: 5 (2021 - 2025)
181+
Total Expenses: $600.00
182+
Total Reimbursements: $185.00 (30.8%)
183+
Total Reimburseable: $415.00 (69.2%)
184+
Average Expenses/Year: $120.00
185+
Average Receipts/Year: 2
186+
Most Expensive Year: 2022 ($250.00 [41.7%], 3 receipts [33.3%])
172187
```
173188
{: .nolineno}
174189

175-
If you have files that don't match the expected naming pattern, you'll see a warning at the top of the output:
190+
If you have files that don't match the expected naming pattern, you'll see a warning at the top of the output (and an "Invalid Receipts" count in the summary statistics):
176191

177192
```text
178193
⚠️ WARNING: The following files do not match the expected pattern:
179194
Expected pattern: <yyyy-mm-dd> - <description> - $<amount>.<ext>
180-
Files with issues:
181-
- 2021-01-15- doctor - 50.00.pdf
182-
- 2021-01-15-wrong-format-missing-dashes.pdf
183-
- wrong-format.pdf
195+
196+
Filename Error
197+
-------- -----
198+
2021-01-10 - doctor-incorrect-amount - $50,00.pdf Amount "$50,00.pdf" should be a valid format like $50.00
199+
2021-01-10 - doctor-incorrect-amount - $50.pdf Amount "$50.pdf" should be a valid format like $50.00
200+
2021-01-15 - doctor-missing-dollar-sign - 50.00.pdf Amount "50.00.pdf" should start with $
201+
2021-01-25 - doctor-no-extension - $50.00 File is missing extension (should end with .pdf, .jpg, etc.)
202+
2021-01-30 - doctor-missing-amount.pdf File name should have format "yyyy-mm-dd - description - $amount.ext"
203+
2021-01-30- doctor-missing-space-before-dash - $50.00.pdf File name should have format "yyyy-mm-dd - description - $amount.ext"
204+
2021-1-25 - doctor-wrong-date-format - $50.00.pdf Date "2021-1-25" should be yyyy-mm-dd format
205+
2021-25-01 - doctor-wrong-date-format - $50.00.pdf Date "2021-25-01" should be yyyy-mm-dd format
206+
doctor-missing-date - $120.00.pdf File name should have format "yyyy-mm-dd - description - $amount.ext"
207+
208+
...
209+
210+
📊 Summary Statistics
211+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
212+
Total Receipts Processed: 25
213+
Invalid Receipts: 16 (64.0%)
214+
...
184215
```
185216
{: .nolineno}
186217

640 KB
Loading

0 commit comments

Comments
 (0)