Skip to content

Quick Start

Basic compression

Compress a YAML file with secret redaction and comment stripping:

Terminal window
decoct compress docker-compose.yaml

decoct auto-detects 8 platforms (Docker Compose, Kubernetes, Ansible, cloud-init, Terraform state, GitHub Actions, Traefik, Prometheus) and applies the matching bundled schema automatically.

Pipe from stdin:

Terminal window
cat docker-compose.yaml | decoct compress

See token savings:

Terminal window
decoct compress docker-compose.yaml --stats

Output:

services:
web:
image: nginx:1.25.3
ports:
- "8080:80"
Tokens: 142 → 58 (saved 84, 59.2%)

With platform defaults

Add a schema to strip values matching platform defaults. 25 bundled schemas are available by short name:

Terminal window
decoct compress config.yaml --schema docker-compose
decoct compress deployment.yaml --schema kubernetes
decoct compress playbook.yaml --schema ansible-playbook
decoct compress cloud-init.yaml --schema cloud-init
decoct compress terraform.tfstate --schema terraform-state
decoct compress prometheus.yml --schema prometheus

With design standards

Add assertions to strip conformant values and annotate deviations:

Terminal window
decoct compress config.yaml \
--schema docker-compose \
--assertions assertions/docker-services.yaml

Using a profile

Bundle everything into one file:

Terminal window
decoct compress config.yaml --profile docker-compose

INI and key-value files

decoct handles INI-style files (.ini, .conf, .cfg, .cnf, .properties) with automatic section detection:

Terminal window
decoct compress my.cnf --schema mariadb-mysql --stats

Learn schemas and assertions

Instead of writing schemas by hand, use LLM-assisted generation:

Terminal window
decoct schema learn -e prod-config.yaml -p my-platform -o schema.yaml
decoct assertion learn -s team-standards.md -p docker-compose -o assertions.yaml

Requires pip install decoct[llm] and ANTHROPIC_API_KEY.