Enterprise TypeScript SDK for Sealos Devbox management with HTTP API + Bun runtime architecture.
This project is a monorepo containing two main packages:
- @sealos/devbox-sdk - TypeScript SDK for Devbox management
- @sealos/devbox-server - HTTP server for Devbox runtime (Bun-based)
TypeScript/Node.js SDK providing high-level APIs for Devbox management:
- Devbox lifecycle management
- HTTP connection pooling
- File transfer with adaptive strategies
- Security and monitoring
High-performance HTTP server running in Devbox containers:
- File operations API
- Process execution
- Real-time file watching via WebSocket
- Built on Bun runtime
npm install @sealos/devbox-sdkimport { DevboxSDK } from '@sealos/devbox-sdk'
const sdk = new DevboxSDK({
kubeconfig: process.env.KUBECONFIG
})
// Create a Devbox
const devbox = await sdk.createDevbox({
name: 'my-app',
runtime: 'node.js',
resource: { cpu: 1, memory: 2 }
})
// Write files
await devbox.writeFile('index.js', 'console.log("Hello World")')
// Execute commands
const result = await devbox.executeCommand('node index.js')
console.log(result.stdout)# Install dependencies
npm install
# Build all packages
npm run build
# Run tests
npm test
# Lint code
npm run lint:fix# Build SDK only
npm run build:sdk
# Build server only
npm run build:server
# Run in development mode
npm run devdevbox-sdk/
βββ packages/
β βββ sdk/ # Main SDK package
β β βββ src/
β β β βββ core/ # Core SDK functionality
β β β βββ api/ # API integration
β β β βββ http/ # HTTP client
β β β βββ transfer/ # File transfer
β β β βββ security/ # Security features
β β β βββ monitoring/ # Metrics & logging
β β βββ dist/ # Built output
β βββ server/ # HTTP server package
β βββ src/
β β βββ handlers/ # Request handlers
β β βββ utils/ # Server utilities
β β βββ types/ # Type definitions
β βββ dist/ # Built output
βββ openspec/ # OpenSpec specifications
βββ tasks/ # Task documentation
βββ docs/ # Additional documentation
βββ dist/ # Build outputs
- Connection Pooling: Efficient HTTP connection reuse
- Adaptive Transfer: Smart file transfer strategies
- Bun Runtime: High-performance server runtime
- TypeScript: Full type safety and IDE support
PORT- Server port (default: 3000)HOST- Server host (default: 0.0.0.0)WORKSPACE_PATH- Workspace directory (default: /workspace)ENABLE_CORS- Enable CORS (default: false)MAX_FILE_SIZE- Max file size in bytes (default: 100MB)
KUBECONFIG- Kubernetes configuration for Devbox API access
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run E2E tests
npm run test:e2eApache-2.0
Contributions are welcome! Please read our contributing guidelines and submit pull requests.
For issues and questions:
- Create an issue on GitHub
- Check the documentation
- Contact the maintainers