> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exowizz.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI commands

> All Artisan commands provided by the Exo package.

Exo registers nine Artisan commands for managing installation, resources, users, licensing, and Exo Cloud connectivity.

## exo:install

Install Exo and prepare Passport for API token creation.

```bash theme={null}
php artisan exo:install [--force] [--no-migrate] [--no-passport] [--no-personal-access-client] [--views] [--passport-key-length=4096]
```

The command publishes Exo configuration and migrations, prepares Passport configuration and migrations when needed, generates Passport encryption keys, runs migrations, updates your local User model for Passport tokens when possible, and creates the Passport personal access client required by `exo:user`.

| Option                        | Description                                                      |
| ----------------------------- | ---------------------------------------------------------------- |
| `--force`                     | Overwrite published files and Passport encryption keys           |
| `--no-migrate`                | Skip running pending database migrations                         |
| `--no-passport`               | Skip Passport publishing, keys, and personal access client setup |
| `--no-personal-access-client` | Skip creating a Passport personal access client                  |
| `--views`                     | Publish Exo Blade views for customization                        |
| `--passport-key-length`       | Passport private key length in bits. Defaults to `4096`.         |

<Note>
  Existing published files, Passport keys, and personal access clients are reused unless you pass `--force`. Existing Passport migrations are detected so OAuth tables are not duplicated.
</Note>

## exo:resource

Scaffold a new resource class.

```bash theme={null}
php artisan exo:resource [name] [--model=] [--triggers=]
```

| Argument/Option | Description                                                       |
| --------------- | ----------------------------------------------------------------- |
| `name`          | The class name (e.g. `UserResource`). Prompted if omitted.        |
| `--model`       | The fully-qualified Eloquent model class (e.g. `App\Models\User`) |
| `--triggers`    | Comma-separated triggers: `on_create,on_update,on_delete`         |

**Examples:**

```bash theme={null}
# Interactive mode
php artisan exo:resource

# Fully specified
php artisan exo:resource UserResource --model="App\Models\User" --triggers=on_create,on_update,on_delete
```

The file is created at the path defined by `config('exo.resources_path')` (default: `app/Exo/Resources/`).

## exo:user

Create a new user with an optional Personal Access Token.

```bash theme={null}
php artisan exo:user [--name=] [--email=] [--password=] [--no-token]
```

| Option       | Description                              |
| ------------ | ---------------------------------------- |
| `--name`     | User name (skips interactive prompt)     |
| `--email`    | User email (skips interactive prompt)    |
| `--password` | User password (skips interactive prompt) |
| `--no-token` | Skip creating a Personal Access Token    |

**Examples:**

```bash theme={null}
# Interactive mode
php artisan exo:user

# Non-interactive
php artisan exo:user --name="Jane Smith" --email="jane@example.com" --password="secure-password"
```

<Warning>
  The Personal Access Token is only displayed once. Copy and store it securely.
</Warning>

<Note>
  Your User model must use the `Laravel\Passport\HasApiTokens` trait and implement `Laravel\Passport\Contracts\OAuthenticatable` for token creation to work. `exo:install` updates the configured local app User model automatically when possible.
</Note>

## exo:login

Authenticate with Exo Cloud using OAuth.

```bash theme={null}
php artisan exo:login
```

Opens your browser for PKCE authorization. After authorizing, credentials are stored encrypted at `storage/app/.exo-credentials`. If PKCE isn't available, falls back to device code flow.

## exo:logout

Remove stored Exo Cloud credentials.

```bash theme={null}
php artisan exo:logout
```

Deletes the encrypted credentials file.

## exo:whoami

Check your current Exo Cloud identity.

```bash theme={null}
php artisan exo:whoami
```

Displays the name and email associated with your stored Exo Cloud credentials.

## exo:schema

Generate a JSON schema describing your resources.

```bash theme={null}
php artisan exo:schema
```

Creates an `exo-schema.json` file in your project root. The schema includes resource names, triggers, and field definitions inferred from your `createRules`.

The generated schema also includes supported modules based on your Resource capabilities (`create`, `update`, `delete`, `pulling`).

## exo:upload

Upload the generated schema to Exo Cloud.

```bash theme={null}
php artisan exo:upload [path] [--project=]
```

Lists your Exo Cloud projects and uploads the schema to the one you select. If your account has one project, Exo selects it automatically. For CI or deploy scripts, pass `--project=` with the project token to skip the prompt.

If a `ZAPIER_DEPLOY_KEY` is configured, it's included for Zapier deployments.

<Note>
  You must run `exo:login` before using `exo:upload`, and `exo:schema` to generate the schema file.
</Note>

## exo:license-check

Check whether the current site has an attached production license in Exo Cloud.

```bash theme={null}
php artisan exo:license-check [--required]
```

Successful licensed responses update the local signed assertion cache. Explicit unlicensed responses clear the cache. Transient failures, such as network errors or failed cloud responses, preserve any existing cached assertion.

Use `--required` in CI or production checks when an unlicensed site should fail the command.
