Open source
Introducing Artisan Docs
Our first open-source release: reference docs for every Artisan command in your Laravel app, in Markdown, HTML or JSON.
Artisan Docs is a Laravel package that generates reference documentation for every Artisan command registered in your application: your own commands, those from third-party packages and Laravel’s built-in ones. It is MIT-licensed, the code is on GitHub and the package is on Packagist.
Why I built it
I built Artisan Docs while I was learning Laravel. Between Laravel’s built-in commands, those from packages and my own, there were a lot of commands to keep track of, each with its own arguments and options. php artisan list shows which commands exist and --help explains them one at a time, but I wanted an overview: every command, every option and what it does, in one place. That way I could make deliberate choices instead of guessing.
The commands already describe themselves in their signatures, so Artisan Docs reads those and turns them into documentation. Because the docs come from the code, bringing them up to date is a matter of running the command again.
I figured other developers would run into the same thing, especially those learning Laravel, so I decided to open-source it.
Install
Artisan Docs needs PHP 8.1 or newer and works with Laravel 10, 11, 12 and 13.
composer require code-instinct/artisan-docs
Laravel’s auto-discovery registers the service provider, so you can run it straight away:
php artisan docs:commands
With no options, it writes a Markdown reference to docs/commands.md.
Three formats
php artisan docs:commands --format=html --output=docs/commands.html
php artisan docs:commands --format=json --output=docs/commands.json
- Markdown gives you a table of contents and tables for each command’s arguments and options, grouped by namespace. It reads well on GitHub, right next to your code.
- HTML is a single self-contained page with a sticky sidebar and no external dependencies. It gives you a visual overview of every command, which is handy when you discuss the project with teammates who don’t know the code inside out. Put it on GitHub Pages, an S3 bucket or your internal wiki.
- JSON is for tooling: feed it to Confluence, Notion or your own scripts. It also works well for AI agents. An agent can look up a command in the file itself, or you can hand it the whole file when it needs full context. Either way, it’s a quick way to tell an agent which commands your project has and which options they take.
Document only what matters
A fresh Laravel app already registers dozens of commands. When you only care about your own, narrow the output down:
# Only your application's commands (App\Console\Commands)
php artisan docs:commands --only-custom
# Leave out everything that comes from vendor/
php artisan docs:commands --exclude-vendor
# A single namespace, such as make:*
php artisan docs:commands --namespace=make
# Include commands that are normally hidden
php artisan docs:commands --include-hidden
Keep the docs in sync in CI
Generated docs are only useful while they match the code. The --check flag generates the docs in memory, compares them with the file you committed and exits with code 1 when they differ. Add it as a step in your CI pipeline and a pull request that changes a command without updating its docs fails the build.
- name: Check Artisan command docs
run: php artisan docs:commands --check
The comparison ignores the generation timestamp in each format, so it fails only on real changes: a command added or removed, or an argument or option that changed.
Safe to publish
Documentation tends to end up in public places, so Artisan Docs leaves out what shouldn’t go there:
- If an argument or option name looks like a secret, such as
password,secret,token,api_key,private_keyorcredential, its default value is replaced with[ REDACTED ]in every format. A secret that slipped into a command signature won’t slip into your docs. - The Horizon, Telescope and Nova namespaces are skipped by default, because their commands can reveal queue names, worker settings and admin tooling.
tinkerandenvare skipped too, since documenting them adds nothing and only says something about your environment.
You can change all of this in the config.
Make it yours
Publish the config to set the default format and output path, the document title, which namespaces and commands to skip, and how namespaces are grouped:
php artisan vendor:publish --tag=artisan-docs-config
To change how the HTML page looks, publish its Blade template and edit it like any other view:
php artisan vendor:publish --tag=artisan-docs-views
Releases
- 1.0.0, April 16, 2026. The first release, with Markdown, HTML and JSON output, filters and the
--checkflag. - 1.0.1, April 19, 2026. Security hardening, with secret redaction and the default Horizon, Telescope and Nova exclusions. It also made the
--checktimestamp comparison more reliable and fixed sidebar links for commands with unusual names in the HTML output. - 1.1.0, September 15, 2026. Support for Laravel 13. CI now tests every supported combination of PHP 8.1 to 8.5 and Laravel 10 to 13, instead of only the oldest one.
The full notes are on the releases page.
Get involved
Artisan Docs is our first open-source package, and we use it in our own projects, including SMP Online, the booking and billing system we built for Sportpark Marie Pampoen. If you run into a bug or miss a feature, open an issue. Pull requests are welcome too; the contributing guidelines explain how to get started. And if it saves you time, a star on GitHub helps other Laravel developers find it.