---
url: /reference/api/logger/prompts.Variable.path.md
---
# Variable: path

```ts twoslash
// @include: imports
const path: (opts) => Promise<string | typeof CANCEL_SYMBOL>;
```

Defined in: node\_modules/.pnpm/@clack+prompts@1.9.0/node\_modules/@clack/prompts/dist/index.d.mts:853

The `path` prompt extends `autocomplete` to provide file and directory suggestions.

## Parameters

`opts`

[`PathOptions`](prompts.Interface.PathOptions.md)

## Returns

`Promise`<`string` | *typeof* [`CANCEL_SYMBOL`](prompts.Variable.CANCEL_SYMBOL.md)>

## See

https://bomb.sh/docs/clack/packages/prompts/#path-selection

## Example

```ts twoslash
// @include: imports
import { path } from "@clack/prompts";

const result = await path({
  message: "Select a file:",
  root: process.cwd(),
  directory: false,
});
```
