Skip to Content
ReferenceCLIkastrax build

The kastrax build command bundles your Kastrax project into a production-ready Hono server. Hono is a lightweight web framework that provides type-safe routing and middleware support, making it ideal for deploying Kastrax agents as HTTP endpoints.

Usage ✅

kastrax build [options]

Options ✅

  • --dir <path>: Directory containing your Kastrax project (default: current directory)

What It Does ✅

  1. Locates your Kastrax entry file (either src/kastrax/index.ts or src/kastrax/index.js)
  2. Creates a .kastrax output directory
  3. Bundles your code using Rollup with:
    • Tree shaking for optimal bundle size
    • Node.js environment targeting
    • Source map generation for debugging

Example ✅

# Build from current directory ✅ kastrax build # Build from specific directory ✅ kastrax build --dir ./my-kastrax-project

Output ✅

The command generates a production bundle in the .kastrax directory, which includes:

  • A Hono-based HTTP server with your Kastrax agents exposed as endpoints
  • Bundled JavaScript files optimized for production
  • Source maps for debugging
  • Required dependencies

This output is suitable for:

  • Deploying to cloud servers (EC2, Digital Ocean)
  • Running in containerized environments
  • Using with container orchestration systems

Deployers ✅

When a Deployer is used, the build output is automatically prepared for the target platform e.g

Last updated on