Skip to main content

handle

Function handle 

Source
pub async fn handle(args: RunArgs, ctx: RunContext) -> Result<i32>
Expand description

Top-level driver for hm run.

Runs the local worktree on the selected execution backend: docker (default) runs it locally on the Docker VM backend; cloud submits it to Harmont Cloud and streams logs.

Backend resolution (flag wins over config):

  • --backend <name> → that backend (cloud, docker, …)
  • --cloudcloud (deprecated alias)
  • neither → ctx.config.backend (figment-layered, default docker)

This is a THIN driver over the hm-exec backends: it builds an hm_exec::ExecutionBackend, renders the pipeline to v0 IR once, starts the build, drives its event stream through an hm_render renderer, owns Ctrl-C, and returns the build’s process exit code. Cloud authentication is resolved BEFORE the (local) render work so a missing token fails fast.

§Errors

Returns a doctrine-shaped error (carrying the right process exit code) when the backend rejects the build, authentication fails, the network is unreachable, the local daemon is down, or the pipeline fails to render.