rekon 0.0.9

Reconstruct where your time and compute went: account for agentic work on two axes and review a daily ledger instead of keeping a timesheet.
//! rekon: reconstruct where your time and compute went.

mod cli;
mod commands;

use std::process::ExitCode;

use clap::Parser;
use tracing_subscriber::EnvFilter;

use crate::cli::Cli;

fn main() -> ExitCode {
    let cli = Cli::parse();
    init_tracing(&cli.log);
    match commands::run(cli) {
        Ok(()) => ExitCode::SUCCESS,
        Err(e) => {
            eprintln!("rekon: {e:#}");
            ExitCode::FAILURE
        }
    }
}

// Logs go to stderr so stdout carries only the ledger (clean JSON for piping).
fn init_tracing(filter: &str) {
    let env = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new(filter));
    tracing_subscriber::fmt()
        .with_env_filter(env)
        .with_target(false)
        .with_writer(std::io::stderr)
        .init();
}