Skip to main content

Command

Enum Command 

Source
pub enum Command {
    Init {
        key_backup: PathBuf,
        repair: bool,
    },
    Import {
        files: Vec<PathBuf>,
    },
    Verify,
    Report {
        year: Option<i32>,
        tax_year: Option<i32>,
        prior_taxable_gifts: Option<String>,
    },
    Reconcile(Reconcile),
    Config {
        set_fee_treatment: Option<FeeArg>,
        set_pre2025_method: Option<MethodLotArg>,
        attest_pre2025_method: bool,
        set_forward_method: Option<MethodLotArg>,
        exchange: Option<String>,
        effective_from: Option<String>,
    },
    ExportSnapshot {
        out: PathBuf,
        tax_year: Option<i32>,
        attest: Option<String>,
    },
    BackupKey {
        out: PathBuf,
    },
    Optimize(Optimize),
    TaxProfile {
        year: i32,
        filing_status: Option<FilingStatusArg>,
        ordinary_taxable_income: Option<String>,
        magi_excluding_crypto: Option<String>,
        qualified_dividends: Option<String>,
        other_net_capital_gain: Option<String>,
        carryforward_short: Option<String>,
        carryforward_long: Option<String>,
        w2_ss_wages: Option<String>,
        w2_medicare_wages: Option<String>,
        schedule_c_expenses: Option<String>,
        show: bool,
    },
}

Variants§

§

Init

Create the encrypted vault + force a key backup.

Fields

§key_backup: PathBuf

File to write the forced key backup to: an ASCII-armored, passphrase(S2K)-encrypted private key, owner-only (mode 0600). Identical format to backup-key --out. Store it offline — it is the only way to recover the vault if you lose vault.key.

FORMAT (structure — NOT a real key): —–BEGIN PGP PRIVATE KEY BLOCK—– … base64 armor of the S2K-encrypted secret key … —–END PGP PRIVATE KEY BLOCK—–

§repair: bool

Clear an interrupted/half-created init (orphan vault.key, no encrypted store) and start fresh.

§

Import

Import one or more export files (auto-groups Swan).

Fields

§files: Vec<PathBuf>
§

Verify

FR9 integrity check (non-zero exit on hard blockers).

§

Report

Show holdings + realized disposals/removals/income. With –tax-year: standalone TaxResult.

Fields

§year: Option<i32>

Filter realized disposals/removals/income to a specific calendar year (display path).

§tax_year: Option<i32>

Compute the crypto-attributable federal tax for the given tax year (B.5 / Task 9). Requires a stored tax profile (tax-profile --year Y ...) and the bundled TY table. Independent of –year; the two flags are not aliased.

§prior_taxable_gifts: Option<String>

Cumulative prior-year TAXABLE gifts (post-annual-exclusion Form 709 amounts), not gross gifts. Used for the §2505 lifetime-exclusion consumption advisory. Defaults to $0 when omitted (the advisory discloses this assumption). Must not be negative.

§

Reconcile(Reconcile)

Emit a reconciliation decision event.

§

Config

Show or set projection config (TP8 fee treatment / pre-2025 lot method / forward method).

Fields

§set_fee_treatment: Option<FeeArg>
§set_pre2025_method: Option<MethodLotArg>
§attest_pre2025_method: bool
§set_forward_method: Option<MethodLotArg>

§A.5(a): append a MethodElection decision (the forward standing order). Not a flag mutation — this is an event in the ledger. Use –effective-from to set the date (default: today / the decision’s made-date).

§exchange: Option<String>

§A.5(a) per-ACCOUNT scope for –set-forward-method (IRS 2025+ per-account rule): exchange:PROVIDER:ACCOUNT (the canonical wallet grammar). Omit for a GLOBAL election (the existing behavior). Only exchange accounts are electable (a method election is a brokerage-account concept; self:LABEL is rejected). The account MUST already exist in the vault — an unknown/typo’d account is rejected LOUDLY so it can’t create a dead election.

§effective_from: Option<String>

Effective-from date for –set-forward-method (YYYY-MM-DD). Defaults to made-date.

§

ExportSnapshot

FR10: export decrypted SQLite + CSV (the NFR2 plaintext exception).

Fields

§out: PathBuf

