v1.0.2

CLI Reference

Kafal includes a command-line tool (kafal) to execute scripts, validate syntax, generate templates, and run system diagnostics.

kafal run

Runs a .kf script against OHLCV data provided in CSV or Parquet format. If no data file is supplied, the CLI uses a synthetic sample dataset.

# Execute a script against CSV market data
kafal run strategy.kf --data data/aapl.csv --mode strategy

# Execute in research mode to print extracted factors
kafal run factors.kf --data data/spy.parquet --mode research

kafal check

Parses and validates a script against AST sandbox constraints without printing backtest or execution statistics. Use this command to catch syntax errors or invalid function calls.

# Validate script syntax and AST sandbox constraints
kafal check my_script.kf

kafal new

Generates a starter .kf file prepopulated with a standard moving average crossover template. Use --force to overwrite existing files.

# Create a new script template
kafal new my_strategy --force

kafal doctor

Checks environment configuration, verifying Python version compatibility and dependencies (pandas, numpy, kafal.core).

# Run self-diagnostics
kafal doctor