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

# Commands

> Essential commands for your application

## <Icon icon="hand-wave" size={25} /> Introduction

Fluxend provides two sets of commands to help you manage your application: CLI commands for direct application interaction and Make commands for development workflow automation.

## <Icon icon="wrench-simple" size={25} /> CLI Commands

The Fluxend CLI allows you to start the server, run seeders, and inspect routes.

<Note>
  Use `fluxend [command] --help` for more information about a specific command.
</Note>

| Command       | Description                                   |
| ------------- | --------------------------------------------- |
| `help`        | Help about any command                        |
| `about`       | Prints information about the application      |
| `optimize`    | Flush all caches and optimize the application |
| `routes`      | List all registered API routes                |
| `seed`        | Seed the database with initial data           |
| `server`      | Start the Fluxend API server                  |
| `udb.stats`   | Pull stats from given database                |
| `udb.restart` | Restart all PostGREST instances               |

***

## <Icon icon="gear-complex" size={25} /> Make Commands

Make commands provide convenient shortcuts for development tasks and project management.

<Note>
  Use `make help` for list all available commands
</Note>

| Command                 | Description                                  |
| ----------------------- | -------------------------------------------- |
| `make help`             | Shows help information                       |
| `make setup`            | Setup the project                            |
| `make build`            | Build the project                            |
| `make up`               | Start the project                            |
| `make down`             | Stop the project                             |
| `make login.app`        | Login to fluxend container                   |
| `make login.db`         | Login to database container                  |
| `make pgr.list`         | List all postgrest containers                |
| `make pgr.destroy`      | Destroy all postgrest containers             |
| `make docs.generate`    | Generate docs                                |
| `make lint`             | Run linter                                   |
| `make lint.fix`         | Run linter and fix                           |
| `make server`           | Run the project in development mode          |
| `make seed`             | Seed the database                            |
| `make about`            | Show the project information                 |
| `make optimize`         | Optimize the project                         |
| `make udb.stats`        | Show the database stats                      |
| `make udb.restart`      | Restart all PostGREST instances              |
| `make routes.list`      | Show all the available routes                |
| `make drop.user.dbs`    | Drop all user-created databases              |
| `make migration.create` | Create a new database migration              |
| `make migration.up`     | Run database migrations                      |
| `make migration.down`   | Rollback database migrations                 |
| `make migration.status` | Show the status of the database migrations   |
| `make migration.reset`  | Rollback all migrations and run them again   |
| `make migration.redo`   | Rollback the last migration and run it again |
| `make migration.fresh`  | Rollback all migrations and run them again   |
| `make seed.fresh`       | Seed the database with fresh data            |

<Warning>
  Commands like `drop.user.dbs` and `migration.reset` commands can result in data loss. Use with caution in production environments.
</Warning>

### Common Usage Examples

**Start development:**

```bash theme={null}
make setup
make up
make server
```

**Database operations:**

```bash theme={null}
make migration.up
make seed
```

**Container access:**

```bash theme={null}
make login.app    # Access application container
make login.db     # Access database container
```
