Timoni CLI Commands
This document provides a detailed explanation of using the Timoni CLI, including examples of various CLI commands and their usage.
Commands for Building and Applying Modules
timoni build <name> <path/to/module> -n <namespace>
This command builds a module and outputs the generated Kubernetes objects to a file named <name>.yaml
in the current directory. The -n
flag specifies the namespace for the generated objects.
Example:
timoni build my-module ./my-module -n my-namespace
timoni apply <name> <path/to/module> -f <path/to/values.cue> --dry-run --diff
This command applies the module to a Kubernetes cluster using the specified values file. The --dry-run
flag allows you to see what changes would be made without actually applying them, and the --diff
flag shows the differences between the current and desired state of the Kubernetes objects.
Example:
timoni apply my-module ./my-module -f my-values.cue --dry-run --diff
Commands for Vendoring Kubernetes APIs and CRDs
timoni mod vendor k8s --version latest
This command venders the latest version of the Kubernetes APIs and CRDs into the gen
directory of the current module.
Example:
timoni mod vendor k8s --version latest
timoni mod vendor crds -f <path/to/crds.yaml>
This command venders the CRDs defined in the specified file into the gen
directory of the current module.
Example:
timoni mod vendor crds -f ./my-crds.yaml
Commands for Working with Remote Modules
timoni mod push <path/to/module> oci://<module-url> -v <semver>
This command pushes the specified module to the given OCI registry with the specified semantic version.
Example:
timoni mod push ./my-module oci://my-registry.com/my-module -v 1.0.0
timoni mod pull oci://<module-url> -v <semver> -o <path/to/module>
This command pulls the specified module from the given OCI registry with the specified semantic version and saves it to the specified local path.
Example:
timoni mod pull oci://my-registry.com/my-module -v 1.0.0 -o ./my-module
timoni mod list oci://<module-url>
This command lists the available modules in the given OCI registry.
Example:
timoni mod list oci://my-registry.com
Commands for Working with Local Modules
timoni mod init <module-name>
This command initializes a new Timoni module with the specified name.
Example:
timoni mod init my-module
timoni mod lint <path/to/module>
This command lints the specified Timoni module and outputs any errors or warnings.
Example:
timoni mod lint ./my-module
Additional Resources
- Timoni Documentation
- CUE Language Documentation
- Semantic Versioning for Go
- Go Logging Framework
- Open Container Image Distribution System
- Colorful Terminal Output
- Flux CLI Utilities
- State Sync Adapter for Flux
- Google OpenAPI specification parser for Go
- Go container registry library
- Kubernetes API client for Go