Skip to content

Commit a3c6769

Browse files
committed
refactor
1 parent 6a6d8be commit a3c6769

47 files changed

Lines changed: 1309 additions & 1006 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ ibctl transaction list --from 20250101 --to 20251231 --base-currency USD
5353
| `ibctl data zip -o <file>` | Archive the ibctl directory to a zip file |
5454
| `ibctl download` | Download and cache IBKR data via Flex Query API |
5555
| `ibctl holding list` | Display holdings with prices, positions, and classifications |
56-
| `ibctl holding lot list` | Display individual FIFO tax lots |
57-
| `ibctl holding category list` | Display holdings aggregated by category |
58-
| `ibctl holding geo list` | Display holdings aggregated by geographic classification |
59-
| `ibctl holding safe-sell list` | Identify positions safe to sell from a tax perspective (loss or LTCG only) |
60-
| `ibctl holding unsafe-sell list` | Show positions with short-term capital gains exposure |
61-
| `ibctl holding value` | Display portfolio value with estimated tax impact |
56+
| `ibctl lot list` | Display individual FIFO tax lots |
57+
| `ibctl category list` | Display holdings aggregated by category |
58+
| `ibctl geo list` | Display holdings aggregated by geographic classification |
59+
| `ibctl possible-sale list --safe` | Identify positions safe to sell from a tax perspective (loss or LTCG only) |
60+
| `ibctl possible-sale list --unsafe` | Show positions with short-term capital gains exposure |
61+
| `ibctl value` | Display portfolio value with estimated tax impact |
6262
| `ibctl transaction list` | List all transactions (buys, sells, dividends, interest, WHT, etc.) chronologically |
63-
| `ibctl transaction sale list` | List realized security sales with FIFO lot matching for tax reporting |
63+
| `ibctl realized-sale list` | List realized security sales with FIFO lot matching for tax reporting |
6464

6565
All commands accept `--dir` to specify the ibctl directory (defaults to `.`). All holding and transaction commands accept `--base-currency` (default `USD`) to convert values to a different currency. Holding commands accept `--realtime` to fetch current stock prices and FX rates from Yahoo Finance on-demand. For international symbols where IBKR and Yahoo symbols differ, add mappings to `realtime_symbols` in `ibctl.yaml`. Use `--help` on any command for detailed documentation.
6666

@@ -70,10 +70,10 @@ Generate CSV files for your accountant:
7070

