---
title: ExecOptions
description: "How an exec should be started. Every field optional; the defaults are the daemon's."
---

How an exec should be started. Every field optional; the defaults are the daemon's.

## Properties

### cwd?

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

#### Default Value

```ts
null
```

***

### env?

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

***

### execId?

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

The idempotency key. Omitted, one is minted; supplied, the daemon returns success for
a known id without spawning a second child — so a caller whose retry must be safe
across its own restart passes a stable one.

***

### group?

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

A numeric gid, or a name the daemon resolves against the guest's `/etc/group`.

#### Default Value

```ts
null
```

***

### inheritImageEnv?

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

Start the child's environment from the image's `ENV` (minus `AGENTD_*`, never the
token), beneath everything else (AGENTD-11). Off by default, which keeps the child's environment
exactly the launch environment plus `env`.

***

### 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, so nothing it
backgrounded outlives it. Off by default, which keeps the backgrounded-grandchild-output
guarantee for callers who rely on it.

***

### 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, and a shell the guest
does not have is refused (`unknown_shell`) before anything starts.

***

### stdin?

```ts
optional stdin?: boolean;
```

Whether to open a stdin pipe. Writing without this is a 409.

***

### timeout?

```ts
optional timeout?: number;
```

The client-side deadline for `runSync` only.

***

### timeoutSec?

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

The daemon's own kill deadline for the child, distinct from a client-side `wait`.

#### Default Value

```ts
null
```

***

### user?

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

A numeric uid, or a name the daemon resolves against the guest's `/etc/passwd`. An
unknown name is refused (`unknown_user`) before anything starts. A user with a passwd
row gets `HOME`, `USER` and `LOGNAME` from it, beneath the launch environment and
`env`.

#### Default Value

```ts
null
```

## 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.