Artisan commands
Every command Fusion Stack adds. Run them with php artisan. fusion-stack/mcp adds api:mcp:list.
api:install
Sets up Fusion Stack in an application.
php artisan api:installIt publishes config/api.php, creates routes/api.php with a v1 group using the fusion-stack middleware, and registers it in withRouting() in bootstrap/app.php. Errors are rendered only under the API's prefix (api/* by default, from apiPrefix), so the app's web pages keep Laravel's error pages. It then offers to run the migrations for API keys, version usage and webhooks, and to install the MCP server.
| Option | What it does |
|---|---|
--mcp | Also install fusion-stack/mcp, without asking. |
--force | Overwrite config/api.php and routes/api.php. Without it, existing files are left alone. |
--without-migration-prompt | Do not offer to run the migrations. |
api:key:create
Creates an API key and shows it once. Only its hash is stored.
php artisan api:key:create "Billing service" --scope=orders:read --scope=orders:write| Argument or option | What it is |
|---|---|
name | What the key is for. |
--scope=* | A scope to grant; repeat for several, or --scope='*' for every scope. |
--pin= | The version to pin the key to. Defaults to the latest version. |
--expires-in= | Days until the key stops working, from 1 to 36500. Without it, the key never expires. |
--test | Create an fs_test_ key instead of an fs_live_ one. Production turns test keys away unless auth.test_keys_in_production is on. |
api:key:pin
Moves an API key to another version, such as when its owner upgrades.
php artisan api:key:pin 1 2026-11-30.atlas| Argument | What it is |
|---|---|
key | The API key's ID. |
version | The version to pin it to: released and not retired. Defaults to the latest version. |
api:webhook:create
Registers a webhook endpoint and shows the secret that signs its deliveries.
php artisan api:webhook:create https://example.com/webhooks --event='order.*'| Argument or option | What it is |
|---|---|
url | Where to send the webhooks. |
--event=* | An event type, such as order.created or order.*; repeat for several. Defaults to every event. |
--pin= | The version the payloads use. Defaults to the latest version. |
--description= | What the endpoint is for. |
api:version:list
Lists the versions, newest first, with their status (latest, default, deprecated with its sunset, retired, unreleased) and the version changes each introduced.
+------------------+-----------------------------------------+---------+------------------------------------------------+
| Version | Status | Changes | Description |
+------------------+-----------------------------------------+---------+------------------------------------------------+
| 2026-11-30.atlas | latest | 5 | • customer.name renamed to customer.full_name |
| 2026-06-01 | default, deprecated (sunset 2027-06-01) | 0 | |
| 2025-12-01 | retired | 0 | |
+------------------+-----------------------------------------+---------+------------------------------------------------+api:version:make
Creates a version change class in app/Api/Versions and registers it in config/api.php.
php artisan api:version:make RenameCustomerNameToFullName --date=2027-01-15| Argument or option | What it is |
|---|---|
name | The class name, in StudlyCase. |
--date= | The version that introduces the change, such as 2027-01-15 or 2027-01-15.atlas. Defaults to today. |
When the version is newer than the latest, it is unreleased: only clients that ask for it get it, until you run api:version:release.
api:version:release
Makes a version the latest in config/api.php.
php artisan api:version:release 2027-01-15The version must be newer than the current latest. When no default version is set, it sets the default to the previous latest, so clients without an Api-Version header keep their current behaviour.
api:version:usage
Shows which clients used which versions recently, so you know who to contact before retiring one.
php artisan api:version:usage 2026-06-01 --days=90| Argument or option | What it is |
|---|---|
version | Only this version. Defaults to every version. |
--days=30 | How many days back to look, today included. |
It needs api.versions.track_usage.
api:changelog
Writes a Markdown changelog of the versions from their version changes' descriptions.
| Option | What it does |
|---|---|
--output= | Write to this file instead of printing it. |
--unreleased | Include versions newer than the latest. |
api:openapi
Generates the OpenAPI 3.1 document of the API as one version sees it.
php artisan api:openapi --api-version=2026-06-01 --output=openapi.json| Option | What it does |
|---|---|
--api-version= | The version to describe. Defaults to the latest. |
--output= | Write to this file instead of printing it. |
api:docs:lint
Lists the endpoints, fields, filters, error codes and scopes the API reference has no description for, with what to add for each.
| Option | What it does |
|---|---|
--fail | Exit with an error when anything has no description, whatever api.docs.lint says. Use it in CI. |
api:mcp:list
From fusion-stack/mcp. Lists the endpoints exposed as MCP tools and resources, with their scopes and safety.
+--------------+--------------------------------+-------------+--------------+
| Tool | Endpoint | Safety | Scopes |
+--------------+--------------------------------+-------------+--------------+
| cancel_order | POST /v1/orders/{order}/cancel | destructive | orders:write |
| list_orders | GET /v1/orders | read-only | - |
+--------------+--------------------------------+-------------+--------------+