---
url: /api/@ufo-soft/caelus-cli/functions/cli.md
---
# Function: cli()

> **cli**(`registry`, `argv`, `name`, `io?`): `Promise`<`number`>

Defined in: [cli.ts:19](https://github.com/ufo-soft/caelus/blob/31cc32fc3d2008e3b0d484d65d10bba2a91a5897/packages/cli/src/cli.ts#L19)

Exposes the registry as a CLI named `name`: one subcommand per command, one option per parameter,
all derived. Resolves to the exit code; the caller decides whether to exit the process.

## Parameters

### registry

[`Registry`](../../caelus/core/classes/Registry.md)

### argv

readonly `string`\[]

### name

`string`

### io?

[`Io`](../interfaces/Io.md) = `stdio`

## Returns

`Promise`<`number`>