Output DIRECTORY receiving the decrypted SQLite DB (snapshot.sqlite) + projection CSVs (the NFR2 plaintext exception; created owner-only). ALWAYS writes: lots.csv, disposals.csv, removals.csv, income.csv. With –tax-year it ALSO writes form8949.csv, schedule_d.csv, form8283.csv, and schedule_se.csv (schedule_se only when there is business self-employment income). The event column in disposals.csv / removals.csv / income.csv is the event-ref that reconcile commands consume (select-lots, set-donation-details, reclassify-income, …).

FORMAT (removals.csv header + one sample donation row): event,kind,removed_at,lot,sat,basis,fmv_at_transfer,term,acquired_at,claimed_deduction,donee import|coinbase|X,donation,2025-03-01,import|coinbase|X#0,25000,120.00,150.00,long,2023-01-05,150.00,Charity Y

§tax_year: Option<i32>

Also emit the per-tax-year Form 8949 + Schedule D CSVs (form8949.csv / schedule_d.csv), scoped to this calendar year. Omit to write only the all-years projection CSVs.

§attest: Option<String>

Attestation phrase required to export while the ledger is PSEUDO-RECONCILED (a synthetic default contributes to the projection). Pass the exact phrase I attest this is true (trimmed, case-sensitive) to export the fictional draft ON PURPOSE. Omit on a fully-real ledger (never gated). Omit on an interactive terminal to be prompted; omit when piped (non-TTY) while pseudo-active and the export is refused.

§

BackupKey

Export the passphrase-protected key.

Fields

§out: PathBuf

File to write the exported key to: an ASCII-armored, passphrase(S2K)-encrypted private key, owner-only (mode 0600). Identical format to init --key-backup.

FORMAT (structure — NOT a real key): —–BEGIN PGP PRIVATE KEY BLOCK—– … base64 armor of the S2K-encrypted secret key … —–END PGP PRIVATE KEY BLOCK—–

§

Optimize(Optimize)

Lot-specific-identification optimizer (§C — read-only proposal or gated persistence).

§

TaxProfile

Set or show the per-tax-year tax profile (filing status, income, MAGI, etc.).

Fields

§year: i32

The tax year (e.g. 2025).

§filing_status: Option<FilingStatusArg>

IRS filing status.

§ordinary_taxable_income: Option<String>

Ordinary taxable income EXCLUDING all app-computed crypto items (net ST gains, mining/staking ordinary income). The engine adds the crypto items on top (B.1 / I5).

§magi_excluding_crypto: Option<String>

Modified AGI excluding crypto items, for the §1411 NIIT threshold comparison.

IMPORTANT (§1411 contract): this value MUST already include the taxpayer’s qualified dividends and non-crypto net capital gains (and any other MAGI add-backs from §1411(d)). The engine adds ONLY the crypto AGI delta on top (ambiguity #5 in the design). Omitting QD or non-crypto cap gains from this figure understates NIIT.

§qualified_dividends: Option<String>

Qualified dividends + other preferential-rate income sharing the §1(h) 0/15/20 LTCG rate stack. Required when setting a profile.

§other_net_capital_gain: Option<String>

Non-crypto net LT-character capital gain already in the profile (optional; defaults to 0 when omitted).

§carryforward_short: Option<String>

§1212(b) short-term capital loss carryforward into this year (optional; defaults to 0).

§carryforward_long: Option<String>

§1212(b) long-term capital loss carryforward into this year (optional; defaults to 0).

§w2_ss_wages: Option<String>

Form W-2 Social Security wages (Box 3 + Box 7 tips; Schedule SE line 8a). Reduces the §1401(a) SS cap: ss_cap = max(0, wage_base − w2_ss_wages). Optional; defaults to $0. Must not be negative.

§w2_medicare_wages: Option<String>

Medicare wages (Box 5; Form 8959 line 1). Reduces the Additional-Medicare threshold: addl_threshold = max(0, threshold − w2_medicare_wages) (§1401(b)(2)(B)/Form 8959 Part II). Optional; defaults to $0. Must not be negative.

§schedule_c_expenses: Option<String>

Schedule C deductible business expenses for the year — reduces net SE earnings; the income-tax stack above is NOT adjusted (see the advisory). Optional; defaults to $0. Must not be negative.

§show: bool

Show the stored profile for --year instead of setting it.

Trait Implementations§

Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V