CLI reference

CLI reference

This page is generated from the actual output of php bin/niang (Commander::help()) by scripts/generate-cli-reference.php — never retyped by hand, so that a command that is added or renamed cannot go missing here without the table below becoming visibly incomplete at the next regeneration. The CLI itself speaks French; the descriptions below are translated from resources/data/cli-reference.en.php.

Every command

CommandDescription
niang serve [host:port] Starts the development server (default 127.0.0.1:8000)
niang make:controller <Nom> Generates a controller in app/Controllers
niang make:model <Nom> Generates a model in app/Models
niang make:migration <nom> Generates a migration in database/migrations
niang make:seeder <Nom> Generates a seeder in database/seeders
niang migrate Runs pending migrations
niang migrate:rollback Rolls back the last batch of migrations
niang migrate:fresh Resets the database and replays every migration
niang db:seed [Nom] Runs DatabaseSeeder, or the given seeder
niang route:cache Compiles routes/web.php into storage/framework/routes.php
niang route:clear Deletes the route cache
niang route:list Lists every declared route
niang openapi [--output=f] [--prefix=/api] Describes the API routes in OpenAPI 3 format (public/openapi.json)
niang make:middleware <Nom> Generates a middleware in app/Middleware
niang make:request <Nom> Generates a FormRequest in app/Requests
niang tinker Interactive REPL on the application
niang key:generate Generates a new APP_KEY in .env
niang queue:work Processes pending deferred jobs
niang queue:failed Lists jobs that have used up their attempts
niang queue:retry <id> Puts a failed job back on the queue, with attempts reset
niang queue:flush Permanently deletes every failed job
niang cache:clear Clears the application cache
niang optimize Caches routes + production reminders (opcache, autoload)
niang optimize:clear Deletes the route and configuration caches
niang about Overview: versions, environment, drivers, caches
niang env Shows the current environment (APP_ENV)
niang cors:check [origine] Checks config/cors.php; simulates a preflight from an origin
niang make:notification <Nom> Generates a notification in app/Notifications
niang tenancy:install Multi-tenancy: migration for the tenants table and next steps
niang new <nom> Creates a new project and installs a site theme in it (--type=<slug> to skip the question)
niang np:install Installs the global `np` shortcut (macOS, Linux, Windows)
niang config:cache Freezes config/*.php (production only)
niang config:clear Deletes the configuration cache
niang doctor Diagnoses the environment (PHP, extensions, .env, DB, storage...)
niang health Checks runtime status (DB, cache, storage, queue) — same logic as GET /health
niang make:policy <Nom> Generates a policy in app/Policies
niang make:job <Nom> Generates a job in app/Jobs
niang make:event <Nom> Generates an event in app/Events
niang make:command <Nom> Generates a custom command in app/Console/Commands
niang make:test <Nom> Generates a test in tests/Unit
niang schedule:run Runs the scheduled tasks that are due (routes/schedule.php) — to be called every minute by cron
niang schedule:list Lists scheduled tasks and their next run
niang down [--retry=N] [--secret] Puts the site in maintenance mode (503, except /up and /health)
niang up Brings the site back out of maintenance mode
niang theme:add <vendor/paquet> Installs a theme published as a Composer package (extra.niangpro-theme)

--type= and NIANG_SITE_TYPE

The only flags and environment variables actually read by the CLI, apart from the command names and their positional arguments:

Flag / variableCommandEffect
--type=<slug>niang newPicks the site type without asking the interactive question — see Getting started.
NIANG_SITE_TYPEniang new and composer create-projectSame effect as --type=, read by SiteTypePrompt::resolve() when --type is absent.

Every other argument is positional (e.g. the model name for make:model, host:port for serve) — no other command of this framework accepts a -- flag.

Application commands (make:command)

Beyond the built-in commands above, an application can add its own:

bash
./bin/niang make:command SendNewsletter
app/Console/Commands/SendNewsletterCommand.php

namespace App\Console\Commands;

use Niang\Core\Console\Command;

class SendNewsletterCommand extends Command
{
    /** Name invoked on the CLI: niang my:name */
    public static string $signature = 'newsletter:send';

    public static string $description = "Sends today's newsletter";

    public function handle(array $arguments): void
    {
        //
    }
}

Commander scans app/Console/Commands/*.php and compares $signature with the name typed — with no match, it falls back to the general help rather than printing an error. ./bin/niang with no argument (the help, captured above) only lists the core commands: a project's application commands appear nowhere in Commander::help(), and so never in the table above — document them separately if your project adds any.

⏱ 6.23 ms 🗄 0 requête(s) SQL 🧠 4.00 MB ↩ 200