gitops-ai 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +155 -0
  2. package/dist/commands/bootstrap.d.ts +2 -0
  3. package/dist/commands/bootstrap.js +721 -0
  4. package/dist/commands/bootstrap.js.map +1 -0
  5. package/dist/commands/sops.d.ts +1 -0
  6. package/dist/commands/sops.js +300 -0
  7. package/dist/commands/sops.js.map +1 -0
  8. package/dist/core/bootstrap-runner.d.ts +13 -0
  9. package/dist/core/bootstrap-runner.js +194 -0
  10. package/dist/core/bootstrap-runner.js.map +1 -0
  11. package/dist/core/dependencies.d.ts +3 -0
  12. package/dist/core/dependencies.js +134 -0
  13. package/dist/core/dependencies.js.map +1 -0
  14. package/dist/core/encryption.d.ts +25 -0
  15. package/dist/core/encryption.js +209 -0
  16. package/dist/core/encryption.js.map +1 -0
  17. package/dist/core/flux.d.ts +6 -0
  18. package/dist/core/flux.js +60 -0
  19. package/dist/core/flux.js.map +1 -0
  20. package/dist/core/gitlab.d.ts +10 -0
  21. package/dist/core/gitlab.js +65 -0
  22. package/dist/core/gitlab.js.map +1 -0
  23. package/dist/core/kubernetes.d.ts +10 -0
  24. package/dist/core/kubernetes.js +81 -0
  25. package/dist/core/kubernetes.js.map +1 -0
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.js +49 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/schemas.d.ts +50 -0
  30. package/dist/schemas.js +56 -0
  31. package/dist/schemas.js.map +1 -0
  32. package/dist/utils/config.d.ts +3 -0
  33. package/dist/utils/config.js +26 -0
  34. package/dist/utils/config.js.map +1 -0
  35. package/dist/utils/log.d.ts +31 -0
  36. package/dist/utils/log.js +96 -0
  37. package/dist/utils/log.js.map +1 -0
  38. package/dist/utils/platform.d.ts +7 -0
  39. package/dist/utils/platform.js +21 -0
  40. package/dist/utils/platform.js.map +1 -0
  41. package/dist/utils/shell.d.ts +41 -0
  42. package/dist/utils/shell.js +86 -0
  43. package/dist/utils/shell.js.map +1 -0
  44. package/dist/utils/wizard.d.ts +16 -0
  45. package/dist/utils/wizard.js +117 -0
  46. package/dist/utils/wizard.js.map +1 -0
  47. package/package.json +32 -0
