Skip to content

CLI Reference

Griffen Fargo edited this page May 10, 2026 · 6 revisions

CLI Reference

daybook init

Create the config file and SQLite database.

daybook init

Creates ~/.daybook/config.json and ~/.daybook/data.db. Safe to run multiple times — won't overwrite existing files.

daybook account

daybook account add <id>

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

daybook account list

List all configured accounts.

daybook account list
Flag Description
--format <fmt> Output format: json

daybook sync

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.

Examples

# 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

Notes

  • --from is supported for Coinbase API sync and EVM sync. It is not supported for CSV imports.
  • --include-failed-gas requires the ETHERSCAN_API_KEY environment variable.
  • All syncs are idempotent — duplicate events are skipped via INSERT OR IGNORE.

daybook events

daybook events count

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

daybook events list

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.

daybook classify

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

--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

Interactive Review

--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.

daybook export

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

Output Formats

# 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 A

Default 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.

Specific ID

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, press s to 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.

Wash Sale Flagging

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.

daybook compare

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

daybook overrides

daybook overrides set

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 50000

daybook overrides list

List all price overrides.

daybook overrides list
Flag Description
--format <fmt> Output format: json

daybook overrides remove

Remove a price override by ID.

daybook overrides remove <id>

Clone this wiki locally