CLI Reference — KOSTRAL
KOSTRAL CLI

Run the workflow. Inspect what each engine did.

The CLI is the practical entry point to KOSTRAL today: analyze Kubernetes manifests, run the optimization workflow, and experiment with local/remote engine composition.

Use koss --help and koss <command> --help for the exact interface in your installed version.

Install from the repository

Follow the repository's current installation instructions.

terminal
git clone https://github.com/ClariOps/trl.git
cd trl
pip install -e .
koss --help
Primary workflows

Two ways to work with Kubernetes input.

CommandPurposeExample
koss explainRun analysis without invoking the Optimizer.koss explain ./app.yaml
koss optimizeRun the Optimizer, then validate and assess the resulting state.koss optimize ./app.yaml --dry-run
koss remoteRun a user-defined workflow that can invoke remote engines. Experimental.koss remote ./app.yaml --exec ./workflow.py
Analyze

Inspect without optimization.

Use explain when you want Validator and Security findings without running the Optimizer.

terminal
koss explain ./examples/demo/bad.yaml

# JSON for automation
koss explain ./examples/demo/bad.yaml \
  --output=json
Optimize

Prepare, then inspect.

Use optimize to run the Optimizer before the read-only checks. Use dry-run while reviewing the result.

terminal
koss optimize ./examples/demo/bad.yaml \
  --dry-run

# Machine-readable report
koss optimize ./examples/demo/bad.yaml \
  --dry-run --output=json
Engine composition

Try the remote-engine demonstration.

The example shows that a workflow can invoke separate HTTP engine processes while retaining the same engine responsibilities.

Experimental: This is a development demonstration, not a production-ready distributed execution platform. It uses a static registry and local HTTP endpoints. Review the remote-engine guide for the exact requirements and limitations.
Start the remote engine processes in separate terminals
python examples/remote/optimizer_server.py
python examples/remote/validator_server.py
python examples/remote/security_server.py
Run the workflow from the repository root
koss remote ./examples/demo/bad.yaml \
  --exec ./examples/remote/workflow.py

The current example uses a static examples/remote/registry.json. It does not provide automatic engine discovery, uploads, a hosted registry, or production isolation.

Read the remote engine guide →

Output formats

Choose output for the consumer of the workflow.

OptionUse
--output=jsonStructured output for CI/CD and automation.
--output=yamlManifest output representing the resulting Kubernetes configuration.
--verboseAdditional diagnostics and execution details, where supported by the command.
--dry-runReview the result without invoking an execution target.
The complete command reference lives in docs/usage.md. Check it alongside koss --help because command availability and options may evolve.