#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
mod cli;
mod commands;
mod style;
mod xark_project;
fn main() {
if std::env::args().len() == 1 {
print_roadmap();
return;
}
commands::main();
}
fn print_roadmap() {
let steps: &[(&str, &str)] = &[
("xark doctor", "check your toolchain is set up"),
(
"xark init my-circuit",
"scaffold a circuit crate (rust-analyzer ready)",
),
("xark build .", "compile the circuit → R1CS"),
("xark setup .", "generate the proving/verifying keys"),
(
"xark prove . --inputs …",
"produce (and self-check) a proof + copy-paste calldata",
),
("xark verify .", "verify a proof locally"),
(
"xark client .",
"scaffold a TypeScript client (verify + calldata)",
),
(
"xark export .",
"generate the on-chain Solana verifier crate",
),
];
let width = steps
.iter()
.map(|(c, _)| c.chars().count())
.max()
.unwrap_or(0);
println!(
"{}",
style::brand("xark — write, prove & verify zero-knowledge circuits in Rust")
);
println!("\nThe path from zero to an on-chain proof:\n");
for (cmd, hint) in steps {
println!(
" {}{} {}",
style::brand(cmd),
" ".repeat(width.saturating_sub(cmd.chars().count())),
style::dim(hint),
);
}
println!(
"\n{}",
style::dim(
"Run `xark <command> --help` for details, or `xark doctor` to check your setup."
)
);
}