kubeagent 0.1.0 → 0.1.2

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.
package/README.md CHANGED
@@ -1,69 +1,40 @@
1
1
  # KubeAgent
2
2
 
3
- AI-powered Kubernetes monitoring, diagnosis, and remediation CLI. Uses Claude to investigate cluster issues, determine root causes, and apply fixes — with human approval for risky actions.
3
+ AI-powered Kubernetes monitoring and auto-remediation CLI. Detects cluster issues, investigates root causes, and applies fixes — with human approval for risky actions.
4
4
 
5
5
  Built for solo DevOps engineers and small teams who want an intelligent on-call assistant.
6
6
 
7
- ## How It Works
8
-
9
- ```
10
- Monitor (kubectl polling) --> Diagnoser (Claude API) --> Verifier (re-check)
11
- ```
12
-
13
- 1. **Monitor** polls your cluster for issues (CrashLoopBackOff, OOM, ImagePullBackOff, node pressure, etc.) — no LLM involved.
14
- 2. **Diagnoser** sends issues to Claude with your cluster's knowledge base as context. Claude investigates using kubectl tools (logs, describe, events) in an agentic loop.
15
- 3. **Verifier** re-checks the cluster after a fix to confirm the issue is resolved.
16
-
17
- Safe actions (pod restart, rollout restart, scale up) are auto-applied. Risky actions (rollback, delete, scale to zero) require your approval.
18
-
19
7
  ## Quick Start
20
8
 
21
9
  ```bash
22
- # Install dependencies
23
- npm install
10
+ # Install
11
+ npm install -g kubeagent
24
12
 
25
- # Set your API key
26
- export ANTHROPIC_API_KEY=sk-...
13
+ # Log in (creates your account / links your cluster)
14
+ kubeagent login
27
15
 
28
- # Check cluster health (no LLM)
29
- npx tsx src/cli.ts status
30
-
31
- # Onboard — scan cluster, detect tech stacks, build knowledge base
32
- npx tsx src/cli.ts onboard
16
+ # Onboard — scan cluster, detect your services, build knowledge base
17
+ kubeagent onboard
33
18
 
34
19
  # Watch mode — continuous monitoring with auto-remediation
35
- npx tsx src/cli.ts watch
36
-
37
- # One-shot diagnosis of a specific resource
38
- npx tsx src/cli.ts diagnose my-pod -n production
39
-
40
- # Ask a freeform question about your cluster
41
- npx tsx src/cli.ts "why is the retime API returning 503s?"
42
- ```
43
-
44
- ## Install Globally
45
-
46
- ```bash
47
- npm run build
48
- npm link
49
- kubeagent status
20
+ kubeagent watch
50
21
  ```
51
22
 
52
23
  ## Commands
53
24
 
54
- | Command | Description | Uses LLM |
55
- |---------|-------------|----------|
56
- | `status` | Quick cluster health check | No |
57
- | `onboard` | Scan cluster + codebases, interview, generate knowledge base | Yes |
58
- | `watch` | Continuous monitoring with auto-remediation | Yes |
59
- | `diagnose <resource>` | One-shot diagnosis of a pod/deployment/service | Yes |
60
- | `<prompt>` | Freeform question about your cluster | Yes |
25
+ | Command | Description |
26
+ |---------|-------------|
27
+ | `status` | Quick cluster health check |
28
+ | `onboard` | Scan cluster + codebases, generate knowledge base |
29
+ | `watch` | Continuous monitoring with auto-remediation |
30
+ | `diagnose <resource>` | One-shot diagnosis of a pod/deployment/service |
31
+ | `<prompt>` | Ask a freeform question about your cluster |
61
32
 
62
33
  ### Common Options
63
34
 
64
35
  - `-c, --context <name>` — Kubernetes context (defaults to current)
65
36
  - `-n, --namespace <name>` — Namespace (for `diagnose`)
66
- - `-i, --interval <seconds>` — Check interval for `watch` (default: 60)
37
+ - `-i, --interval <seconds>` — Check interval for `watch` (default: 300)
67
38
 
68
39
  ## Knowledge Base
69
40
 
@@ -76,27 +47,24 @@ KubeAgent builds a per-cluster knowledge base at `~/.kubeagent/clusters/<context
76
47
  hetzner-prod/
77
48
  cluster.md # Nodes, namespaces, deployments, services
78
49
  projects/
79
- retime.md # Tech stack, dependencies, notes
80
- dove.md
50
+ api.md # Tech stack, dependencies, notes
81
51
  runbooks/ # Custom runbooks (manually added)
82
52
  incidents/ # Auto-logged incident reports
83
53
  ```
84
54
 
85
- This context is injected into Claude's system prompt during diagnosis, giving it awareness of your specific infrastructure.
86
-
87
55
  ## Action Safety
88
56
 
89
57
  Actions are classified into tiers:
90
58
 
91
59
  | Tier | Actions | Behavior |
92
60
  |------|---------|----------|
