---
title: CompletionRequest
description: How runToCompletion should start and collect a command.
---

How `runToCompletion` should start and collect a command.

The `ExecOptions` a completed run can use (no `stdin`, which nothing would write, and no
`timeout`, which `clientGraceSec` replaces), plus the client grace.

## Properties

### clientGraceSec?

```ts
optional clientGraceSec?: number;
```

How long past `timeoutSec` the client waits before it kills, and how long it then
waits for the killed exec's result. Defaults to the core's 60 seconds.

***

### cwd?

```ts
optional cwd?: string;
```

***

### env?

```ts
optional env?: Record<string, string>;
```

***

### execId?

```ts
optional execId?: string;
```

The idempotency key. Omitted, one is minted.

***

### group?

```ts
optional group?: string | number;
```

A numeric gid, or a name the daemon resolves in the guest.

***

### inheritImageEnv?

```ts
optional inheritImageEnv?: boolean;
```

Start the child's environment from the image's `ENV`. See `ExecOptions.inheritImageEnv`.

***

### poweroffOnExit?

```ts
optional poweroffOnExit?: boolean;
```

Power off the guest after the original process group exits. Requires daemon support;
all other VM work ends too, and acknowledgment and results may race shutdown.
Off by default. Does not keep an idle VM awake.

***

### reapGroupOnExit?

```ts
optional reapGroupOnExit?: boolean;
```

Signal the whole process group once the command's own child exits. See
`ExecOptions.reapGroupOnExit`.

***

### shell?

```ts
optional shell?: string | boolean;
```

`true` runs a single script string under `/bin/sh -c`; a string such as `"bash"` runs
it under that shell, resolved by the daemon in the guest. See `ExecOptions.shell`.

***

### timeoutSec?

```ts
optional timeoutSec?: number;
```

The daemon's own kill deadline for the child. The client deadline is this plus
`clientGraceSec`.

***

### user?

```ts
optional user?: string | number;
```

A numeric uid, or a name the daemon resolves in the guest. See `ExecOptions.user`.

## Provenance

This page is generated from `bindings/microvms-js/index.d.ts` by TypeDoc 0.28.20 and typedoc-plugin-markdown 4.13.1, run from `site/scripts/gen-reference.mjs` on every `pnpm run sync`, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding's Rust source, then regenerate the declarations with `mise run dts`. `mise run dts:check` fails when the committed file no longer matches the source.