LEAP CLI Reference¶
The leap binary (crate leap-cli) is the command-line interface to LEAP
(Linked Exploratory Analysis & Plotting, GPL-3.0-or-later). Every subcommand
prints a structured JSON summary on stdout (pretty-printed, except
fit-ols --json which prints compact single-line JSON) and exits non-zero
with a clear error on failure. Numeric fields are null when non-finite;
missing/empty cells are treated as missing.
Input files must be CSV or Parquet (.csv / .parquet); anything else is
rejected. All numeric columns round-trip through the CSV loader. Row ids are
the stable row_id column stored in the file; --selected restricts an
analysis/plot to comma-separated row_ids (e.g. 0,2,4).
leap --help
leap <subcommand> --help
Global notes
- Errors are reported on stderr as
error: <message>; exit code is non-zero. --svg/--outpaths are written relative to the working directory.- All analysis runs the same
leap-statscore as the GUI.
Subcommand index¶
| Subcommand | Purpose |
|---|---|
inspect |
JSON dataset summary |
fit-ols |
OLS fit + residual diagnostics + profiler |
export-svg |
scatter SVG export |
project save / project open |
persist / inspect .leap projects |
workspace inspect |
JSON summary of a .leapw workspace file |
ttest |
one / two / paired t-tests |
nonparametric |
mann-whitney / wilcoxon / kruskal / spearman / kendall |
contingency |
2-D contingency table |
glm |
binomial/poisson GLM |
pca |
principal component analysis |
distribution |
fits + Andersen-Darling + quantiles |
formula |
evaluate formula columns |
graph-svg |
scatter / line / histogram SVG export |
doe generate / doe fit |
design of experiments |
spc |
SPC control charts (+ Nelson rules) |
capability |
Cp/Cpk/Pp/Ppk/Cpm/PPM + non-normal |
gage-rr |
crossed/nested Gage R&R |
survival |
KM / Nelson-Aalen / Log-Rank / Breslow |
lifetest |
parametric MLE + B-life quantiles |
cox |
Cox proportional hazards |
alt |
accelerated life testing |
mixed |
linear mixed-effects (REML/ML) |
timeseries |
ACF/PACF/Ljung-Box/ADF/Holt-Winters |
arima |
ARIMA fit + forecast |
fft |
spectral analysis |
filter |
Butterworth / Savitzky-Golay |
bayes |
Bayesian conjugate / MCMC / A-B |
plugin |
plugin registry host (list / trust / revoke / run) |
leap inspect <file>¶
JSON summary: file, format, row_count, row_id_column, and per-column
name, modeling_type (continuous/nominal/ordinal), nullable, units,
null_count, plus (numeric columns) descriptives (n_non_null, n_missing,
mean, variance, sd, min, max, median, q1, q3, iqr, lag1).
leap inspect data.csv
leap fit-ols <file> --y <col> --x <c1,c2> [--selected <ids>] [--json]¶
OLS fit with residual diagnostics and a per-predictor prediction profiler.
--json emits compact single-line JSON.
JSON output includes n_total, n_used, exclusion counts, coefficients
(estimate/se/t/p_value), R², adjusted R², residual SD, RSS/TSS, F-stat/p-value,
df, rank, diagnostics (fitted/raw/leverage/standardized/studentized residuals
+ Cook's distance + Q-Q points), and profiler slices (per-predictor points
with x / predicted_y / 95% CI / prediction interval / in_range, or an error).
leap fit-ols data.csv --y yield_pct --x temperature_c,pressure_bar
leap fit-ols data.csv --y yield_pct --x temperature_c --selected 0,1,2 --json
leap export-svg <file> --x <col> --y <col> --out <file.svg> [--selected <ids>]¶
Renders an x/y scatter SVG (selected rows highlighted). JSON summary: file,
format, out, points, selected_points.
leap export-svg data.csv --x temperature_c --y yield_pct --out scatter.svg
leap project save <input> --out <proj.leap> / leap project open <proj.leap>¶
Save imports input (CSV/Parquet) and persists it as a .leap project
directory (crash-safe; see USER_GUIDE). JSON summary: project, dataset_id,
version, format, row_count.
Open prints a JSON summary: project, dataset_id, version, row_count,
columns (name/type/units/nullable), selections (name + ids), analyses
(id/kind/dataset_version/spec/result).
leap project save data.csv --out demo.leap
leap project open demo.leap
leap workspace inspect <file.leapw>¶
Prints a JSON summary of a .leapw workspace file. Expected input is a JSON
root with format: "leap-workspace" and schema_version: 1, a dataset
object, plus optional reports, graph_builder.open, formulas,
sidebar.scripts, row_states, and workspace.profile.
JSON output: workspace, format, schema_version, dataset_kind,
dataset_path, resolved_dataset_path, dataset_exists, report_count,
report_platforms, graph_builder_open, formula_count, script_count,
row_states (selected/excluded/hidden/labeled counts; row_states
accepts either a dense per-row array or the sparse {selected:[ids], ...}
shape), profile, and optional expected_rows / expected_columns echoed
from the dataset object when present.
leap workspace inspect demo.leapw
leap ttest <file> --mode one|two|paired ...¶
one: requires--columnand--mu0two/paired: requires--aand--b--mu0hypothesized mean (one-sample only)--alpha(default 0.05),--alternative(two-sided/greater/less, defaulttwo-sided),--equal-var(pooled equal-variance two-sample)
JSON output: file, format, mode, alpha, alternative,
mean_difference, se, t, df, p_value, ci_low, ci_high,
cohens_d, hedges_g, n, n_missing.
leap ttest data.csv --mode one --column yield_pct --mu0 50 --alternative greater
leap ttest data.csv --mode two --a yield_a --b yield_b --equal-var
leap ttest data.csv --mode paired --a pre --b post
leap nonparametric <file> --mode <mode> [...]¶
mann-whitney:--a,--b; outputu,mean,sd,z,p_value,n_a,n_bwilcoxon(paired signed-rank on a−b):--a,--b; outputw_plus,n,mean,sd,z,p_valuekruskal:--value,--group(≥2 groups); outputh,df,p_value,groupsspearman/kendall:--x,--y; outputrho(spearman) ortau(kendall),z,p_value,n
--continuity-correction applies a continuity correction (mann-whitney and wilcoxon).
leap contingency <file> --rows <col> --cols <col> [--confidence <c>]¶
2-D contingency table (default 95% odds-ratio interval). JSON output:
row_labels, col_labels, counts, expected, row_totals, col_totals,
grand_total, chi_square (statistic/df/p_value), likelihood_ratio
(statistic/df/p_value), cramer_v, and — for 2×2 tables only — fisher_exact
(p_value) and odds_ratio (odds_ratio, log_odds_se, confidence_interval,
haldane_anscombe_applied).
leap contingency data.csv --rows batch --cols outcome --confidence 0.99
leap glm <file> --y <col> --x <c1,c2> --family binomial|poisson [--selected <ids>]¶
JSON output: family, selected_only, n_total, n_used, exclusion counts,
converged, iterations, n_params, rank, coefficients (estimate/se/
z_stat/p_value/ci_low/ci_high/ratio), deviance_null, deviance_residual,
log_likelihood, aic, bic.
leap glm data.csv --y pass --x temperature_c,pressure_bar --family binomial
leap pca <file> --columns <c1,c2> [--mode standardized|centered]¶
(default standardized). JSON output: mode, columns, eigenvalues,
explained_variance_ratio, cumulative_variance, loadings, scores.
leap distribution <file> --column <col>¶
Normal/lognormal/exponential/Weibull fits (log-likelihood, AIC/BIC, n_params), Anderson-Darling normality (statistic, adjusted statistic, p_value), empirical quantiles (p5/p25/p50/p75/p95).
leap formula <file> --formula "name = expr" [--formula "..." ...]¶
Evaluates formula columns against named numeric columns (repeatable). Missing/
non-finite values resolve to null. JSON output: one entry per formula with
name, expression, row-wise values.
leap formula data.csv --formula "z = temperature_c + pressure_bar"
leap graph-svg <file> --kind scatter|line|histogram --x <col> --y <col>|--column <col> [--bins <n>] --out <file.svg> [--selected <ids>]¶
scatter/linerequire--xand--yhistogramrequires--column;--binsdefault 20
JSON summary: out, kind, points (scatter/line) or bin_count + values
(histogram), selected_points.
leap doe generate --type <full|fractional|pb|ccd|bb|optimal> [...]¶
full:--k;--replicates(1),--center-points(0),--blocks(1, power of 2),--low(-1.0),--high(1.0),--randomize,--seed(0)fractional:--kand--p; same optionspb:--runs(12 or 20) and--factorsccd:--k;--variant(rotatable(default) |face-centered|inscribed),--center-points,--seedbb:--k;--center-points,--seedoptimal:--k;--model(main(default) |main-two-factor|quadratic),--criterion(d(default) |i),--runs,--deltaand--sigma(diagnostics)
Optional --svg <file> (scatter of the first two factors). JSON output:
design_name, kind, seed, factors, n_runs, per-run entries (run_order,
std_order, block, is_center_point, coded, and — full/fractional/pb —
natural), plus defining_relation (fractional), alpha (ccd), and for
optimal: criterion, model, objective, column_names, iterations,
n_starts_completed, and a diagnostics block when both --delta and --sigma are given.
leap doe fit <file> --y <col> --x <c1,c2> [--center <c1,c2>] [--step <s1,s2>] [--svg <file>]¶
Quadratic RSM fit to coded-unit predictors. JSON output: n_used, p_params,
residual_sd, coefficients, anova (ss/df/ms/F/p/R²/adj R²), optional
lack_of_fit, canonical (stationary point, eigenvalues, classification,
f_stationary), predicted_coded, predicted_natural (with --center/--step),
optional SVG.
leap doe generate --type full --k 3 --replicates 2 --center-points 5 --blocks 2 --randomize --seed 42 --svg design.svg
leap doe fit data.csv --y yield_pct --x x1,x2 --center 100,5 --step 10,1 --svg rsm.svg
leap spc <file> --mode <xbar-r|xbar-s|i-mr|p|np|c|u> ...¶
xbar-r/xbar-s:--column,--subgroup-size(2..=25)i-mr:--column;--span(default 2)p/np:--counts,--nsc:--countsu:--counts,--exposures
--nelson evaluates Western Electric/Nelson rules 1..8; --svg <file> exports
the primary series. JSON output includes center/limits and per-chart series
(xbar_center/xbar_ucl/xbar_lcl, r_center/r_ucl/r_lcl, mean_range,
sigma_hat, subgroup_means, subgroup_ranges, …); with --nelson a
nelson_rules block (rule violations or a "sigma is zero" warning) is added.
leap spc data.csv --mode xbar-r --column yield_pct --subgroup-size 5 --nelson --svg chart.svg
leap capability <file> --column <col> [--mode overall|within|non-normal] [--lsl v] [--usl v] [--target v] [--subgroup-size n] [--method range|stddev|moving-range] [--model empirical|weibull|lognormal] [--ppm] [--svg <file>]¶
overall(default): Cp/Cpk/Pp/Ppk (+Cpm/PPM with--lsl/--usl/--target)within: requires--subgroup-size;--method(range (default) | stddev | moving-range)non-normal: requires--model(empirical (default) | weibull | lognormal)
--ppm adds an ppm_estimate block (expected/observed PPM); --svg writes a histogram SVG.
leap capability data.csv --column yield_pct --lsl 40 --usl 60 --target 50 --ppm
leap gage-rr <file> --mode crossed|nested --part <col> --operator <col> --value <col> [--tolerance USL,LSL] [--alpha-pool a] [--svg <file>]¶
Crossed OR nested ANOVA Gage R&R. --tolerance is USL,LSL. --alpha-pool
(default 0.25) is the threshold for pooling Part × Operator interaction. --svg
writes a histogram SVG of the values. Crossed requires a fully rectangular grid
with equal replicates; nested requires ≥2 operators with matching part counts.
JSON output: mode, n_parts, n_operators, n_replicates, parts,
operators, pooled_interaction, interaction_p_value, sigma_grr,
sigma_part, sigma_tv, ndc, plus anova and rows blocks.
leap gage-rr data.csv --mode crossed --part part --operator operator --value reading --tolerance 60,40 --svg gage.svg
leap survival <file> --time <col> --event <col> [--group <col>] [--test kaplan-meier|nelson-aalen|log-rank|breslow] [--svg <file>]¶
Event column accepts 1/0, event/censored, true/false, etc. Default test is
kaplan-meier; log-rank and breslow require --group. JSON output
(kaplan-meier): times, survival, se, ci_lower, ci_upper, at_risk,
events, censored, median/q1/q3 quantiles. Nelson-Aalen: times, hazard,
se, at_risk, events. Log-rank/breslow: groups, observed, expected,
covariance, df, chi2, p_value.
leap lifetest <file> --time <col> --event <col> [--dist weibull|lognormal|exponential|all] [--ranks "10,50"] [--svg <file>]¶
MLE fits of right/interval-censored lifetimes. JSON output: dist, ranks,
n, fits (params + se + CI, log-likelihood, AIC/BIC, converged, solver,
iterations, life_quantiles per rank), model_comparison (delta AIC/BIC, when
--dist all), best_by_aic.
leap lifetest data.csv --time time_hours --event event --dist weibull --ranks "10,50" --svg life.svg
leap cox <file> --time <col> --event <col> --x <c1,c2> [--ties breslow|efron] [--svg <file>]¶
Cox proportional hazards (no intercept). --ties (default breslow). JSON
output: coefficients (coef/std_error/hazard_ratio/HR CI/z/p_value per
covariate), log_likelihood, null_log_likelihood, likelihood_ratio,
lr_p_value, concordance, baseline_times, baseline_cum_hazard,
iterations.
leap cox data.csv --time time_hours --event event --x temperature_c,strain --ties efron --svg cox.svg
leap alt <file> --lifetime <col> --event <col> --model Arrhenius|InversePowerLaw --distribution weibull|lognormal --temperature-k <col>|--stress <col> --test-condition <v> --use-condition <v> [--svg <file>]¶
Arrheniusrequires--temperature-k(Kelvin column)InversePowerLawrequires--stress(stress column)
JSON output: model, distribution, n, b0 (+SE), b1 (+SE), shape
(+SE), activation_energy_ev (Arrhenius) or acceleration_power (IPL),
b1_ci_low/b1_ci_high, predicted_scale_at_use, predicted_scale_log_se,
b10_at_use, b50_at_use, acceleration_factor, acceleration_factor_log_se,
log_likelihood, iterations.
leap alt data.csv --lifetime failure_h --event failed --model Arrhenius --distribution weibull --temperature-k temperature_k --test-condition 400 --use-condition 350 --svg alt.svg
leap mixed <file> --y <col> --x <c1,c2> --group <col> [--slope <col>] [--mode reml|ml] [--selected <ids>] [--svg <file>]¶
Linear mixed-effects model. Group column is categorical (remapped to 0..g−1).
--slope fits a per-row random slope. --mode reml (default) or ml.
--svg exports BLUP per group.
leap timeseries <file> --column <col> --mode <acf|pacf|ljung-box|adf|holt-winters> [...]¶
acf/pacf:--max-lag(default 10);pacflikewiseljung-box:--max-lagadf:--adf-model constant|constant-trend|none(defaultconstant)holt-winters:--hw-model simple|holt|triple-additive|triple-multiplicative(defaultsimple),--period(required for triple-*), optional explicit--alpha/--beta/--gamma,--hforecast horizon (default 0)
--svg exports the series. JSON output: for acf/pacf, mode, analysis,
n, lags (lag + value); ljung-box: q, df, p_value, tested_lags; adf:
tau, critical_values, reject_unit_root_5pct, n_obs; holt-winters:
hw_model, period, params (alpha/beta/gamma), sse, fitted, level,
trend, seasonal_indices, forecast, intervals_95.
leap timeseries data.csv --column yield_pct --mode acf --max-lag 20
leap timeseries data.csv --column yield_pct --mode adf --adf-model constant --svg acf.svg
leap arima <file> --column <col> [--p 1] [--d 0] [--q 0] [--horizon 0] [--svg <file>]¶
ARIMA(p,d,q) fit and forecast. --horizon 0 skips the forecast. JSON output:
mode, column, p, d, q, phi, theta, sigma2, mean, n_used,
log_likelihood, aic, aicc, bic, k, ar_stationary, ma_invertible,
ar_roots, ma_roots, forecasts (h/mean/variance/lo80/hi80/lo95/hi95).
leap arima data.csv --column yield_pct --p 1 --d 1 --q 1 --horizon 5 --svg forecast.svg
leap fft <file> --column <col> --fs <hz> [--mode psd|peaks|thd|snr|all] [--segment-len n] [--overlap-frac 0.5] [--window rectangular|hann|hamming|blackman-harris|flat-top] [--threshold-frac 0.3] [--svg <file>]¶
--fs (sampling rate Hz) is required. JSON output: mode, analysis, fs,
n, window; psd adds segment_len, overlap, psd (freq_hz/power bins);
peaks adds peaks (freq_hz/magnitude/power); thd adds thd_pct; snr adds
snr_db.
leap fft data.csv --column yield_pct --fs 100 --mode all --window hann --svg spectrum.svg
leap filter <file> --column <col> --mode butterworth|savgol [...]¶
butterworth:--kind lp|hp|bp(default lp),--order(1..=8, default 4),--cutoff(required; normalized in (0,1)),--cutoff-high(required for bp)savgol:--window-length(required, odd ≥3),--poly-order(default 2)
--svg exports the filtered series. JSON output: filter metadata plus the full
output series.
leap filter data.csv --column yield_pct --mode butterworth --kind lp --order 4 --cutoff 0.2 --svg filtered.svg
leap filter data.csv --column yield_pct --mode savgol --window-length 5 --poly-order 2
leap bayes <file> --mode conjugate|mcmc|ab [...]¶
conjugate¶
--kind beta-binomial|gamma-poisson|normal-normal|normal-inverse-gamma
(default beta-binomial). Optional --kind-specific flags: --y (default y),
--sigma (normal-normal; required), --exposure (gamma-poisson), --mu0,
--kappa0, --alpha0, --beta0 (NIG), --prior-alpha/--prior-beta
(beta-binomial), --prior-shape/--prior-rate (gamma-poisson), --prior-mean/
--prior-sd (normal-normal), --alpha (0.05), --svg.
JSON output: kind, primary_column, n, posterior (family-specific),
summary (mean/median/mode/equal_tailed/hdi/alpha), rope_probability,
predictive.
mcmc¶
--y required; --x comma-separated covariates; --logistic treats y as 0/1;
--chains (4), --warmup (200), --draws (200), --seed (12345), --svg.
ab¶
--group and --value required; --ab-kind normal|binomial (default normal);
--n-draws (1000), --seed (12345), --prior-mean/--prior-sd (normal),
--prior-alpha/--prior-beta (binomial), --svg. JSON output: ab_kind,
n_draws, variants, posterior_mean, posterior_sd, p_best,
p_beats_control, expected_relative_uplift, relative_uplift_hdi95,
expected_loss.
leap bayes data.csv --mode conjugate --kind beta-binomial --y y --svg y.svg
leap bayes data.csv --mode mcmc --y y --x x1,x2 --chains 4 --warmup 200 --draws 200 --seed 12345
leap bayes data.csv --mode ab --group variant --value value --ab-kind normal --prior-mean 0 --prior-sd 1 --n-draws 1000
leap plugin <root> <list|trust|revoke|run>¶
<root> is the plugin registry root (a plugin.json file or a directory of
plugin roots). All plugin commands refuse unsafe operations unless the plugin
is explicitly trusted (see Architecture & Offline Security).
plugin list— JSON summary:mode,action,root,plugins(id, name, version, command, capabilities, timeout_ms, max_output_bytes, sha256, trust_state),count.plugin trust <plugin-id>— persists trust intrust.json(trusted_pinned).plugin revoke <plugin-id> [--sha256 <hash>]— removes trust (untrusted);--sha256revokes only that exact hash.plugin run <plugin-id> [--params <json>] [--data <csv>] [--svg <file>]— runs a trusted (TrustedPinned) plugin; refuses otherwise.--paramsis a JSON string merged into the request params;--datasends a CSV as the plugin's table;--svgplots the first numeric table column.
leap plugin ./plugins list
leap plugin ./plugins trust my.demo
leap plugin ./plugins run my.demo --params '{"k":2}' --data data.csv