-
Notifications
You must be signed in to change notification settings - Fork 0
CLI Reference
Create the config file and SQLite database.
daybook initCreates ~/.daybook/config.json and ~/.daybook/data.db. Safe to run multiple times — won't overwrite existing files.
Register a new source account.
daybook account add <id> --source <source> --identifier <id> --label <label>| Flag | Required | Description |
|---|---|---|
--source |
Yes | Source type: coinbase, kraken, binance, binance-us, csv, eth, polygon
|
--identifier |
Yes | Email/account label (exchanges and CSV buckets) or wallet address (EVM) |
--label |
No | Human-readable label |
List all configured accounts.
daybook account list| Flag | Description |
|---|---|
--format <fmt> |
Output format: json
|
Ingest transactions from a source into the database.
daybook sync --source <source> [options]| Flag | Description |
|---|---|
--source <src> |
Source to sync: coinbase, kraken, binance, binance-us, csv, eth, polygon
|
--file <path> |
CSV file path. Required for CSV-only sources; optional for Coinbase CSV import. |
--account <id> |
Specific account to sync (optional, uses first matching account) |
--from <date|block> |
Start sync from date for Coinbase API/EVM, or block number for EVM. |
--include-failed-gas |
Include gas from failed transactions via Etherscan. EVM only. Requires ETHERSCAN_API_KEY. |
# Coinbase API sync. See [[Coinbase API Setup]] for credentials.
daybook sync --source coinbase --from 2024-01-01
daybook sync --source coinbase
# Coinbase CSV import
daybook sync --source coinbase --file ~/Downloads/coinbase.csv
# Full Kraken import
daybook sync --source kraken --file ~/Downloads/kraken-ledger.csv
# Full Binance import
daybook sync --source binance --file ~/Downloads/binance-ledger.csv
# Full Binance.US import
daybook sync --source binance-us --file ~/Downloads/binance-us-tax.csv
# Generic universal/manual CSV import
daybook sync --source csv --file ~/Downloads/universal-ledger.csv
# Full EVM sync
daybook sync --source eth
# Incremental sync from a date
daybook sync --source eth --from 2024-01-01
# Incremental sync from a block
daybook sync --source polygon --from 50000000
# Include failed transaction gas
daybook sync --source eth --include-failed-gas-
--fromis supported for Coinbase API sync and EVM sync. It is not supported for CSV imports. -
--include-failed-gasrequires theETHERSCAN_API_KEYenvironment variable. - All syncs are idempotent — duplicate events are skipped via
INSERT OR IGNORE.
Show the total number of raw events in the database.
daybook events count| Flag | Description |
|---|---|
--account <id> |
Filter to one account |
--source <source> |
Filter to one source |
--format <fmt> |
Output format: json
|
Display raw events in a structured Ink table.
daybook events list [options]| Flag | Description |
|---|---|
--type <type> |
Filter by event type (e.g., trade, income, crypto_in, nft_acquisition, nft_disposal) |
--source <source> |
Filter by source (e.g., coinbase, kraken, binance, csv, eth) |
--account <id> |
Filter by account ID |
--limit <n> |
Maximum rows to display (default: 20) |
--format <fmt> |
Output format: json
|
The table displays: timestamp, type, asset/amount (all legs joined with /), source, and account. Fee legs are shown dimmed with a (fee) prefix. The account column is omitted when the terminal is narrower than 100 characters.
Run the 8-rule classifier chain over raw events to produce ledger entries.
daybook classify [options]| Flag | Description |
|---|---|
--dry-run |
Preview changes without writing to the database |
--review |
Interactively review and override unclassified events after classification |
--no-review |
Suppress interactive review (default when stdout is not a TTY) |
--dry-run runs the full classifier and displays a diff against the current database state:
[dry-run] No changes written to database
Events processed: 1,945
Entries computed: 1,832
trade: 412
transfer_self: 89
...
unclassified: 3
Changes vs current DB:
+ 12 new entries
- 5 removed entries
= 1,815 unchanged
--review launches an Ink-based interface after classification completes. Navigate unclassified entries with arrow keys, press Enter to select a type override, or q to exit. Overrides are persisted as ClassifierOverride records.
Export tax data for a given year. Supports CSV, IRS Form 8949 PDF, Schedule D PDF, and TXF formats.
daybook export <year> [options]| Flag | Description |
|---|---|
--format <fmt> |
Output format: csv (default), 8949, schedule-d, txf
|
--method <method> |
Cost basis method: FIFO (default), HIFO, LIFO, specific-id
|
--8949-checkbox <cat> |
Form 8949 checkbox category: A, B, or C (default: C) |
--output <path> |
Output file path (overrides default naming) |
--lot-selections <path> |
Load Specific ID lot selections from a JSON file |
--no-wash-sale-flag |
Omit the Wash Sale? column from CSV output |
# Default CSV export
daybook export 2024
# IRS Form 8949 PDF (with continuation sheets for >14 disposals)
daybook export 2024 --format 8949
# IRS Schedule D PDF summary
daybook export 2024 --format schedule-d
# TXF for TurboTax import
daybook export 2024 --format txf
# Form 8949 with checkbox A (1099-B with basis reported)
daybook export 2024 --format 8949 --8949-checkbox ADefault output file naming:
| Format | File name pattern |
|---|---|
csv |
daybook-<year>-<method>.csv |
8949 |
daybook-<year>-<method>-8949.pdf |
schedule-d |
daybook-<year>-<method>-schedule-d.pdf |
txf |
daybook-<year>-<method>.txf |
All formats produce identical numbers from the same TaxResult data. Use --output to override the default file name for any format.
When using --method specific-id:
-
Without
--lot-selections: launches an interactive Ink-based lot picker. For each disposal, you see available lots with acquisition date, amount, unit cost, and holding period. Select lots with checkboxes, presssto skip (falls back to FIFO for that disposal). -
With
--lot-selections <path>: loads a JSON file mapping lot IDs to amounts. Use this to replay a previous selection without the interactive flow.
After interactive selection, the tool prints the path to a JSON file you can use for replay.
By default, the CSV includes a Wash Sale? column (Y or N) for each disposal. A disposal is flagged when:
- The disposal has a loss (
gainLoss < 0) - The same asset was acquired within ±30 calendar days (UTC) of the disposal
The export summary prints the count of flagged disposals. Use --no-wash-sale-flag to suppress both the column and the summary line.
Wash sale flags are informational only — daybook does not compute disallowance amounts.
Compare tax outcomes across cost basis methods.
daybook compare <year>Displays a side-by-side Ink table showing short-term gain, long-term gain, total taxable, and income for FIFO, HIFO, and LIFO methods.
| Flag | Description |
|---|---|
--format <fmt> |
Output format: json
|
Set a manual price override for an asset on a specific date.
daybook overrides set <asset> <date> <price>For NFTs, use the <contractAddress>:<tokenId> format as the asset:
daybook overrides set 0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d:4523 2024-03-15 50000List all price overrides.
daybook overrides list| Flag | Description |
|---|---|
--format <fmt> |
Output format: json
|
Remove a price override by ID.
daybook overrides remove <id>Getting Started
Usage
Architecture