{"id":47632868,"url":"https://github.com/yehudacohen/typekro","last_synced_at":"2026-04-05T08:01:14.760Z","repository":{"id":310898922,"uuid":"1034528824","full_name":"yehudacohen/typekro","owner":"yehudacohen","description":"Manage Kubernetes Resources with Complex Dependencies in Typescript","archived":false,"fork":false,"pushed_at":"2026-03-30T23:37:40.000Z","size":4860,"stargazers_count":47,"open_issues_count":10,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-30T23:39:18.229Z","etag":null,"topics":["infrastructure-as-code","kubernetes","typescript"],"latest_commit_sha":null,"homepage":"https://typekro.run/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yehudacohen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-08-08T14:35:10.000Z","updated_at":"2026-03-30T23:36:12.000Z","dependencies_parsed_at":"2025-08-20T23:25:24.723Z","dependency_job_id":"e141280b-f29f-4e6d-8178-3963ab7891fa","html_url":"https://github.com/yehudacohen/typekro","commit_stats":null,"previous_names":["yehudacohen/typekro"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/yehudacohen/typekro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehudacohen%2Ftypekro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehudacohen%2Ftypekro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehudacohen%2Ftypekro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehudacohen%2Ftypekro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yehudacohen","download_url":"https://codeload.github.com/yehudacohen/typekro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehudacohen%2Ftypekro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["infrastructure-as-code","kubernetes","typescript"],"created_at":"2026-04-01T23:51:42.511Z","updated_at":"2026-04-01T23:51:43.170Z","avatar_url":"https://github.com/yehudacohen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeKro\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/public/typekro-logo.svg\" alt=\"TypeKro Logo\" width=\"200\" /\u003e\n  \n  **Write TypeScript. Deploy Kubernetes. Runtime intelligence included.**\n\u003c/div\u003e\n\n[![NPM Version](https://img.shields.io/npm/v/typekro.svg)](https://www.npmjs.com/package/typekro)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![GitHub stars](https://img.shields.io/github/stars/yehudacohen/typekro)](https://github.com/yehudacohen/typekro)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/yehudacohen/typekro/deploy.yml?branch=master)](https://github.com/yehudacohen/typekro/actions)\n\n📚 **[Documentation](https://typekro.run)** • 💬 **[Discord](https://discord.gg/kKNSDDjW)** • 🚀 **[Getting Started](https://typekro.run/guide/getting-started)**\n\n---\n\n## What is TypeKro?\n\nTypeKro is a TypeScript-first framework for orchestrating Kubernetes resources with type safety and runtime intelligence. Write infrastructure in pure TypeScript with full IDE support, then deploy directly to clusters or generate deterministic YAML for GitOps workflows.\n\n## Quick Start\n\n```bash\nbun add typekro arktype\n```\n\n```typescript\nimport { type } from 'arktype';\nimport { kubernetesComposition } from 'typekro';\nimport { Deployment, Service } from 'typekro/simple';\n\n// Define a reusable WebApp composition\nconst WebApp = kubernetesComposition({\n  name: 'webapp',\n  apiVersion: 'example.com/v1',\n  kind: 'WebApp',\n  spec: type({ name: 'string', image: 'string', replicas: 'number' }),\n  status: type({ ready: 'boolean', endpoint: 'string' })\n}, (spec) =\u003e {\n  const deploy = Deployment({ id: 'app', name: spec.name, image: spec.image, replicas: spec.replicas });\n  const svc = Service({ id: 'svc', name: `${spec.name}-svc`, selector: { app: spec.name }, ports: [{ port: 80 }] });\n\n  return {\n    ready: deploy.status.readyReplicas \u003e 0,     // ✨ JavaScript → CEL\n    endpoint: `http://${svc.status.clusterIP}`  // ✨ Template → CEL\n  };\n});\n\n// Deploy multiple instances with a simple loop\nconst apps = [\n  { name: 'frontend', image: 'nginx', replicas: 3 },\n  { name: 'api', image: 'node:20', replicas: 2 }\n];\n\nconst factory = WebApp.factory('direct', { namespace: 'production' });\nfor (const app of apps) await factory.deploy(app);\n```\n\n**What this demonstrates:**\n- **Reusable compositions** - Define once, deploy many times\n- **Type-safe schemas** - ArkType validates at compile-time and runtime\n- **Cross-resource references** - `svc.status.clusterIP` references live cluster state\n- **JavaScript-to-CEL** - Status expressions become runtime CEL\n- **Native loops** - Just `for...of` to deploy multiple apps\n\n## Why TypeKro?\n\n| Feature | TypeKro | Pulumi | CDK8s | Helm |\n|---------|---------|--------|-------|------|\n| **Type Safety** | ✅ Full TypeScript | ✅ Multi-lang | ✅ TypeScript | ❌ Templates |\n| **GitOps Ready** | ✅ Deterministic YAML | ❌ State backend | ✅ YAML output | ✅ Charts |\n| **Runtime Refs** | ✅ CEL expressions | ❌ Deploy-time | ❌ Static | ❌ Templates |\n| **Learning Curve** | 🟢 Just TypeScript | 🔴 New concepts | 🟡 TS + K8s | 🔴 Templates |\n| **Stateless** | ✅ | ❌ State backend | ✅ | ✅ |\n| **Cross-Resource** | ✅ Runtime resolution | ❌ Deploy-time | ❌ Manual | ❌ Manual |\n\n## Deployment Modes\n\nTypeKro supports multiple deployment strategies from the same code:\n\n```typescript\n// 1. Direct deployment - immediate, no Kro required\nconst factory = graph.factory('direct', { namespace: 'dev' });\nawait factory.deploy(spec);\n\n// 2. Kro deployment - runtime CEL evaluation\nconst kroFactory = graph.factory('kro', { namespace: 'prod' });\nawait kroFactory.deploy(spec);\n\n// 3. YAML generation - GitOps workflows\nconst yaml = kroFactory.toYaml();\nwriteFileSync('k8s/app.yaml', yaml);\n```\n\n## Core Features\n\n### Type-Safe Schemas with ArkType\n\n```typescript\nconst AppSpec = type({\n  name: 'string',\n  image: 'string',\n  replicas: 'number',\n  'environment?': '\"dev\" | \"staging\" | \"prod\"'\n});\n```\n\n### Cross-Resource References\n\n```typescript\nconst db = Deployment({ id: 'database', name: 'postgres', image: 'postgres:15' });\nconst api = Deployment({\n  id: 'api',\n  name: 'api-server',\n  image: 'node:20',\n  env: {\n    DB_HOST: db.metadata.name  // Runtime reference\n  }\n});\n```\n\n### JavaScript-to-CEL Conversion\n\nWrite natural JavaScript - TypeKro converts to CEL:\n\n```typescript\nreturn {\n  ready: deploy.status.readyReplicas \u003e 0,           // → ${app.status.readyReplicas \u003e 0}\n  url: `http://${svc.status.clusterIP}`,            // → http://${svc.status.clusterIP}\n  phase: deploy.status.phase === 'Running' ? 'up' : 'down'\n};\n```\n\n### Helm Integration\n\n```typescript\nimport { helmRelease, helmRepository } from 'typekro';\n\nconst repo = helmRepository({\n  name: 'bitnami',\n  url: 'https://charts.bitnami.com/bitnami'\n});\n\nconst release = helmRelease({\n  name: 'nginx',\n  repository: repo,\n  chart: 'nginx',\n  values: {\n    replicaCount: spec.replicas  // Type-safe values\n  }\n});\n```\n\n### YAML File Integration\n\n```typescript\nimport { yamlFile } from 'typekro';\n\nconst existing = yamlFile({\n  path: './k8s/existing-deployment.yaml',\n  namespace: 'default'\n});\n```\n\n## Factory Functions\n\nTypeKro provides 50+ factory functions for Kubernetes resources:\n\n**Workloads:** `Deployment`, `StatefulSet`, `DaemonSet`, `Job`, `CronJob`\n\n**Networking:** `Service`, `Ingress`, `NetworkPolicy`\n\n**Config:** `ConfigMap`, `Secret`\n\n**Storage:** `PersistentVolumeClaim`, `PersistentVolume`, `StorageClass`\n\n**RBAC:** `ServiceAccount`, `Role`, `RoleBinding`, `ClusterRole`, `ClusterRoleBinding`\n\n**[View Complete API Reference →](https://typekro.run/api/)**\n\n## What is Kro?\n\n[Kubernetes Resource Orchestrator (Kro)](https://kro.run/) is an open-source project by AWS Labs that enables resources to reference each other's runtime state using CEL expressions.\n\nTypeKro works in **Direct Mode** (no Kro required) for simple deployments, or **Kro Mode** for advanced orchestration with runtime dependencies.\n\n## Documentation\n\n- **[Getting Started](https://typekro.run/guide/getting-started)** - 5-minute quick start\n- **[Core Concepts](https://typekro.run/guide/imperative-composition)** - kubernetesComposition API\n- **[API Reference](https://typekro.run/api/)** - Complete API documentation\n- **[Examples](https://typekro.run/examples/)** - Real-world patterns\n\n## Installation\n\n```bash\n# Using bun (recommended)\nbun add typekro arktype\n\n# Using npm\nnpm install typekro arktype\n\n# Using yarn\nyarn add typekro arktype\n```\n\n## Requirements\n\n- Node.js 18+ or Bun\n- TypeScript 5.0+\n- Kubernetes cluster (for deployment)\n- Kro controller (optional, for runtime features)\n\n## Contributing\n\nWe welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n```bash\n# Clone the repository\ngit clone https://github.com/yehudacohen/typekro.git\ncd typekro\n\n# Install dependencies\nbun install\n\n# Run tests\nbun run test\n\n# Build\nbun run build\n```\n\n## License\n\nApache 2.0 - See [LICENSE](LICENSE) for details.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cstrong\u003eBuilt with ❤️ for the Kubernetes community\u003c/strong\u003e\n  \n  [Documentation](https://typekro.run) • [Discord](https://discord.gg/kKNSDDjW) • [GitHub](https://github.com/yehudacohen/typekro)\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyehudacohen%2Ftypekro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyehudacohen%2Ftypekro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyehudacohen%2Ftypekro/lists"}