lgp-cli
Command-line interface for running Linear Genetic Programming experiments.
Overview
lgp-cli provides the lgp binary for running LGP experiments using TOML-based configuration files. It supports listing available experiments, running them with config overrides, hyperparameter search, result analysis, and end-to-end experiment pipelines.
Installation
Or build from source:
# With plot support (PNG chart generation)
Usage
# List available experiments
# Run an experiment with default config
# Run with optimal config (after hyperparameter search)
# Run with parameter overrides
# Preview resolved config without running
# Search hyperparameters
# Analyze experiment results
# Run full pipeline (search -> run -> analyze)
# Run a Rust API example
# List available examples
Global Options
| Flag | Description |
|---|---|
-v, --verbose |
Enable debug-level logging |
--log-format <FORMAT> |
Log output format: pretty (default), compact, json |
--log-file <PATH> |
Write logs to a file instead of stdout |
Commands
lgp list
Lists all available experiments discovered from the configs/ directory.
lgp run <EXPERIMENT>
Runs an experiment by name. Configuration is loaded from configs/<experiment>/default.toml (or optimal.toml with --config optimal).
| Option | Description |
|---|---|
--config <NAME> |
Config variant to use (default or optimal) |
--override <KEY=VALUE> |
Override a config parameter (repeatable) |
--dry-run |
Print resolved config and exit |
lgp search [CONFIG]
Search for optimal hyperparameters. If no config is specified, searches all configs.
| Option | Description |
|---|---|
--n-trials <N> |
Number of trials (default: 40) |
--n-threads <N> |
Parallel threads (default: 4) |
--median-trials <N> |
Runs for median (default: 10) |
lgp analyze
Generate statistics tables (CSV) and optional plots (PNG) from experiment results.
| Option | Description |
|---|---|
--input <DIR> |
Input directory (default: outputs) |
--output <DIR> |
Output directory (default: outputs) |
lgp experiment [CONFIG]
Run end-to-end pipeline: search -> run -> analyze.
| Option | Description |
|---|---|
--iterations <N> |
Number of experiment iterations (default: 10) |
--skip-search |
Skip hyperparameter search phase |
--skip-analyze |
Skip analysis phase |
--n-trials <N> |
Search trials (default: 40) |
--n-threads <N> |
Search threads (default: 4) |
--median-trials <N> |
Runs for median (default: 10) |
lgp example <NAME>
Runs a Rust API example from the examples/ directory.
| Option | Description |
|---|---|
--list |
List available examples |
Available Experiments
| Experiment | Description |
|---|---|
iris_baseline |
Iris baseline (no mutation, no crossover) |
iris_mutation |
Iris with mutation only |
iris_crossover |
Iris with crossover only |
iris_full |
Iris full (mutation + crossover) |
cart_pole_lgp |
CartPole with pure LGP |
cart_pole_with_q |
CartPole with Q-Learning |
mountain_car_lgp |
MountainCar with pure LGP |
mountain_car_with_q |
MountainCar with Q-Learning |
Logging
The CLI integrates with the tracing ecosystem. Control log levels via RUST_LOG:
# Debug level for all LGP modules
RUST_LOG=lgp=debug
# JSON output for log aggregation