Skip to content

babyctl

If Terraform and kubectl had a baby, it would feel a lot like babyctl.

Active development

babyctl is rapidly evolving. Expect dragons, gremlins, and fast-moving feature work while the core experience stabilises.

babyctl lets you interact with any infrastructure that Terraform can describe while keeping the ergonomics of kubectl. The goal is to provide kubectl-style workflows—get, apply, edit, diff, and more—without depending on a running Kubernetes cluster.

Why babyctl?

  • Zero-import applies – point babyctl apply at pre-existing infrastructure to bring it under control without painful Terraform imports.
  • Unified discoverybabyctl api-resources merges Kubernetes and Terraformer API discovery into one familiar list.
  • Multi-format fluency – switch between YAML, HCL, and JSON with a single flag when you need the view that makes sense.
  • Crisis-friendly editingbabyctl edit opens live infrastructure in your editor so you can perform surgical changes just like you would with kubectl (starting with the bundled Widget sample).
  • Kubernetes ecosystem compatible – pipe the output of tools such as Kustomize straight into babyctl to reuse all of your favourite config machinery.

Key use cases

  1. Bring click-ops infrastructure under control
  2. Inspect resources with babyctl get.
  3. Run babyctl apply -f existing.yaml to adopt them without juggling Terraform state imports.
  4. Leverage Kubernetes tooling for Terraform resources
  5. kustomize build overlays/prod | babyctl apply -f - works against anything Terraformer can reach.
  6. Emergency edits
  7. When production is on fire, open the resource directly via babyctl edit and keep the lights on. The first implementation targets the bundled babyctl.dev/v1alpha1 Widget resource when using the local API definitions; more resources will follow.
  8. Format conversion
  9. Convert back and forth with babyctl convert -f terraform.tf -oyaml or -ohcl.

Quick start

# Install babyctl
make install

# Discover available resources from kubectl and Terraformer
babyctl api-resources

# Apply configuration from stdin
kustomize build overlays/dev | babyctl apply -f-

# Convert Terraform to YAML
babyctl convert -f terraform.tf -oyaml

See the Getting Started guide for detailed setup steps.

Supported commands

Command Description
api-resources List API resources available via kubectl and Terraformer
api-server Run a Kubernetes-compatible discovery server backed by babyctl definitions
api-versions Show supported API versions
apply Apply a declarative configuration to a live resource
convert Translate files between HCL, YAML, and JSON
delete Delete live resources
diff Compare live resources against would-be applies
edit Open a resource in $EDITOR and persist edits live
explain Display documentation about a resource
get Retrieve one or many resources
version Print client and server versions

For full flag details see the CLI reference.

Release automation

babyctl uses GitHub Actions and release-please to cut releases automatically. Follow Conventional Commits so release-please can determine semantic versions and changelog entries. See the contributing guide for details.

Learn more