www/apps/resources/app/medusa-cli/commands/exec/page.mdx
import { Table } from "docs-ui"
export const metadata = {
title: exec Command - Medusa CLI Reference,
}
Run a custom CLI script using Medusa's CLI tool. Learn more about it in Custom CLI Scripts guide.
npx medusa exec [file] [args...]
`file`
</Table.Cell>
<Table.Cell>
The path to the TypeScript or JavaScript file containing the function to execute.
</Table.Cell>
<Table.Cell>
Yes
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`args`
</Table.Cell>
<Table.Cell>
A list of arguments to pass to the function. These arguments are passed in the `args` property of the function's object parameter.
</Table.Cell>
<Table.Cell>
No
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>