Skip to content

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.

sh
php artisan api:install

It 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.

OptionWhat it does
--mcpAlso install fusion-stack/mcp, without asking.
--forceOverwrite config/api.php and routes/api.php. Without it, existing files are left alone.
--without-migration-promptDo not offer to run the migrations.

api:key:create ​

Creates an API key and shows it once. Only its hash is stored.

sh
php artisan api:key:create "Billing service" --scope=orders:read --scope=orders:write
Argument or optionWhat it is
nameWhat 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.
--testCreate 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.

sh
php artisan api:key:pin 1 2026-11-30.atlas
ArgumentWhat it is
keyThe API key's ID.
versionThe 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.

sh
php artisan api:webhook:create https://example.com/webhooks --event='order.*'
Argument or optionWhat it is
urlWhere 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.

text
+------------------+-----------------------------------------+---------+------------------------------------------------+
| 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.

sh
php artisan api:version:make RenameCustomerNameToFullName --date=2027-01-15
Argument or optionWhat it is
nameThe 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.

sh
php artisan api:version:release 2027-01-15

The 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.

sh
php artisan api:version:usage 2026-06-01 --days=90
Argument or optionWhat it is
versionOnly this version. Defaults to every version.
--days=30How 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.

OptionWhat it does
--output=Write to this file instead of printing it.
--unreleasedInclude versions newer than the latest.

api:openapi ​

Generates the OpenAPI 3.1 document of the API as one version sees it.

sh
php artisan api:openapi --api-version=2026-06-01 --output=openapi.json
OptionWhat 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.

OptionWhat it does
--failExit 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.

text
+--------------+--------------------------------+-------------+--------------+
| Tool         | Endpoint                       | Safety      | Scopes       |
+--------------+--------------------------------+-------------+--------------+
| cancel_order | POST /v1/orders/{order}/cancel | destructive | orders:write |
| list_orders  | GET /v1/orders                 | read-only   | -            |
+--------------+--------------------------------+-------------+--------------+

Released under the MIT License.