[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/core](../../README) / [index](../README) / Artisan

# Variable: Artisan

> `const` **Artisan**: `object`

Defined in: [facade/facades/Artisan.ts:35](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/facade/facades/Artisan.ts#L35)

Artisan facade — run any registered command from inside the application.
Output is captured; nothing is written to the server terminal.
Safe to call from controllers, services, scheduled tasks.

Only use for fast commands. For long-running work, use Bun.spawn or worker.ts.

See: plans/boot-modes.md §6

## Type Declaration

### call()

> **call**(`commandName`, `parameters?`): `Promise`\<[`ArtisanResult`](../interfaces/ArtisanResult)\>

#### Parameters

##### commandName

`string`

##### parameters?

`Record`\<`string`, `string` \| `boolean` \| `number`\> = `{}`

#### Returns

`Promise`\<[`ArtisanResult`](../interfaces/ArtisanResult)\>

## Throws

From [Artisan.call](#call) when no CommandRunner is registered
in the container (commands are only registered for `env='web'`).

## Example

```ts
const { code, output } = await Artisan.call('cache:clear');
const { code, output } = await Artisan.call('migrate', { '--fresh': true });
return Response.json({ output, success: code === 0 });
```