package/README.md ADDED
@@ -0,0 +1,155 @@
1
+ # GitOps AI Bootstrapper
2
+
3
+ GitOps-managed Kubernetes infrastructure for AI-powered applications powered by the [Flux Operator](https://fluxoperator.dev/) and [Flux CD](https://fluxcd.io/). A single bootstrap script provisions a Kubernetes cluster, installs all infrastructure components, and enables continuous delivery from Git.
4
+
5
+ ## Why GitOps for your infrastructure
6
+
7
+ **💾 Infrastructure as Code** -- your entire cluster is defined in Git. Every change is versioned, reviewable, and reversible. You can modify infrastructure with AI coding assistants (Cursor, Copilot, Claude) that understand YAML and Helm values -- describe what you want in natural language and commit the result.
8
+
9
+ **Security by default** -- containers run as non-root with read-only filesystems and dropped capabilities. Network policies isolate workloads so pods can only communicate with explicitly allowed services. Secrets are encrypted at rest with SOPS/Age before they ever reach Git. SSL certificates are automatically managed by cert-manager.
10
+
11
+ **Reproducible deployments** -- the same bootstrap script produces an identical cluster every time, on any supported machine. Drift is automatically corrected by Flux reconciliation -- if someone manually changes a resource, Flux reverts it to match Git within minutes.
12
+
13
+ **Scalable and flexible** -- powered by Kubernetes, you can add worker nodes to grow capacity or drop in new components like Lego blocks. Need a database, a message queue, or another AI model? Add a HelmRelease to the repo and push -- Flux deploys it automatically.
14
+
15
+ ## Quick Start
16
+
17
+ Run on our macOS machine:
18
+ ```bash
19
+ npx gitops-ai bootstrap
20
+ ```
21
+
22
+ Or SSH into your server (or run locally on macOS) and run:
23
+
24
+ ```bash
25
+ curl -sfL https://raw.githubusercontent.com/your-org/gitops-ai/main/install.sh | bash
26
+ ```
27
+
28
+ Or, if you already have Node.js >= 18:
29
+
30
+ ```bash
31
+ npx gitops-ai bootstrap
32
+ ```
33
+
34
+ The interactive wizard will prompt for your GitLab PAT, fork the template into your namespace, and run the full bootstrap.
35
+
36
+ ## Requirements
37
+
38
+ | Resource | Minimum |
39
+ |----------------|------------------------|
40
+ | **CPU** | 2+ cores |
41
+ | **Memory** | 4+ GB |
42
+ | **Disk** | 20+ GB free |
43
+ | **OS** | Ubuntu 25.04+ or macOS |
44
+ | **Node.js** | 18+ (installed automatically by `install.sh`) |
45
+
46
+ You will also need a [GitLab PAT](docs/prerequisites.md#1-gitlab-personal-access-token), a [Cloudflare API Token](docs/prerequisites.md#2-cloudflare-api-token) (if using automatic DNS/TLS), and an [OpenAI API Key](docs/prerequisites.md#3-openai-api-key) (if using OpenClaw). See [Prerequisites](docs/prerequisites.md) for full details.
47
+
48
+ ### Docker runtime (macOS only)
49
+
50
+ macOS requires a Docker-compatible runtime for k3d. Install one of:
51
+
52
+ - [Docker Desktop](https://www.docker.com/products/docker-desktop/)
53
+ - [OrbStack](https://orbstack.dev/)
54
+ - [Colima](https://github.com/abiosoft/colima)
55
+
56
+ On Linux the bootstrap installs k3s directly -- no Docker required.
57
+
58
+ ## Template Repository
59
+
60
+ This CLI bootstraps clusters from the [GitOps AI Template](https://gitlab.com/everythings-gonna-be-alright/gitops_ai_template) -- a ready-made GitOps repository structure that Flux uses as the single source of truth for your cluster.
61
+
62
+ The template contains the declarative Kubernetes manifests, HelmRelease definitions, Kustomization overlays, and SOPS encryption configuration that define a complete infrastructure stack. When you run `npx gitops-ai bootstrap`, the CLI forks this template into your GitLab namespace, customises it with your cluster variables (domain, tokens, component selections), and points Flux at the resulting repository. From that moment on, every `git push` to the repo triggers Flux reconciliation -- your cluster converges to match whatever is declared in Git.
63
+
64
+ Keeping the template in a separate repository means:
65
+
66
+ - **Upstream updates** -- pull improvements, new components, and security patches from the upstream template without disrupting your running cluster.
67
+ - **Clean separation** -- the bootstrapper CLI handles provisioning logic; the template holds pure infrastructure declarations. Each can be versioned and tested independently.
68
+ - **Customisation without lock-in** -- after the fork you own the repo. Add namespaces, swap Helm charts, or restructure directories to fit your needs.
69
+
70
+ ## CLI Commands
71
+
72
+ The CLI provides three commands:
73
+
74
+ ### `bootstrap` (alias: `install`)
75
+
76
+ Interactive wizard that provisions a complete Kubernetes cluster with Flux GitOps. Walks through repository setup, component selection, cluster creation, SOPS encryption, and Flux reconciliation.
77
+
78
+ ```bash
79
+ npx gitops-ai bootstrap
80
+ ```
81
+
82
+ See [Bootstrap](docs/bootstrap.md) for a detailed walkthrough.
83
+
84
+ ### `sops [subcommand] [file]`
85
+
86
+ SOPS secret encryption management. Run without arguments for an interactive menu, or specify a subcommand directly:
87
+
88
+ ```bash
89
+ npx gitops-ai sops [subcommand] [file]
90
+ ```
91
+
92
+ | Subcommand | Description |
93
+ |------------------|----------------------------------------------------------|
94
+ | `init` | First-time setup: generate age key, create `.sops.yaml` and K8s secret |
95
+ | `encrypt` | Encrypt all unencrypted secret files |
96
+ | `encrypt <file>` | Encrypt a specific file |
97
+ | `decrypt <file>` | Decrypt a file for viewing (re-encrypt before commit) |
98
+ | `edit <file>` | Open encrypted file in `$EDITOR` (auto re-encrypts on save) |
99
+ | `status` | Show encryption status of all secret files |
100
+ | `import` | Import an existing age key into a new cluster |
101
+ | `rotate` | Rotate to a new age key and re-encrypt everything |
102
+
103
+ ### `openclaw-pair`
104
+
105
+ Pair an OpenClaw device with the cluster after bootstrap:
106
+
107
+ ```bash
108
+ npx gitops-ai openclaw-pair
109
+ ```
110
+
111
+ ## Components
112
+
113
+ The bootstrap wizard lets you select which components to install:
114
+
115
+ | Component | Required | Description |
116
+ |-----------------------------|----------|----------------------------------------------|
117
+ | Helm Repositories | Yes | Shared Helm chart repos |
118
+ | Ingress Nginx (external) | Yes | External HTTP/HTTPS ingress controller |
119
+ | Prometheus CRDs | Yes | Monitoring custom resource definitions |
120
+ | Cert Manager | DNS/TLS | Automatic TLS certificates via Let's Encrypt |
121
+ | External DNS | DNS/TLS | Automatic DNS records in Cloudflare |
122
+ | Flux Web UI | No | Web dashboard for Flux status |
123
+ | OpenClaw | No | AI assistant gateway (requires OpenAI key) |
124
+
125
+ Components marked **DNS/TLS** are automatically enabled when you opt into automatic DNS and TLS management during the wizard.
126
+
127
+ ## Documentation
128
+
129
+ | Document | Description |
130
+ |----------|-------------|
131
+ | [Prerequisites](docs/prerequisites.md) | API tokens, Docker runtime, network requirements |
132
+ | [Bootstrap](docs/bootstrap.md) | What the bootstrap does, wizard walkthrough, resume capability |
133
+ | [Architecture](docs/architecture.md) | Repository structure, Flux Operator, GitOps workflow |
134
+ | [Configuration](docs/configuration.md) | Cluster variables, environment variables, post-bootstrap changes |
135
+
136
+ ## Development
137
+
138
+ ```bash
139
+ git clone <repo-url> && cd gitops-ai
140
+ npm install
141
+
142
+ npm run dev # Run CLI locally via tsx
143
+ npm run build # Compile TypeScript to dist/
144
+ npm run typecheck # Type-check without emitting
145
+ npm run test:validate # Validate Flux build against template
146
+ npm run test:integration # Full k3d + Flux integration test (requires Docker)
147
+ ```
148
+
149
+ ## Contributing
150
+
151
+ Contributions are welcome! Please feel free to submit a Pull Request.
152
+
153
+ ## License
154
+
155
+ This project is licensed under the MIT License - see the LICENSE file for details.
@@ -0,0 +1,2 @@
1
+ export declare function openclawPair(): Promise<void>;
2
+ export declare function bootstrap(): Promise<void>;