1 ---
2 sidebar_label: "exec"
3 sidebar_position: 7
4 ---
5
6 import { Table } from "docs-ui"
7
8 export const metadata = {
9 title: `exec Command - Medusa CLI Reference`,
10 }
11
12 # {metadata.title}
13
14 Run a custom CLI script using Medusa's CLI tool. Learn more about it in [Custom CLI Scripts guide](!docs!/learn/fundamentals/custom-cli-scripts).
15
16 ```bash npx2yarn
17 npx medusa exec [file] [args...]
18 ```
19
20 ## Arguments
21
22 <Table>
23 <Table.Header>
24 <Table.Row>
25 <Table.HeaderCell>
26 Argument
27 </Table.HeaderCell>
28 <Table.HeaderCell>
29 Description
30 </Table.HeaderCell>
31 <Table.HeaderCell>
32 Required
33 </Table.HeaderCell>
34 </Table.Row>
35 </Table.Header>
36 <Table.Body>
37 <Table.Row>
38 <Table.Cell>
39
40 `file`
41
42 </Table.Cell>
43 <Table.Cell>
44
45 The path to the TypeScript or JavaScript file containing the function to execute.
46
47 </Table.Cell>
48 <Table.Cell>
49
50 Yes
51
52 </Table.Cell>
53 </Table.Row>
54 <Table.Row>
55 <Table.Cell>
56
57 `args`
58
59 </Table.Cell>
60 <Table.Cell>
61
62 A list of arguments to pass to the function. These arguments are passed in the `args` property of the function's object parameter.
63
64 </Table.Cell>
65 <Table.Cell>
66
67 No
68
69 </Table.Cell>
70 </Table.Row>
71 </Table.Body>
72 </Table>