https://github.com/ohayocorp/anemos
A powerful, open-source, single binary CLI tool that allows managing Kubernetes manifests using JavaScript and TypeScript.
https://github.com/ohayocorp/anemos
javascript kubernetes manifest package-manager typescript yaml
Last synced: about 1 month ago
JSON representation
A powerful, open-source, single binary CLI tool that allows managing Kubernetes manifests using JavaScript and TypeScript.
- Host: GitHub
- URL: https://github.com/ohayocorp/anemos
- Owner: ohayocorp
- License: apache-2.0
- Created: 2025-07-17T08:34:11.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2025-09-01T18:00:47.000Z (about 1 month ago)
- Last Synced: 2025-09-01T20:20:19.220Z (about 1 month ago)
- Topics: javascript, kubernetes, manifest, package-manager, typescript, yaml
- Language: Go
- Homepage: https://anemos.sh
- Size: 2.12 MB
- Stars: 32
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Notice: NOTICE
Awesome Lists containing this project
README
# Anemos
Anemos is a single-binary CLI tool written in Go and designed to simplify the management of Kubernetes manifests. It
bundles [Goja](https://github.com/dop251/goja) JavaScript runtime and lets you define your
manifests using JavaScript and TypeScript, enabling you to leverage the full power of the language to generate
and manipulate Kubernetes YAML manifests.Anemos uses JavaScript package management system. You can distribute your libraries as npm packages,
use other Anemos packages, or any other JavaScript library, and take advantage of the vast ecosystem of tools
available in the JavaScript community.Anemos provides you an SDK for both template based and programmatic generation of Kubernetes manifests.
JavaScript's template literals allow you to write clean and readable templates and libraries such as
[kubernetes-models](https://www.npmjs.com/package/kubernetes-models) provide type safety and better
IDE experience. You can also mix and match templates and programmatic generation, use the best approach
for each part of your manifest.Anemos also supports node based modification of YAML manifests. This powerful feature enables you
to modify any YAML manifest without waiting for the package maintainers to add support for your use case
or fix a bug in the package. It also allows you to modify manifests in bulk, making it easy to
apply changes across multiple manifests.## Installation
Anemos is a single binary that can be downloaded from the [GitHub releases page](https://github.com/ohayocorp/anemos/releases).
Get the latest version and place it in your PATH and you are ready to go.## Docs
You can visit [documentation](https://anemos.sh/docs) for more information on how to use Anemos,
including examples, tutorials, and API references.## Quick Start
Simplest way to get started with Anemos is to create an `index.js` file and run it with
`anemos build index.js`:```javascript
const anemos = require("@ohayocorp/anemos");
const helloWorld = require("https://anemos.sh/examples/hello-world.js");const builder = new anemos.Builder("1.31", anemos.KubernetesDistribution.Minikube, anemos.EnvironmentType.Development);
helloWorld.add(builder, {
replicaCount: 2,
});builder.addDocument(
`pod.yaml`,
`
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
`);builder.build();
```This will generate an `output` directory containing the Kubernetes manifests generated by the
package from `https://anemos.sh/examples/hello-world.js` and `pod.yaml` that we defined in the code.### Using Anemos Packages
Following example will use the `@ohayocorp/anemos-hello-world` package to generate a simple deployment:
```javascript
const anemos = require("@ohayocorp/anemos");
const helloWorld = require("@ohayocorp/anemos-hello-world");const builder = new anemos.Builder("1.32", anemos.KubernetesDistribution.Minikube, anemos.EnvironmentType.Development);
helloWorld.add(builder, {
name: "custom-hello-world",
autoScaling: {
minReplicas: 1,
maxReplicas: 3,
},
ingress: {
host: "hello-world.local",
},
});builder.build();
```Run following command to install the package and generate the manifests:
```bash
anemos package add @ohayocorp/anemos-hello-world
anemos build index.js
```It is also possible to use local JavaScript files and URLs for easy sharing. See the [documentation](https://anemos.sh/docs) for more details.
### Applying Manifests
Anemos can apply the generated manifests to a Kubernetes cluster. You can use the `anemos apply ` command
to apply a package directly. This command will compute the diff between the current state of the cluster and the
manifests generated by the package, print the changes, and apply them if you confirm. It can also take a YAML file
as input to override the default values in the package.```bash
anemos apply --yes https://anemos.sh/examples/hello-world.js -f - <` command to build and apply all manifests defined in the JavaScript file:```bash
anemos build --apply index.js
```There are also commands to list the apply sets and delete them:
```bash
anemos apply list
anemos apply delete
```See the [documentation](https://anemos.sh/docs/simple-tutorial/applying-manifests/) for more details on how to apply manifests.
## Contributing
We welcome contributions to Anemos! If you have an idea for a new feature, a bug fix, or an improvement, please
open an issue or a pull request on our [GitHub repository](https://github.com/ohayocorp/anemos).To build Anemos from source, clone the repository and run the following commands:
```bash
./download-bun.sh
go build ./cmd/anemos
```