93
- | **Safe** | `get_logs`, `describe_resource`, `get_events`, `restart_pod`, `rollout_restart`, `scale_deployment` | Auto-executed |
94
- | **Risky** | `rollback_deployment`, `scale_to_zero`, `delete_resource`, `edit_configmap`, `apply_manifest` | Requires approval |
95
- | **Never** | `delete namespace`, `delete node`, etc. | Refused |
61
+ | **Safe** | get logs, describe, get events, restart pod, rollout restart, scale up | Auto-executed |
62
+ | **Risky** | rollback, scale to zero, delete resource, edit configmap, apply manifest | Requires approval |
63
+ | **Never** | delete namespace, delete node, etc. | Refused |
96
64
 
97
65
  ## Notifications
98
66
 
99
- Configure webhooks in `~/.kubeagent/config.yaml` to get alerts in Slack, Mattermost, or Discord:
67
+ Configure Slack notifications from the dashboard at [app.kubeagent.net](https://app.kubeagent.net), or set up webhooks manually in `~/.kubeagent/config.yaml`:
100
68
 
101
69
  ```yaml
102
70
  webhooks:
@@ -105,50 +73,30 @@ webhooks:
105
73
  severityFilter: critical
106
74
  ```
107
75
 
108
- ## Architecture
109
-
110
- ```
111
- src/
112
- cli.ts # Commander.js CLI entry point
113
- config.ts # YAML config (~/.kubeagent/config.yaml)
114
- kubectl.ts # kubectl exec wrapper
115
- orchestrator.ts # Monitor -> Diagnose -> Verify pipeline
116
- verifier.ts # Post-fix verification
117
- monitor/
118
- types.ts # Issue types (Severity, IssueKind, Issue)
119
- checks.ts # Pod and node issue detection
120
- index.ts # Polling loop
121
- diagnoser/
122
- tools.ts # Zod-defined kubectl tools for Claude
123
- index.ts # Claude API agentic loop
124
- kb/
125
- loader.ts # Read KB into system prompt
126
- writer.ts # Write cluster/project/runbook/incident markdown
127
- notify/
128
- index.ts # Notification dispatcher
129
- webhook.ts # Slack/Mattermost/Discord webhooks
130
- onboard/
131
- cluster-scan.ts # Auto-discover K8s resources
132
- code-scan.ts # Detect tech stack from project files
133
- interview.ts # Claude-generated clarifying questions
134
- index.ts # Full onboarding flow
135
- ```
136
-
137
76
  ## Requirements
138
77
 
139
78
  - Node.js >= 20
140
79
  - `kubectl` configured with cluster access
141
- - `ANTHROPIC_API_KEY` environment variable (for LLM features)
80
+ - A KubeAgent account [sign up at app.kubeagent.net](https://app.kubeagent.net)
81
+
82
+ ## FAQ
142
83
 
143
- ## Development
84
+ **Can I monitor multiple clusters?**
85
+ Yes. Run a separate `kubeagent watch` instance for each cluster, specifying the context with `-c`:
144
86
 
145
87
  ```bash
146
- npm test # Run all tests
147
- npm run test:watch # Watch mode
148
- npm run build # Compile TypeScript
149
- npx tsx src/cli.ts # Run without building
88
+ kubeagent watch -c hetzner-prod
89
+ kubeagent watch -c staging-cluster
150
90
  ```
151
91
 
92
+ Each instance operates independently and reports incidents to the same account.
93
+
94
+ **Does kubeagent modify my cluster without asking?**
95
+ Safe actions (pod restarts, rollout restarts, scaling up) are applied automatically. Anything potentially destructive pauses and waits for your approval.
96
+
97
+ **Where is my API key stored?**
98
+ Credentials are stored locally at `~/.kubeagent/config.yaml` and are never sent anywhere except the KubeAgent API.
99
+
152
100
  ## License
153
101
 
154
- MIT
102
+ Proprietary — see [LICENSE](./LICENSE) for details. Commercial use requires a paid plan at [kubeagent.net](https://kubeagent.net).
package/dist/cli.js CHANGED
@@ -270,7 +270,7 @@ program
270
270
  config.clusters[existingClusterIdx].projects = [...existing, ...newMappings];
271
271
  }
272
272
  else {
273
- config.clusters.push({ context: contextName, interval: 60, codepaths: [], projects: newMappings });
273
+ config.clusters.push({ context: contextName, interval: 300, codepaths: [], projects: newMappings });
274
274
  }
275
275
  saveConfig(config);
276
276
  // Write KB
@@ -310,7 +310,7 @@ export async function onboard() {
310
310
  config.notifications = { ...config.notifications, channels: newChannels };
311
311
  const clusterConfig = {
312
312
  context: contextName,
313
- interval: 60,
313
+ interval: 300,
314
314
  codepaths: codePaths.map((p) => p.path),
315
315
  projects: projectMappings.length > 0 ? projectMappings : undefined,
316
316
  };
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "kubeagent",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "AI-powered Kubernetes management CLI",
5
+ "license": "SEE LICENSE IN LICENSE",
5
6
  "type": "module",
6
7
  "bin": {
7
8
  "kubeagent": "./dist/cli.js"
@@ -21,7 +22,7 @@
21
22
  "node": ">=20"
22
23
  },
23
24
  "dependencies": {
24
- "@anthropic-ai/sdk": "^0.80.0",
25
+ "@anthropic-ai/sdk": "^0.81.0",
25
26
  "chalk": "^5.4.0",
26
27
  "commander": "^13.0.0",
27
28
  "js-yaml": "^4.1.0",