CLI¶
The kikx binary, built from cli/. It reads and writes the filesystem directly and needs no running backend.
kikx <COMMAND>
Command |
Purpose |
Reads |
Writes |
|---|---|---|---|
Create a project |
no |
yes |
|
Render one component into the output directory |
yes |
no |
|
Print the built-in components |
no |
no |
|
Print the built-in preset templates |
no |
no |
|
Create a project from a preset template, file or URL |
no |
yes |
|
Render a preset template, file or URL into an existing directory |
no |
no |
Global options:
Option |
Effect |
|---|---|
|
Print help |
|
Print the version, for example |
All paths are resolved against the current working directory. The CLI reads no environment variables.
kikx --help lists each command with a one-line description:
Vendor real, editable infrastructure files into your project
Usage: kikx <COMMAND>
Commands:
init Create kikx.toml in the current directory
add Render a component and write its files into the project
list List the built-in components with their fields
presets List the built-in preset templates
setup Bootstrap a new project from a preset template, file or URL
apply Vendor a preset template, file or URL into an existing project
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
kikx <COMMAND> --help prints the same description above the command’s usage.
Exit status¶
Status |
Cause |
|---|---|
|
Success |
|
Operation error. The message is printed to stderr as |
|
Argument parsing error, for example a missing required option, a |
kikx init¶
kikx init [OPTIONS]
Writes kikx.toml in the current directory and creates the output directory.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
name of the current directory, or |
Project name, stored as |
|
path |
|
Output directory, stored as |
|
string |
|
Default namespace, stored as |
|
flag |
off |
Overwrite an existing |
Condition |
Result |
|---|---|
|
Exit |
|
|
Output on success:
Initialized kikx project `demo` — vendor components with `kikx add <category>/<component>` (see `kikx list`)
kikx add¶
kikx add [OPTIONS] --name <NAME> <REFERENCE>
Renders one component with the project’s default_namespace and writes its files under the project’s output_dir.
Argument |
Description |
|---|---|
|
Built-in reference ( |
Option |
Type |
Default |
Sets field |
|---|---|---|---|
|
string |
required |
|
|
string |
registry default |
|
|
unsigned 32-bit integer |
registry default |
|
|
integer |
registry default |
|
|
integer |
registry default |
|
|
string |
|
|
|
string |
registry default |
|
|
string |
registry default |
|
|
string |
registry default |
|
|
key/value, repeatable |
|
an entry of |
|
key/value, repeatable |
— |
field |
|
flag |
off |
Overwrite existing files |
Field precedence, highest first: --set, the dedicated option (--image, --port, …), the registry default. A later --set for the same key wins over an earlier one. --label app=<value> replaces the default app label.
The dedicated options set their field on any component. A field the component does not declare is still passed to the template.
Condition |
Result |
|---|---|
No |
Exit |
Unknown reference |
Exit |
Required field missing with no default |
Exit |
Rendered path is absolute |
Exit |
Rendered path leaves the output directory |
Exit |
A target file exists, no |
Exit |
Template error |
Exit |
Output on success, one line per file:
Vendored /home/user/demo/infra/web-deployment.yaml
Example:
kikx add k8s/deployment --name web --image nginx:1.27 --replicas 3 --label tier=frontend --set port=8080
kikx list¶
kikx list
Prints every built-in component with its fields. Takes no options besides --help. Does not need kikx.toml.
Each field line shows, when present: required, default <value> (omitted for an empty default), e.g. <example>, one of <options>.
Available components:
k8s/deployment — Pods running one container image.
--set image=… (required; e.g. nginx:1.27)
--set replicas=… (default 1)
--set port=… (default 80)
The full list is in Components.
kikx presets¶
kikx presets
Prints every built-in preset template with its name, title, component count and description. Takes no options besides --help. Does not need kikx.toml.
Preset templates:
k8s-web-app — Kubernetes web app (7 components)
A web frontend and an API behind ingresses, plus a background worker.
single-server — Single server with Ansible (7 components)
One DigitalOcean droplet, configured by a common role through a site playbook.
kubeadm-cluster — Kubernetes cluster with kubeadm (11 components)
Hetzner servers bootstrapped into a three-node control plane and three workers.
web-and-database — Web servers and a database (13 components)
Existing servers split into a web tier and a PostgreSQL primary with a replica.
multi-tier-platform — Multi-tier platform (35 components)
A storefront platform: edge load balancers, web/app tiers, PostgreSQL primary + replicas, Redis, monitoring and a Kubernetes cluster.
Start one with `kikx setup <name>`, or add it to a project with `kikx apply <name>`.
The name in the first column is what setup and apply accept. The templates are described in Preset format.
kikx setup¶
kikx setup [OPTIONS] <REFERENCE>
Renders every component of a preset into the preset’s output directory, then writes kikx.toml.
Argument |
Description |
|---|---|
|
Template name (see |
Option |
Type |
Default |
Description |
|---|---|---|---|
|
flag |
off |
Overwrite an existing |
Values taken from the preset’s project object:
|
From |
When |
|---|---|---|
|
|
current directory name |
|
|
|
|
|
|
Condition |
Result |
|---|---|
|
Exit |
Reference is not a template name, a URL or an existing file |
Exit |
Preset does not parse |
Exit |
Two components render the same path |
Exit |
A target file exists, no |
Exit |
Output on success:
Initialized kikx project `multi-tier-platform` — wrote 77 file(s) to /home/user/demo/infra
/home/user/demo/infra/edge-hetzner.tf
...
Example, starting from a template:
kikx setup single-server
kikx apply¶
kikx apply [OPTIONS] <REFERENCE>
Renders every component of a preset into the current directory, or into --into. Never reads or writes kikx.toml. The namespace is project.namespace from the preset, else default. The preset’s project.outputDir is not used.
Argument |
Description |
|---|---|
|
Template name, URL or local path to a preset file |
Option |
Type |
Default |
Description |
|---|---|---|---|
|
path |
current directory |
Directory to write into, joined to the current directory |
|
flag |
off |
Overwrite existing files |
Error conditions are those of setup, except the kikx.toml check.
Output on success:
Vendored 77 file(s):
/home/user/repo/vendor/edge-hetzner.tf
...
Example, adding a template to an existing repo:
kikx apply k8s-web-app --into deploy/k8s
Write rules¶
add, setup and apply validate every rendered path before writing any file:
Absolute paths are refused.
A path whose
..components climb above the target directory at any point is refused.Two files with the same path are refused.
Without
--force, any existing target file stops the operation before the first write.
Parent directories are created as needed.