CLIKontract

How to

Activate guidance

Prepare workspace guidance before spec or contract work.

What changes

kontract init activates local AI guidance and writes the initial contract design profile in sumr.yaml. The profile guides examples for API schema, async schema, and schema layout; it does not change generation or app architecture.

When this helps

  • A repo is starting to use Kontract.
  • AI guidance for contract work is missing or stale.
  • You need a precise setup URL for contract authors.

Run this command

terminal
sumr kontract init# activate guidancesumr kontract init --api-style json-api --async-style cloud-events --schema-layout-style by-api-surface# choose profile axessumr kontract init --json# automation output

Flags you can use

--api-style <style>

Set API schema example style: pragmatic-rest, resource-oriented, json-api, odata, rpc-action, graphql-http, hypermedia-rest, webhook-callback, or mixed.

--async-style <style>

Set async schema example style: command-event, event-driven, request-reply, cloud-events, or mixed.

--schema-layout-style <style>

Set schema layout example style: by-product-capability, by-api-surface, by-service-owner, by-resource-area, by-workflow, by-message-family, or mixed.

--json

Output a machine-readable JSON envelope.

--quiet

Suppress all output except errors.

--help, -h

Show the command syntax, supported flags, and examples without changing files.

Keep in mind

  • This is setup for contract authoring discipline; it does not generate artifacts.
  • Setup also adds VS Code Material Icon associations for *.api.yml, *.api.yaml, *.async.yml, and *.async.yaml source files.
  • Existing profile values stay unchanged unless a flag or interactive choice updates them.
  • Use sumr kontract config to view or update the profile later without hand-editing YAML.
  • After setup, validate specs before generating outputs.