{"id":35563956,"url":"https://github.com/labring/devbox-sdk","last_synced_at":"2026-01-20T17:16:10.488Z","repository":{"id":320305422,"uuid":"897806298","full_name":"labring/devbox-sdk","owner":"labring","description":"Cloud-native development environment SDK for running sandboxed code with high-performance file operations","archived":false,"fork":false,"pushed_at":"2026-01-12T07:00:03.000Z","size":1552,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T16:33:12.202Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://iqkkimteigmi.usw.sealos.io","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/labring.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-03T09:19:20.000Z","updated_at":"2026-01-12T07:00:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"d271066f-0bce-49d5-81f0-422453de7559","html_url":"https://github.com/labring/devbox-sdk","commit_stats":null,"previous_names":["zjy365/devbox-sdk","labring/devbox-sdk"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/labring/devbox-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Fdevbox-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Fdevbox-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Fdevbox-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Fdevbox-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labring","download_url":"https://codeload.github.com/labring/devbox-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Fdevbox-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"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":[],"created_at":"2026-01-04T14:13:50.981Z","updated_at":"2026-01-20T17:16:10.477Z","avatar_url":"https://github.com/labring.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Devbox SDK\n\n![Devbox SDK](https://iqkkimteigmi.usw.sealos.io/og.png)\n\n**Secure Sandbox SDK for Isolated Code Execution.** Execute AI-generated code, run automation tasks, and test untrusted code with zero risk to your infrastructure.\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\nnpm install @labring/devbox-sdk\n```\n\n### Secure Code Execution\n\n```typescript\nimport { DevboxSDK } from '@labring/devbox-sdk'\n\n// Initialize SDK\nconst sdk = new DevboxSDK({\n  kubeconfig: process.env.KUBECONFIG\n})\n\n// Create a secure sandbox\nconst sandbox = await sdk.createDevbox({\n  name: 'ai-agent-task',\n  runtime: 'python',\n  resource: { cpu: 1, memory: 512 }\n})\n\n// Execute AI-generated code safely in isolation\nconst result = await sandbox.codeRun(`\nimport requests\nresponse = requests.get('https://api.example.com/data')\nprint(response.json())\n`)\n\nconsole.log(result.stdout) // Safe output from isolated execution\n\n// Clean up\nawait sandbox.delete()\nawait sdk.close()\n```\n\n### Core Features\n\n- **🛡️ Secure Sandbox Execution** - Isolated container environments for safe code execution\n- **⚡ Fast Code Execution** - Execute code synchronously or asynchronously with real-time output\n- **📁 File \u0026 Git Operations** - Full CRUD operations, batch transfers, and Git integration\n- **🔍 Real-time Monitoring** - Monitor file changes and resource usage via WebSocket\n- **🌐 Connection Pooling** - Efficient HTTP connection reuse for better performance\n- **🔐 Enterprise Security** - Kubernetes-based isolation, path validation, and access control\n\n### Use Cases\n\n**AI Agents \u0026 Code Generation**\n```typescript\n// Execute AI-generated code safely\nconst aiCode = await llm.generateCode(prompt)\nconst result = await sandbox.codeRun(aiCode)\n```\n\n**Automation \u0026 Testing**\n```typescript\n// Run untrusted automation scripts\nawait sandbox.execSync({\n  command: 'npm test',\n  cwd: '/workspace',\n  timeout: 60000\n})\n```\n\n**CI/CD Tasks**\n```typescript\n// Execute build tasks in isolation\nawait sandbox.git.clone({ url: repoUrl, path: '/workspace' })\nawait sandbox.execSync({ command: 'npm run build' })\n```\n\n## 🛡️ Security \u0026 Isolation\n\n### Container-Based Isolation\n\nEach sandbox runs in an isolated Kubernetes Pod, ensuring:\n- **Zero cross-contamination** - Each execution is completely isolated\n- **Resource limits** - CPU and memory constraints prevent resource exhaustion\n- **Network isolation** - Controlled network access per sandbox\n- **Path validation** - Prevents directory traversal attacks\n\n### Enterprise Security Features\n\n- **Kubernetes-native** - Built on enterprise-grade container orchestration\n- **Access control** - Kubeconfig-based authentication and authorization\n- **HTTPS/TLS** - All communications encrypted\n- **Input validation** - Comprehensive input sanitization and validation\n\n## 📦 Monorepo Packages\n\nThis is a monorepo containing multiple packages:\n\n### @labring/devbox-sdk (Main Package)\nThe primary TypeScript SDK for secure sandbox execution. See [packages/sdk/README.md](./packages/sdk/README.md) for detailed documentation.\n\n### devbox-shared\nShared types, errors, and utilities used across the SDK and server. See [packages/shared/README.md](./packages/shared/README.md).\n\n### devbox-server-go\nHigh-performance HTTP server written in Go, running inside sandbox containers to handle file operations, process execution, and WebSocket connections. See [packages/server-go/README.md](./packages/server-go/README.md).\n\n### devbox-docs\nDocumentation website built with Next.js and Fumadocs. Visit the [docs site](./apps/docs) or run `npm run dev:docs` to start locally.\n\n## 🛠️ Development\n\n### Prerequisites\n\n- Node.js \u003e= 22.0.0\n- npm \u003e= 11.0.0\n- Kubernetes cluster access (for testing)\n\n### Setup\n\n```bash\n# Install dependencies\nnpm install\n\n# Build all packages\nnpm run build\n\n# Run tests\nnpm test\n\n# Lint code\nnpm run lint:fix\n```\n\n### Package Scripts\n\n```bash\n# Build specific packages\nnpm run build:sdk      # Build SDK only\nnpm run build:docs     # Build docs site\n\n# Development\nnpm run dev:docs       # Start docs site in dev mode\n\n# Testing\nnpm test              # Run all tests\nnpm run test:watch    # Run tests in watch mode\nnpm run test:e2e     # Run E2E tests\n```\n\n## 📚 Documentation\n\n- [SDK Documentation](./packages/sdk/README.md) - Complete SDK API reference\n- [Architecture Overview](./packages/sdk/ARCHITECTURE.md) - Technical architecture details\n- [API Documentation](./apps/docs/content/docs/api.mdx) - HTTP API reference\n- [Server Documentation](./packages/server-go/docs/README.md) - Server implementation details\n- [Competitor Analysis](./plans/COMPETITOR_ANALYSIS.md) - Competitive positioning\n\n## ⚡ Performance\n\n- **Connection Pooling**: Efficient HTTP connection reuse (\u003e98% reuse rate)\n- **Adaptive Transfer**: Smart file transfer strategies based on file size\n- **Fast Creation**: Quick sandbox initialization\n- **TypeScript**: Full type safety and IDE support\n\n## 🔧 Configuration\n\n### Environment Variables\n\n- `KUBECONFIG` - Kubernetes configuration for sandbox access (required)\n\n### SDK Configuration\n\n```typescript\nconst sdk = new DevboxSDK({\n  kubeconfig: process.env.KUBECONFIG,\n  baseUrl: 'https://api.sealos.io', // Optional\n  http: {\n    timeout: 30000,        // Request timeout in ms\n    retries: 3,            // Retry attempts\n    rejectUnauthorized: true // SSL verification\n  }\n})\n```\n\n## 🧪 Testing\n\n```bash\n# Run all tests\nnpm test\n\n# Run tests in watch mode\nnpm run test:watch\n\n# Run E2E tests\nnpm run test:e2e\n```\n\n## 📄 License\n\nApache-2.0\n\n## 🤝 Contributing\n\nContributions are welcome! Please read our contributing guidelines and submit pull requests.\n\n## 📞 Support\n\nFor issues and questions:\n- Create an issue on [GitHub](https://github.com/zjy365/devbox-sdk/issues)\n- Check the [documentation](./apps/docs)\n- Contact the maintainers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabring%2Fdevbox-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabring%2Fdevbox-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabring%2Fdevbox-sdk/lists"}