7171
```bash
7272
# Realized capital gains for IRS (US tax reporting).
73-
ibctl transaction sale list --from 20250101 --to 20251231 --base-currency USD --format csv > transaction-sale-list-2025-usd.csv
73+
ibctl realized-sale list --from 20250101 --to 20251231 --base-currency USD --format csv > realized-sale-list-2025-usd.csv
7474

7575
# Realized capital gains for CRA (Canadian tax reporting).
76-
ibctl transaction sale list --from 20250101 --to 20251231 --base-currency CAD --format csv > transaction-sale-list-2025-cad.csv
76+
ibctl realized-sale list --from 20250101 --to 20251231 --base-currency CAD --format csv > realized-sale-list-2025-cad.csv
7777

7878
# Complete transaction history for IRS (dividends, interest, WHT, buys, sells, etc.).
7979
ibctl transaction list --from 20250101 --to 20251231 --base-currency USD --format csv > transaction-list-2025-usd.csv

book/src/SUMMARY.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
- [Commands](commands/overview.md)
1414
- [download](commands/download.md)
1515
- [holding list](commands/holding-list.md)
16-
- [holding lot list](commands/holding-lot-list.md)
17-
- [holding category list](commands/holding-category-list.md)
18-
- [holding geo list](commands/holding-geo-list.md)
19-
- [holding safe-sell list](commands/holding-safe-sell-list.md)
20-
- [holding unsafe-sell list](commands/holding-unsafe-sell-list.md)
21-
- [holding value](commands/holding-value.md)
16+
- [lot list](commands/lot-list.md)
17+
- [category list](commands/category-list.md)
18+
- [geo list](commands/geo-list.md)
19+
- [possible-sale list](commands/possible-sale-list.md)
20+
- [value](commands/value.md)
2221
- [transaction list](commands/transaction-list.md)
23-
- [transaction sale list](commands/transaction-sale-list.md)
22+
- [realized-sale list](commands/realized-sale-list.md)
2423
- [Tax Reporting Guide](tax-reporting.md)
2524
- [Glossary](glossary.md)

book/src/commands/holding-category-list.md renamed to book/src/commands/category-list.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# holding category list
1+
# category list
22

33
```
4-
ibctl holding category list [--dir DIR] [--format FORMAT] [--download] [--realtime] [--geo GEO] [--base-currency CURRENCY]
4+
ibctl category list [--dir DIR] [--format FORMAT] [--download] [--realtime] [--geo GEO] [--base-currency CURRENCY]
55
```
66

77
Aggregates holdings by category and displays each category's market value, percentage of net liquidation value, and capital gains breakdown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# holding geo list
1+
# geo list
22

33
```
4-
ibctl holding geo list [--dir DIR] [--format FORMAT] [--download] [--realtime] [--category CATEGORY] [--base-currency CURRENCY]
4+
ibctl geo list [--dir DIR] [--format FORMAT] [--download] [--realtime] [--category CATEGORY] [--base-currency CURRENCY]
55
```
66

77
Aggregates holdings by geographic classification and displays each geo's market value, percentage of net liquidation value, and capital gains breakdown.

book/src/commands/holding-list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ibctl holding list [--dir DIR] [--format FORMAT] [--download] [--realtime] [--ba
66

77
Shows combined positions across all accounts. Positions are computed via FIFO tax lot matching with weighted average cost basis, then verified against IBKR-reported positions.
88

9-
Use `--base-currency` (default `USD`) to convert all values to a different currency. Cost basis is converted using the FX rate on the lot's open date; current market value uses today's rate. This correctly shows FX-adjusted unrealized P&L -- the same methodology used by `transaction sale list` for realized gains.
9+
Use `--base-currency` (default `USD`) to convert all values to a different currency. Cost basis is converted using the FX rate on the lot's open date; current market value uses today's rate. This correctly shows FX-adjusted unrealized P&L -- the same methodology used by `realized-sale list` for realized gains.
1010

1111
Positions worth less than 0.01 in the base currency are filtered out. This removes dust positions (e.g., a JPY cash balance that rounds to -0.00 in USD).
1212

book/src/commands/holding-safe-sell-list.md

Lines changed: 0 additions & 97 deletions
This file was deleted.

book/src/commands/holding-unsafe-sell-list.md

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# holding lot list
1+
# lot list
22

33
```
4-
ibctl holding lot list [--dir DIR] [--format FORMAT] [--download] [--realtime] [--symbol SYMBOL] [--base-currency CURRENCY]
4+
ibctl lot list [--dir DIR] [--format FORMAT] [--download] [--realtime] [--symbol SYMBOL] [--base-currency CURRENCY]
55
```
66

77
Lists individual FIFO tax lots. Unlike `holding list`, which aggregates positions by symbol, this command shows each tax lot separately with its own open date, quantity, and cost basis.

book/src/commands/overview.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,18 @@ All holding commands accept `--base-currency` (default `USD`) to convert values
3131
| Command | Purpose |
3232
|---------|---------|
3333
| `ibctl holding list` | List combined positions across all accounts with prices, P&L, and classifications |
34-
| `ibctl holding lot list` | List individual FIFO tax lots with per-lot cost basis and P&L |
35-
| `ibctl holding category list` | Aggregate holdings by category with market value and P&L |
36-
| `ibctl holding geo list` | Aggregate holdings by geographic classification with market value and P&L |
37-
| `ibctl holding safe-sell list` | Identify positions safe to sell from a tax perspective (loss or LTCG only) |
38-
| `ibctl holding unsafe-sell list` | Show positions with short-term capital gains exposure (inverse of safe-sell) |
39-
| `ibctl holding value` | Display portfolio value with estimated unrealized and YTD realized tax impact |
34+
| `ibctl lot list` | List individual FIFO tax lots with per-lot cost basis and P&L |
35+
| `ibctl category list` | Aggregate holdings by category with market value and P&L |
36+
| `ibctl geo list` | Aggregate holdings by geographic classification with market value and P&L |
37+
| `ibctl possible-sale list` | Screen positions for possible sales; use `--safe`, `--safe-excluded`, or `--unsafe` to filter the view |
38+
| `ibctl value` | Display portfolio value with estimated unrealized and YTD realized tax impact |
4039

4140
## Transaction commands
4241

4342
| Command | Purpose |
4443
|---------|---------|
4544
| `ibctl transaction list` | List all transactions (buys, sells, dividends, interest, WHT, corporate actions, transfers) in chronological order |
46-
| `ibctl transaction sale list` | List realized security sales matched to FIFO buy lots for tax reporting |
45+
| `ibctl realized-sale list` | List realized security sales matched to FIFO buy lots for tax reporting |
4746

4847
## Diagnostic commands
4948

0 commit comments

Comments
 (0)