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>,
effective_from: Option<String>,
},
ExportSnapshot {
out: PathBuf,
tax_year: Option<i32>,
},
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: PathBufFile 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—–
Import
Import one or more export files (auto-groups Swan).
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).
Reconcile(Reconcile)
Emit a reconciliation decision event.
Config
Show or set projection config (TP8 fee treatment / pre-2025 lot method / forward method).
Fields
set_pre2025_method: Option<MethodLotArg>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).
ExportSnapshot
FR10: export decrypted SQLite + CSV (the NFR2 plaintext exception).
Fields
out: PathBufOutput 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
BackupKey
Export the passphrase-protected key.
Fields
out: PathBufFile 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
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.
Trait Implementations§
Source§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommand