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 |
|
Show what |
for a component |
no |
|
Replace kikx with the latest release |
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
diff Show what add or apply would change in the project, without writing
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 |
A field with a format has an invalid value |
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>, format <format>, 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/lb-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/lb-hetzner.tf
...
Example, adding a template to an existing repo:
kikx apply k8s-web-app --into deploy/k8s
kikx diff¶
kikx diff [OPTIONS] <REFERENCE>
Renders like add or apply and compares the result with the files on disk. Nothing is written. Use it to preview an upgrade or a field change before passing --force.
With --name, <REFERENCE> is a component and accepts the same field and label options as add; files are compared under the output directory from kikx.toml. Without --name, <REFERENCE> is a preset and files are compared under the current directory, or --into.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
none |
Component name. Field and label options require it |
|
path |
current directory |
Preset only: directory to compare against |
Each rendered file is reported as Added (not on disk yet), Modified (followed by a unified diff from the file on disk to the new render) or Unchanged, then a summary line. Path checks are those of the write rules.
Example:
kikx diff k8s/deployment --name web --image nginx:1.28
Modified infra/web-deployment.yaml
@@ -19,6 +19,6 @@
spec:
containers:
- name: web
- image: nginx:1.27
+ image: nginx:1.28
ports:
- containerPort: 80
0 added, 1 modified, 0 unchanged. Nothing was written.
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.
kikx upgrade¶
kikx upgrade [OPTIONS]
Downloads the release for this system from the project’s GitHub releases and replaces the running kikx binary. Does not need kikx.toml.
Option |
Type |
Default |
Effect |
|---|---|---|---|
|
flag |
off |
Only report whether a newer release exists |
|
version |
latest |
Install this release instead, for example |
Upgrading kikx 0.2.0 to 0.3.0
Extracting archive... Done
Replacing binary file... Done
kikx is now 0.3.0.
When no newer release exists it prints kikx <version> is the latest version. Releases are published for macOS arm64 and x64, Linux x64 and arm64, and Windows x64; on other systems it stops with no kikx release is published for this platform. If the binary sits in a directory you cannot write to, such as /usr/local/bin, run it with sudo.