---
title: "@vltpkg/cmd-shim: Reference — vlt docs"
description: "Documentation for the vlt client and the vlt registry."
url: "https://docs.vlt.io/client/api-reference/cmd-shim/reference"
image: "https://docs.vlt.io/og/client/api-reference/cmd-shim/reference"
lang: "en"
---

# Reference

## Functions

### cmdShim()

```ts
function cmdShim(
   from, 
   to, 
remover): Promise<void>
```

Defined in: index.ts:46

#### Parameters

| Parameter | Type                                                                                                     |
| --------- | -------------------------------------------------------------------------------------------------------- |
| `from`    | `string`                                                                                                 |
| `to`      | `string`                                                                                                 |
| `remover` | [`RollbackRemove`](https://docs.vlt.io/client/api-reference/rollback-remove/reference.md#rollbackremove) |

#### Returns

`Promise`<`void`>

---

### cmdShimIfExists()

```ts
function cmdShimIfExists(
   from, 
   to, 
remover): Promise<void>
```

Defined in: index.ts:33

#### Parameters

| Parameter | Type                                                                                                     |
| --------- | -------------------------------------------------------------------------------------------------------- |
| `from`    | `string`                                                                                                 |
| `to`      | `string`                                                                                                 |
| `remover` | [`RollbackRemove`](https://docs.vlt.io/client/api-reference/rollback-remove/reference.md#rollbackremove) |

#### Returns

`Promise`<`void`>

---

### findCmdShim()

```ts
function findCmdShim(path): Promise<[string, string]>
```

Defined in: read.ts:61

Find a matching cmd, cygwin, powershell, or symlink executable, and return the matching file and the target it references in a `[string,string]` tuple if found, or throw if not found.

#### Parameters

| Parameter | Type     |
| --------- | -------- |
| `path`    | `string` |

#### Returns

`Promise`<\[`string`, `string`]>

---

### findCmdShimIfExists()

```ts
function findCmdShimIfExists(path): Promise<undefined | [string, string]>
```

Defined in: read.ts:46

Find a matching cmd, cygwin, powershell, or symlink executable, and return the matching file and the target it references in a `[string,string]` tuple if found, or undefined if not.

#### Parameters

| Parameter | Type     |
| --------- | -------- |
| `path`    | `string` |

#### Returns

`Promise`<`undefined` | \[`string`, `string`]>

---

### readCmdShim()

```ts
function readCmdShim(path): Promise<string>
```

Defined in: read.ts:92

Read the specified executable shim, returning the target it references. Raise an error if it does not exist or cannot be read.

#### Parameters

| Parameter | Type     |
| --------- | -------- |
| `path`    | `string` |

#### Returns

`Promise`<`string`>

---

### readCmdShimIfExists()

```ts
function readCmdShimIfExists(path): Promise<undefined | string>
```

Defined in: read.ts:76

Read the specified executable shim if it exists, returning the target it references. Return undefined if it does not exist or cannot be dereferenced.

#### Parameters

| Parameter | Type     |
| --------- | -------- |
| `path`    | `string` |

#### Returns

`Promise`<`undefined` | `string`>
