```typescript
window.ddClient.execHostCmd(`cliShippedOnHost xxx`).then((cmdResult: any) => {
console.log(cmdResult);
});
```
> [!WARNING]
>
> It will be removed in a future version. Use [exec](ExtensionCli.md#exec) instead.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `cmd` | `string` | The command to be executed. |
#### Returns
`Promise`<[`ExecResultV0`](ExecResultV0.md)\>
#### Inherited from
DockerDesktopClientV0.execHostCmd
___
### spawnHostCmd
▸ **spawnHostCmd**(`cmd`, `args`, `callback`): `void`
Invoke an extension binary on your host and get the output stream.
```typescript
window.ddClient.spawnHostCmd(
`cliShippedOnHost`,
[`arg1`, `arg2`],
(data: any, err: any) => {
console.log(data.stdout, data.stderr);
// Once the command exits we get the status code
if (data.code) {
console.log(data.code);
}
}
);
```
> [!WARNING]
>
> It will be removed in a future version. Use [exec](ExtensionCli.md#exec) instead.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `cmd` | `string` | The command to be executed. |
| `args` | `string`[] | The arguments of the command to execute. |
| `callback` | (`data`: `any`, `error`: `any`) => `void` | The callback function where to listen from the command output data and errors. |
#### Returns
`void`
#### Inherited from
DockerDesktopClientV0.spawnHostCmd
___
### execDockerCmd
▸ **execDockerCmd**(`cmd`, `...args`): `Promise`<[`ExecResultV0`](ExecResultV0.md)\>
You can also directly execute the Docker binary.
```typescript
const output = await window.ddClient.execDockerCmd("info");
```
> [!WARNING]
>
> It will be removed in a future version. Use [exec](DockerCommand.md#exec) instead.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `cmd` | `string` | The command to execute. |
| `...args` | `string`[] | The arguments of the command to execute. |
#### Returns
`Promise`<[`ExecResultV0`](ExecResultV0.md)\>
The result will contain both the standard output and the standard error of the executed command:
```json
{
"stderr": "...",
"stdout": "..."
}
```
For convenience, the command result object also has methods to easily parse it depending on the output format:
- `output.lines(): string[]` splits output lines.
- `output.parseJsonObject(): any` parses a well-formed JSON output.
- `output.parseJsonLines(): any[]` parses each output line as a JSON object.
If the output of the command is too long, or you need to get the output as a stream you can use the
* spawnDockerCmd function: