A command-oriented reference for developers and contributors. The installed CLI remains authoritative; use koss <command> --help for the exact interface in your version.
Install from PyPI, then check the CLI with koss --help.
pip install kostral
# or keep it isolated from your project environments:
pipx install kostralkoss <command> [arguments] [options]
koss --help
koss <command> --help| Command | Purpose | Example |
|---|---|---|
koss explain | Analyze a Kubernetes manifest with Validator and Security. | koss explain ./app.yaml |
koss optimize | Optimize the input state, then analyze the resulting state. | koss optimize ./app.yaml |
koss remote | Run a user-defined workflow whose engines can be invoked through remote HTTP clients (experimental). | koss remote ./app.yaml --exec ./workflow.py |
koss run | Run a Kostral workflow from a Python DSL input. | koss run ./examples/dsl/app.py |
koss generate | Provide deployment input through CLI parameters. | koss generate --name backend --cpu 500m --memory 512Mi --image nginx:1.27 --target local |
Use this when you want analysis only, without running the Optimizer.
koss explain ./examples/demo/bad.yaml
koss explain ./examples/demo/bad.yaml --output=json
koss explain ./examples/demo/bad.yaml --output=yaml
koss explain ./examples/demo/bad.yaml --output=yaml --verboseUse this when you want the optimization workflow followed by the relevant analysis.
koss optimize ./examples/demo/bad.yaml
koss optimize ./examples/demo/bad.yaml --output=json
koss optimize ./examples/demo/bad.yaml --output=yaml
koss optimize ./examples/demo/bad.yaml --output=yaml --verbose
koss optimize ./examples/demo/bad.yaml --dry-runRun a user-defined workflow whose engines are invoked through remote HTTP clients. Start the three engine servers first, each in its own terminal and from the repository root.
python examples/remote/optimizer_server.py # http://127.0.0.1:9001/process python examples/remote/validator_server.py # http://127.0.0.1:9002/process python examples/remote/security_server.py # http://127.0.0.1:9003/process
koss remote ./examples/demo/bad.yaml \ --exec ./examples/remote/workflow.py koss remote ./examples/demo/bad.yaml --exec ./examples/remote/workflow.py --output=json koss remote ./examples/demo/bad.yaml --exec ./examples/remote/workflow.py --output=yaml koss remote ./examples/demo/bad.yaml --exec ./examples/remote/workflow.py --verbose
examples/remote/registry.json and local HTTP endpoints. Run from the repository root, because the example workflow opens the registry by relative path. There is no dynamic discovery, authentication, TLS, or parallel remote execution yet. See docs/remote-engines.md.The DSL is entered directly through its Python file.
examples/
└── dsl/
└── app.py
$ koss run ./examples/dsl/app.pyapp.py is the Python DSL entry point for koss run.koss run + examples/dsl/app.pyThe repository includes a Python DSL example that defines a deployment and a PVC.
from kostral.dsl import deployment, pvc
api = deployment(
"nginxdsl-dep",
cpu="80m",
memory="9Mi",
image="nginx:latest",
replicas=2,
ports=[5000],
)
pvc(
name="mongo-dsl-pvc",
storage="5Gi",
storage_class="standard",
)koss run ./examples/dsl/app.py
koss run is documented for the DSL path but is not the primary CLI workflow.Use CLI parameters to provide deployment input to Kostral.
koss generate \
--name backend \
--cpu 500m \
--memory 512Mi \
--image nginx:1.27 \
--target local
koss generate is the CLI-based deployment input path and may be reintroduced later.| Option | Use |
|---|---|
--output=json | Machine-readable report/output. |
--output=yaml | YAML manifest output. |
--verbose | Additional reporting/diagnostics. |
When YAML is the selected output, the YAML stream should remain suitable for piping or saving as a manifest. Verbose diagnostics may be separated from that stream by the CLI implementation.
# inspect
koss explain ./app.yaml
# machine-readable report
koss explain ./app.yaml --output=json
# optimize
koss optimize ./app.yaml
# save optimized YAML
koss optimize ./app.yaml --output=yaml > optimized.yaml
# save YAML while requesting verbose diagnostics
koss optimize ./app.yaml --output=yaml --verbose > optimized.yaml
# run a remote-engine workflow (engine servers must be running)
koss remote ./app.yaml --exec ./examples/remote/workflow.py
# inspect command-specific options
koss optimize --helpThe repository version of this page is docs/usage.md. Keep it synchronized with the actual CLI implementation.
koss run is the Python DSL workflow entry point and
koss generate is the CLI-based deployment input path. Both are currently
on hold and may be reintroduced later.