# Lucid Console

Console is a set of methods to easily manage \[create, delete] Lucid components such as Jobs, Operations, Features as well as Laravel's own components such as Controller, Eloquent Model, Request and many more; ensuring that they go where they belong and are generated with their test companion to assist you as you build your application. These methods are exposed through a [command-line interface ](/docs/lucid-console.md#53189d1c-98fb-456b-b9c2-ab5cadaf509c)and a [user interface](/docs/lucid-console.md#b52ee1ce-3a5c-40ec-afd1-c33c891becdc).

## Command-Line Interface <a href="#id-53189d1c-98fb-456b-b9c2-ab5cadaf509c" id="id-53189d1c-98fb-456b-b9c2-ab5cadaf509c"></a>

Console ships with a command-line interface called `lucid` that you can find at `vendor/bin/lucid` after running `composer install` in the root of your application. It is used as

```bash
lucid make:feature ListUsers Api
```

For convenience you might want to address `lucid` directly instead of having to go through `./vendor/bin` every time. To do that you need to add `./vendor/bin` as part of your shell session's `$PATH`. For the current session, run:

```bash
export PATH="./vendor/bin:$PATH"
```

However, it will only be available for the current session. To make it permanent, add it to your shell profile (`~/.bash_profile`, `~/.bashrc`, `~/.zshrc`) and you will be able to simply call `lucid` from the application's root directory.

To view a list of all available `lucid` commands, you may use the `list` command:

```bash
lucid list
```

Also, just like in Artisan, every command includes a "help" screen which displays and describes the command's available arguments and options. To view a help screen, precede the name of the command with `help`:

```bash
lucid help make:feature
```

## Available Commands

Set the root namespace with:

### namespace

```bash
src:name <namespace>
```

### `make`

#### Generate Service Directory Structure

```bash
make:service <name>
```

* Microservice: N/A
* Monolith: `src/Services/<name>`

#### **Generate Controller**

```bash
make:controller <controller> [<service>]
```

* Microservice: `app/Http/Controller`
* Monolith: `src/Services/<service>/Http/<controller>`

**Generate Feature Class**

```bash
make:feature <feature> [<service>]
```

* Microservice: `app/Features/<feature>`
* Monolith: `src/Services/<service>/Features/<feature>`

**Generate Job Class in a Domain**

```bash
make:job <job> <domain> [--queue]
```

* Microservice: `app/Domains/<domain>/Jobs/<job>`
* Monolith: `src/Domains/<domain>/Jobs/<job>`

#### Generate Migration

```bash
make:migration <migration> [<service>]
```

* Microservice: `database/migrations/<migration>`
* Monolith: `src/Services/<service>/database/migrations/<migration>`

#### Generate Eloquent Model Class

```bash
make:model <model>
```

* Microservice: `app/Data/<model>`
* Monolith: `src/Data/<model>`

#### Generate Request Class

```bash
make:request <request> [<service>]
```

* Microservice: `app/Http/Requests/<request>`
* Monolith: `src/Services/<service>/Http/Requests/<request>`

#### Generate Policy Class

```bash
make:policy <policy>
```

* Microservice: `app/Policies`
* Monolith: `src/Policies`

#### Generate Operation Class

```bash
make:operation <operation> [<service>]
```

* Microservice: `app/Operations/<operation>`
* Monolith: `src/Services/<service>/Operations/<operation>`

###

### `list`

#### List Services in a Monolith

```bash
list:services
```

#### List Features

```bash
list:features [<service>]
```

{% hint style="info" %}
&#x20;In a Monolith, specify the Service to scope the list.
{% endhint %}

###

### `delete`

> These are pretty obvious.

* `delete:service <name>`
* `delete:feature <feature> [<service>]`
* `delete:job <job> <domain>`
* `delete:model <model>`
* `delete:request <request> [<service>]`
* `delete:policy <policy>`

## User Interface <a href="#b52ee1ce-3a5c-40ec-afd1-c33c891becdc" id="b52ee1ce-3a5c-40ec-afd1-c33c891becdc"></a>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lucid-architecture.gitbook.io/docs/lucid-console.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
