hexr build is the first command in every Hexr deployment. You point it at your Python agent file and it performs deep AST analysis — roughly 2,900 lines of it — to understand your agent’s framework, sub-agent roles, cloud resource requirements, and A2A topology. From that analysis it generates everything needed for a production Kubernetes deployment: a multi-stage Dockerfile, namespace and RBAC manifests, per-process SPIFFE context files, an A2A agent card, and a build metadata manifest. You never write these files by hand.
Usage
Arguments
Path to your Python agent file.
Options
Tenant identifier. Maps to the Kubernetes namespace
tenant-{tenant}.Override the agent name. Defaults to the value in
@hexr_agent(name=...) or the filename.Target environment:
development, staging, or production.Affects OPA policies, resource limits, and security scanning levels.Container registry base URL.
Private PyPI URL for SDK installation in agent pods.
Python version to use in the container image.
Base Docker image for the generated Dockerfile.
Comma-separated list of cloud providers to configure for credential exchange.
Enable subprocess role management for multi-process agents.
Run a dependency security audit during the build step.
Output directory for all generated artifacts.
Generate only the Dockerfile and requirements — skip Kubernetes manifests.
Print what would be generated without writing any files.
SPIFFE trust domain used when generating agent identity paths.
What gets generated
After a successful build, your.hexr/ directory contains:
AST analysis
The build command inspects your agent file at the syntax-tree level — without executing it — to extract:- Framework detection — CrewAI, LangChain, AutoGen, Strands, Swarm, or pure Python
- Agent discovery — all
@hexr_agentdecorators and framework-specific declarations - Sub-agent mapping — distinct roles (researcher, writer, editor) for per-process identity
- Resource inference —
hexr_tool()calls that determine required cloud permissions - A2A detection —
A2AClientusage anda2a=Trueparameters - Coordination graph — NetworkX analysis of agent-to-agent relationships
Examples
Run
hexr push from the same directory after hexr build completes. hexr push reads the .hexr/ directory produced here.